From ec9ea8b7615db5f44ee0bf3b2ec147b188080c69 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Thu, 20 Jun 2019 23:17:07 -0400 Subject: [PATCH] formatting --- .../src/ConnectedVTKViewport.js | 6 ++-- .../src/LoadingIndicator.css | 2 +- .../src/LoadingIndicator.js | 11 +++--- .../ohif-vtk-extension/src/OHIFVTKViewport.js | 35 +++++++++---------- .../ohif-vtk-extension/src/commandsModule.js | 24 ++++++------- .../src/handleSegmentationStorage.js | 11 +++--- extensions/ohif-vtk-extension/src/index.js | 2 +- .../ohif-vtk-extension/src/toolbarModule.js | 12 +++---- .../src/utils/setMPRLayout.js | 8 ++--- .../src/utils/setViewportToVTK.js | 4 +-- 10 files changed, 58 insertions(+), 57 deletions(-) diff --git a/extensions/ohif-vtk-extension/src/ConnectedVTKViewport.js b/extensions/ohif-vtk-extension/src/ConnectedVTKViewport.js index 322100222..2eb695594 100644 --- a/extensions/ohif-vtk-extension/src/ConnectedVTKViewport.js +++ b/extensions/ohif-vtk-extension/src/ConnectedVTKViewport.js @@ -24,7 +24,7 @@ const mapStateToProps = (state, ownProps) => { // Hopefully this doesn't break anything under the hood for this one // activeTool: activeButton && activeButton.command, ...dataFromStore, - enableStackPrefetch: isActive + enableStackPrefetch: isActive, }; }; @@ -38,7 +38,7 @@ const mapDispatchToProps = (dispatch, ownProps) => { setViewportSpecificData: data => { dispatch(setViewportSpecificData(viewportIndex, data)); - } + }, }; }; @@ -66,7 +66,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => { if (afterCreation && typeof afterCreation === 'function') { afterCreation(api); } - } + }, }; return props; }; diff --git a/extensions/ohif-vtk-extension/src/LoadingIndicator.css b/extensions/ohif-vtk-extension/src/LoadingIndicator.css index 0883f66cb..e722fdab5 100644 --- a/extensions/ohif-vtk-extension/src/LoadingIndicator.css +++ b/extensions/ohif-vtk-extension/src/LoadingIndicator.css @@ -1,5 +1,5 @@ .imageViewerLoadingIndicator { - color: #91B9CD; + color: #91b9cd; } .loadingIndicator { diff --git a/extensions/ohif-vtk-extension/src/LoadingIndicator.js b/extensions/ohif-vtk-extension/src/LoadingIndicator.js index 7dc5e4614..06bcbf4db 100644 --- a/extensions/ohif-vtk-extension/src/LoadingIndicator.js +++ b/extensions/ohif-vtk-extension/src/LoadingIndicator.js @@ -1,17 +1,18 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; - import './LoadingIndicator.css'; +import React, { PureComponent } from 'react'; + +import PropTypes from 'prop-types'; + class LoadingIndicator extends PureComponent { static propTypes = { percentComplete: PropTypes.number.isRequired, - error: PropTypes.object + error: PropTypes.object, }; static defaultProps = { percentComplete: 0, - error: null + error: null, }; render() { diff --git a/extensions/ohif-vtk-extension/src/OHIFVTKViewport.js b/extensions/ohif-vtk-extension/src/OHIFVTKViewport.js index ff9eb3b7b..a42ac75b3 100644 --- a/extensions/ohif-vtk-extension/src/OHIFVTKViewport.js +++ b/extensions/ohif-vtk-extension/src/OHIFVTKViewport.js @@ -1,17 +1,16 @@ import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import OHIF from 'ohif-core'; -import cornerstone from 'cornerstone-core'; import { getImageData, loadImageData } from 'react-vtkjs-viewport'; +import ConnectedVTKViewport from './ConnectedVTKViewport'; +import LoadingIndicator from './LoadingIndicator.js'; +import OHIF from 'ohif-core'; +import PropTypes from 'prop-types'; +import cornerstone from 'cornerstone-core'; +import handleSegmentationStorage from './handleSegmentationStorage.js'; +import vtkDataArray from 'vtk.js/Sources/Common/Core/DataArray'; +import vtkImageData from 'vtk.js/Sources/Common/DataModel/ImageData'; import vtkVolume from 'vtk.js/Sources/Rendering/Core/Volume'; import vtkVolumeMapper from 'vtk.js/Sources/Rendering/Core/VolumeMapper'; -import vtkImageData from 'vtk.js/Sources/Common/DataModel/ImageData'; -import vtkDataArray from 'vtk.js/Sources/Common/Core/DataArray'; - -import ConnectedVTKViewport from './ConnectedVTKViewport'; -import handleSegmentationStorage from './handleSegmentationStorage.js'; -import LoadingIndicator from './LoadingIndicator.js'; const { StackManager } = OHIF.utils; @@ -25,7 +24,7 @@ cornerstone.metaData.addProvider( StackManager.setMetadataProvider(metadataProvider); const SOP_CLASSES = { - SEGMENTATION_STORAGE: '1.2.840.10008.5.1.4.1.1.66.4' + SEGMENTATION_STORAGE: '1.2.840.10008.5.1.4.1.1.66.4', }; const specialCaseHandlers = {}; @@ -51,7 +50,7 @@ function createLabelMapImageData(backgroundImageData) { const values = new Uint8Array(backgroundImageData.getNumberOfPoints()); const dataArray = vtkDataArray.newInstance({ numberOfComponents: 1, // labelmap with single component - values + values, }); labelMapData.getPointData().setScalars(dataArray); @@ -62,14 +61,14 @@ class OHIFVTKViewport extends Component { state = { volumes: null, paintFilterLabelMapImageData: null, - paintFilterBackgroundImageData: null + paintFilterBackgroundImageData: null, }; static propTypes = { studies: PropTypes.object, displaySet: PropTypes.object, viewportIndex: PropTypes.number, - children: PropTypes.node + children: PropTypes.node, }; static id = 'OHIFVTKViewport'; @@ -165,7 +164,7 @@ class OHIFVTKViewport extends Component { return loadImageData(imageDataObject).then(() => { return { data: imageDataObject.vtkImageData, - labelmap: labelmapDataObject + labelmap: labelmapDataObject, }; }); default: @@ -173,7 +172,7 @@ class OHIFVTKViewport extends Component { return loadImageData(imageDataObject).then(() => { return { - data: imageDataObject.vtkImageData + data: imageDataObject.vtkImageData, }; }); } @@ -202,7 +201,7 @@ class OHIFVTKViewport extends Component { displaySetInstanceUid, sopClassUids, sopInstanceUid, - frameIndex + frameIndex, } = displaySet; if (sopClassUids.length > 1) { @@ -231,7 +230,7 @@ class OHIFVTKViewport extends Component { this.setState({ volumes: [volumeActor], paintFilterBackgroundImageData: data, - paintFilterLabelMapImageData: labelmap + paintFilterLabelMapImageData: labelmap, }); } @@ -261,7 +260,7 @@ class OHIFVTKViewport extends Component { childrenWithProps = this.props.children.map((child, index) => { return React.cloneElement(child, { viewportIndex: this.props.viewportIndex, - key: index + key: index, }); }); } diff --git a/extensions/ohif-vtk-extension/src/commandsModule.js b/extensions/ohif-vtk-extension/src/commandsModule.js index 6f0f81022..b8cc692c0 100644 --- a/extensions/ohif-vtk-extension/src/commandsModule.js +++ b/extensions/ohif-vtk-extension/src/commandsModule.js @@ -3,7 +3,7 @@ import { vtkInteractorStyleMPRSlice, vtkInteractorStyleMPRWindowLevel, vtkSVGCrosshairsWidget, - vtkSVGWidgetManager + vtkSVGWidgetManager, } from 'react-vtkjs-viewport'; import setMPRLayout from './utils/setMPRLayout.js'; @@ -230,7 +230,7 @@ const actions = { api.svgWidgetManager = svgWidgetManager; api.svgWidgets = { - crosshairsWidget + crosshairsWidget, }; switch (index) { @@ -255,49 +255,49 @@ const actions = { renderWindow.render(); }); - } + }, }; const definitions = { axial: { commandFn: actions.axial, storeContexts: ['viewports'], - options: {} + options: {}, }, coronal: { commandFn: actions.coronal, storeContexts: ['viewports'], - options: {} + options: {}, }, sagittal: { commandFn: actions.sagittal, storeContexts: ['viewports'], - options: {} + options: {}, }, enableRotateTool: { commandFn: actions.enableRotateTool, storeContexts: ['viewports'], - options: {} + options: {}, }, enableCrosshairsTool: { commandFn: actions.enableCrosshairsTool, storeContexts: ['viewports'], - options: {} + options: {}, }, enableLevelTool: { commandFn: actions.enableLevelTool, storeContexts: ['viewports'], - options: {} + options: {}, }, mpr2d: { commandFn: actions.mpr2d, storeContexts: ['viewports'], options: {}, - context: 'VIEWER' - } + context: 'VIEWER', + }, }; export default { definitions, - defaultContext: 'ACTIVE_VIEWPORT::VTK' + defaultContext: 'ACTIVE_VIEWPORT::VTK', }; diff --git a/extensions/ohif-vtk-extension/src/handleSegmentationStorage.js b/extensions/ohif-vtk-extension/src/handleSegmentationStorage.js index 6941b9712..1988456cd 100644 --- a/extensions/ohif-vtk-extension/src/handleSegmentationStorage.js +++ b/extensions/ohif-vtk-extension/src/handleSegmentationStorage.js @@ -1,5 +1,6 @@ -import OHIF from 'ohif-core'; import * as dcmjs from 'dcmjs'; + +import OHIF from 'ohif-core'; import { api } from 'dicomweb-client'; const { StackManager } = OHIF.utils; @@ -56,14 +57,14 @@ function retrieveDicomData( ) { const config = { url: wadoRoot, - headers: DICOMWeb.getAuthorizationHeader() + headers: DICOMWeb.getAuthorizationHeader(), }; const dicomWeb = new api.DICOMwebClient(config); const options = { studyInstanceUID, seriesInstanceUID, - sopInstanceUID + sopInstanceUID, }; return dicomWeb.retrieveInstance(options); @@ -136,13 +137,13 @@ async function handleSegmentationStorage( return { referenceDataObject, - labelmapDataObject + labelmapDataObject, }; return { studyInstanceUid, displaySetInstanceUid, - stack + stack, }; } diff --git a/extensions/ohif-vtk-extension/src/index.js b/extensions/ohif-vtk-extension/src/index.js index 6b8a16472..726b13c7c 100644 --- a/extensions/ohif-vtk-extension/src/index.js +++ b/extensions/ohif-vtk-extension/src/index.js @@ -18,7 +18,7 @@ export default { }, getCommandsModule() { return commandsModule; - } + }, }; loadLocales(); diff --git a/extensions/ohif-vtk-extension/src/toolbarModule.js b/extensions/ohif-vtk-extension/src/toolbarModule.js index 5f70d4bd8..fed4f54db 100644 --- a/extensions/ohif-vtk-extension/src/toolbarModule.js +++ b/extensions/ohif-vtk-extension/src/toolbarModule.js @@ -1,6 +1,6 @@ const TOOLBAR_BUTTON_TYPES = { COMMAND: 'command', - SET_TOOL_ACTIVE: 'setToolActive' + SET_TOOL_ACTIVE: 'setToolActive', }; const definitions = [ @@ -11,7 +11,7 @@ const definitions = [ // type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE, commandName: 'enableCrosshairsTool', - commandOptions: {} + commandOptions: {}, }, { id: 'WWWC', @@ -20,7 +20,7 @@ const definitions = [ // type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE, commandName: 'enableLevelTool', - commandOptions: {} + commandOptions: {}, }, { id: 'Rotate', @@ -29,11 +29,11 @@ const definitions = [ // type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE, commandName: 'enableRotateTool', - commandOptions: {} - } + commandOptions: {}, + }, ]; export default { definitions, - defaultContext: 'ACTIVE_VIEWPORT::VTK' + defaultContext: 'ACTIVE_VIEWPORT::VTK', }; diff --git a/extensions/ohif-vtk-extension/src/utils/setMPRLayout.js b/extensions/ohif-vtk-extension/src/utils/setMPRLayout.js index f7f7039dc..6de1023f4 100644 --- a/extensions/ohif-vtk-extension/src/utils/setMPRLayout.js +++ b/extensions/ohif-vtk-extension/src/utils/setMPRLayout.js @@ -11,14 +11,14 @@ export default function setMPRLayout(displaySet) { for (let i = 0; i < numViewports; i++) { viewports.push({ height: `${100 / rows}%`, - width: `${100 / columns}%` + width: `${100 / columns}%`, }); viewportSpecificData[i] = displaySet; viewportSpecificData[i].plugin = 'vtk'; } const layout = { - viewports + viewports, }; const viewportIndices = [0, 1, 2]; @@ -42,8 +42,8 @@ export default function setMPRLayout(displaySet) { if (apis.every(a => !!a)) { resolve(apis); } - } - } + }, + }, }; updatedViewports = setSingleLayoutData( diff --git a/extensions/ohif-vtk-extension/src/utils/setViewportToVTK.js b/extensions/ohif-vtk-extension/src/utils/setViewportToVTK.js index 41d6db8d9..aa3dfb679 100644 --- a/extensions/ohif-vtk-extension/src/utils/setViewportToVTK.js +++ b/extensions/ohif-vtk-extension/src/utils/setViewportToVTK.js @@ -19,8 +19,8 @@ export default function setViewportToVTK( mode: 'mpr', // TODO: not used afterCreation: api => { resolve(api); - } - } + }, + }, }; const updatedViewports = setSingleLayoutData(