formatting

This commit is contained in:
dannyrb 2019-06-20 23:17:07 -04:00
parent aa250a9210
commit ec9ea8b761
10 changed files with 58 additions and 57 deletions

View File

@ -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;
};

View File

@ -1,5 +1,5 @@
.imageViewerLoadingIndicator {
color: #91B9CD;
color: #91b9cd;
}
.loadingIndicator {

View File

@ -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() {

View File

@ -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,
});
});
}

View File

@ -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',
};

View File

@ -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,
};
}

View File

@ -18,7 +18,7 @@ export default {
},
getCommandsModule() {
return commandsModule;
}
},
};
loadLocales();

View File

@ -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',
};

View File

@ -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(

View File

@ -19,8 +19,8 @@ export default function setViewportToVTK(
mode: 'mpr', // TODO: not used
afterCreation: api => {
resolve(api);
}
}
},
},
};
const updatedViewports = setSingleLayoutData(