ohif-core --> @ohif/core
This commit is contained in:
parent
8c5bd55f88
commit
755da173ea
@ -197,9 +197,9 @@ would like included at startup.
|
||||
_app.js_
|
||||
|
||||
```js
|
||||
import { createStore, combineReducers } from 'redux';
|
||||
import OHIF from 'ohif-core';
|
||||
import OHIFCornerstoneExtension from 'ohif-cornerstone-extension';
|
||||
import { createStore, combineReducers } from "redux";
|
||||
import OHIF from "@ohif/core";
|
||||
import OHIFCornerstoneExtension from "ohif-cornerstone-extension";
|
||||
|
||||
const combined = combineReducers(OHIF.redux.reducers);
|
||||
const store = createStore(combined);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import CornerstoneViewport from 'react-cornerstone-viewport';
|
||||
import OHIF from 'ohif-core';
|
||||
import { connect } from 'react-redux';
|
||||
import throttle from 'lodash.throttle';
|
||||
import CornerstoneViewport from "react-cornerstone-viewport";
|
||||
import OHIF from "@ohif/core";
|
||||
import { connect } from "react-redux";
|
||||
import throttle from "lodash.throttle";
|
||||
|
||||
const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions;
|
||||
|
||||
@ -37,7 +37,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
enableStackPrefetch: isActive,
|
||||
//stack: viewportSpecificData.stack,
|
||||
cineToolData: viewportSpecificData.cine,
|
||||
viewport: viewportSpecificData.viewport,
|
||||
viewport: viewportSpecificData.viewport
|
||||
};
|
||||
};
|
||||
|
||||
@ -64,8 +64,8 @@ const mapDispatchToProps = (dispatch, ownProps) => {
|
||||
dispatch(
|
||||
setViewportSpecificData(viewportIndex, {
|
||||
// TODO: Hack to make sure our plugin info is available from the outset
|
||||
plugin: 'cornerstone',
|
||||
dom: enabledElement,
|
||||
plugin: "cornerstone",
|
||||
dom: enabledElement
|
||||
})
|
||||
);
|
||||
},
|
||||
@ -74,18 +74,18 @@ const mapDispatchToProps = (dispatch, ownProps) => {
|
||||
const {
|
||||
onAdded,
|
||||
onRemoved,
|
||||
onModified,
|
||||
onModified
|
||||
} = OHIF.measurements.MeasurementHandlers;
|
||||
const actions = {
|
||||
added: onAdded,
|
||||
removed: onRemoved,
|
||||
modified: throttle(event => {
|
||||
return onModified(event);
|
||||
}, 300),
|
||||
}, 300)
|
||||
};
|
||||
|
||||
return actions[action](event);
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import React, { Component } from 'react';
|
||||
import React, { Component } from "react";
|
||||
|
||||
import ConnectedCornerstoneViewport from './ConnectedCornerstoneViewport';
|
||||
import OHIF from 'ohif-core';
|
||||
import PropTypes from 'prop-types';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import handleSegmentationStorage from './handleSegmentationStorage.js';
|
||||
import ConnectedCornerstoneViewport from "./ConnectedCornerstoneViewport";
|
||||
import OHIF from "@ohif/core";
|
||||
import PropTypes from "prop-types";
|
||||
import cornerstone from "cornerstone-core";
|
||||
import handleSegmentationStorage from "./handleSegmentationStorage.js";
|
||||
|
||||
const { StackManager } = OHIF.utils;
|
||||
|
||||
@ -18,7 +18,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 = {};
|
||||
@ -28,11 +28,11 @@ specialCaseHandlers[
|
||||
|
||||
class OHIFCornerstoneViewport extends Component {
|
||||
state = {
|
||||
viewportData: null,
|
||||
viewportData: null
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
customProps: {},
|
||||
customProps: {}
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
@ -40,17 +40,17 @@ class OHIFCornerstoneViewport extends Component {
|
||||
displaySet: PropTypes.object,
|
||||
viewportIndex: PropTypes.number,
|
||||
children: PropTypes.node,
|
||||
customProps: PropTypes.object,
|
||||
customProps: PropTypes.object
|
||||
};
|
||||
|
||||
static id = 'OHIFCornerstoneViewport';
|
||||
static id = "OHIFCornerstoneViewport";
|
||||
|
||||
static init() {
|
||||
console.log('OHIFCornerstoneViewport init()');
|
||||
console.log("OHIFCornerstoneViewport init()");
|
||||
}
|
||||
|
||||
static destroy() {
|
||||
console.log('OHIFCornerstoneViewport destroy()');
|
||||
console.log("OHIFCornerstoneViewport destroy()");
|
||||
StackManager.clearStacks();
|
||||
}
|
||||
|
||||
@ -72,15 +72,15 @@ class OHIFCornerstoneViewport extends Component {
|
||||
frameIndex = 0
|
||||
) {
|
||||
if (!studies || !studies.length) {
|
||||
throw new Error('Studies not provided.');
|
||||
throw new Error("Studies not provided.");
|
||||
}
|
||||
|
||||
if (!studyInstanceUid) {
|
||||
throw new Error('StudyInstanceUID not provided.');
|
||||
throw new Error("StudyInstanceUID not provided.");
|
||||
}
|
||||
|
||||
if (!displaySetInstanceUid) {
|
||||
throw new Error('StudyInstanceUID not provided.');
|
||||
throw new Error("StudyInstanceUID not provided.");
|
||||
}
|
||||
|
||||
// Create shortcut to displaySet
|
||||
@ -89,7 +89,7 @@ class OHIFCornerstoneViewport extends Component {
|
||||
);
|
||||
|
||||
if (!study) {
|
||||
throw new Error('Study not found.');
|
||||
throw new Error("Study not found.");
|
||||
}
|
||||
|
||||
const displaySet = study.displaySets.find(set => {
|
||||
@ -97,7 +97,7 @@ class OHIFCornerstoneViewport extends Component {
|
||||
});
|
||||
|
||||
if (!displaySet) {
|
||||
throw new Error('Display Set not found.');
|
||||
throw new Error("Display Set not found.");
|
||||
}
|
||||
|
||||
// Get stack from Stack Manager
|
||||
@ -110,7 +110,7 @@ class OHIFCornerstoneViewport extends Component {
|
||||
if (sopInstanceUid) {
|
||||
const index = stack.imageIds.findIndex(imageId => {
|
||||
const sopCommonModule = cornerstone.metaData.get(
|
||||
'sopCommonModule',
|
||||
"sopCommonModule",
|
||||
imageId
|
||||
);
|
||||
if (!sopCommonModule) {
|
||||
@ -124,7 +124,7 @@ class OHIFCornerstoneViewport extends Component {
|
||||
stack.currentImageIdIndex = index;
|
||||
} else {
|
||||
console.warn(
|
||||
'SOPInstanceUID provided was not found in specified DisplaySet'
|
||||
"SOPInstanceUID provided was not found in specified DisplaySet"
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -183,7 +183,7 @@ class OHIFCornerstoneViewport extends Component {
|
||||
viewportData = {
|
||||
studyInstanceUid,
|
||||
displaySetInstanceUid,
|
||||
stack,
|
||||
stack
|
||||
};
|
||||
|
||||
break;
|
||||
@ -199,12 +199,12 @@ class OHIFCornerstoneViewport extends Component {
|
||||
displaySetInstanceUid,
|
||||
sopClassUids,
|
||||
sopInstanceUid,
|
||||
frameIndex,
|
||||
frameIndex
|
||||
} = displaySet;
|
||||
|
||||
if (sopClassUids && sopClassUids.length > 1) {
|
||||
console.warn(
|
||||
'More than one SOPClassUid in the same series is not yet supported.'
|
||||
"More than one SOPClassUid in the same series is not yet supported."
|
||||
);
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ class OHIFCornerstoneViewport extends Component {
|
||||
frameIndex
|
||||
).then(viewportData => {
|
||||
this.setState({
|
||||
viewportData,
|
||||
viewportData
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -250,7 +250,7 @@ class OHIFCornerstoneViewport extends Component {
|
||||
childrenWithProps = this.props.children.map((child, index) => {
|
||||
return React.cloneElement(child, {
|
||||
viewportIndex: this.props.viewportIndex,
|
||||
key: index,
|
||||
key: index
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import * as dcmjs from 'dcmjs';
|
||||
import * as dcmjs from "dcmjs";
|
||||
|
||||
import OHIF from 'ohif-core';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import cornerstoneTools from 'cornerstone-tools';
|
||||
import OHIF from "@ohif/core";
|
||||
import cornerstone from "cornerstone-core";
|
||||
import cornerstoneTools from "cornerstone-tools";
|
||||
|
||||
const { StackManager } = OHIF.utils;
|
||||
|
||||
@ -56,7 +56,7 @@ function retrieveDicomData(wadoUri) {
|
||||
// TODO: Authorization header depends on the server. If we ever have multiple servers
|
||||
// we will need to figure out how / when to pass this information in.
|
||||
return fetch(wadoUri, {
|
||||
headers: OHIF.DICOMWeb.getAuthorizationHeader(),
|
||||
headers: OHIF.DICOMWeb.getAuthorizationHeader()
|
||||
}).then(response => response.arrayBuffer());
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ async function handleSegmentationStorage(
|
||||
|
||||
if (displaySets.length > 1) {
|
||||
console.warn(
|
||||
'More than one display set with the same seriesInstanceUid. This is not supported yet...'
|
||||
"More than one display set with the same seriesInstanceUid. This is not supported yet..."
|
||||
);
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ async function handleSegmentationStorage(
|
||||
const results = parseSeg(arrayBuffer, imageIds);
|
||||
|
||||
if (!results) {
|
||||
throw new Error('Fractional segmentations are not supported');
|
||||
throw new Error("Fractional segmentations are not supported");
|
||||
}
|
||||
|
||||
const { segMetadata, toolState } = results;
|
||||
@ -123,7 +123,7 @@ async function handleSegmentationStorage(
|
||||
return {
|
||||
studyInstanceUid,
|
||||
displaySetInstanceUid,
|
||||
stack,
|
||||
stack
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import { MODULE_TYPES, utils } from 'ohif-core';
|
||||
import { MODULE_TYPES, utils } from "@ohif/core";
|
||||
|
||||
// TODO: Should probably use dcmjs for this
|
||||
const SOP_CLASS_UIDS = {
|
||||
BASIC_TEXT_SR: '1.2.840.10008.5.1.4.1.1.88.11',
|
||||
ENHANCED_SR: '1.2.840.10008.5.1.4.1.1.88.22',
|
||||
COMPREHENSIVE_SR: '1.2.840.10008.5.1.4.1.1.88.33',
|
||||
PROCEDURE_LOG_STORAGE: '1.2.840.10008.5.1.4.1.1.88.40',
|
||||
MAMMOGRAPHY_CAD_SR: '1.2.840.10008.5.1.4.1.1.88.50',
|
||||
CHEST_CAD_SR: '1.2.840.10008.5.1.4.1.1.88.65',
|
||||
X_RAY_RADIATION_DOSE_SR: '1.2.840.10008.5.1.4.1.1.88.67'
|
||||
BASIC_TEXT_SR: "1.2.840.10008.5.1.4.1.1.88.11",
|
||||
ENHANCED_SR: "1.2.840.10008.5.1.4.1.1.88.22",
|
||||
COMPREHENSIVE_SR: "1.2.840.10008.5.1.4.1.1.88.33",
|
||||
PROCEDURE_LOG_STORAGE: "1.2.840.10008.5.1.4.1.1.88.40",
|
||||
MAMMOGRAPHY_CAD_SR: "1.2.840.10008.5.1.4.1.1.88.50",
|
||||
CHEST_CAD_SR: "1.2.840.10008.5.1.4.1.1.88.65",
|
||||
X_RAY_RADIATION_DOSE_SR: "1.2.840.10008.5.1.4.1.1.88.67"
|
||||
};
|
||||
|
||||
const sopClassUids = Object.values(SOP_CLASS_UIDS);
|
||||
@ -16,14 +16,14 @@ const sopClassUids = Object.values(SOP_CLASS_UIDS);
|
||||
// TODO: Handle the case where there is more than one SOP Class Handler for the
|
||||
// same SOP Class
|
||||
const OHIFDicomHtmlSopClassHandler = {
|
||||
id: 'OHIFDicomHtmlSopClassHandler',
|
||||
id: "OHIFDicomHtmlSopClassHandler",
|
||||
type: MODULE_TYPES.SOP_CLASS_HANDLER,
|
||||
sopClassUids,
|
||||
getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) {
|
||||
const instance = series.getFirstInstance();
|
||||
|
||||
return {
|
||||
plugin: 'html',
|
||||
plugin: "html",
|
||||
displaySetInstanceUid: utils.guid(),
|
||||
wadoRoot: study.getData().wadoRoot,
|
||||
wadoUri: instance.getData().wadouri,
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import OHIF from 'ohif-core';
|
||||
import OHIF from "@ohif/core";
|
||||
|
||||
const { utils } = OHIF;
|
||||
|
||||
const SOP_CLASS_UIDS = {
|
||||
VL_WHOLE_SLIDE_MICROSCOPY_IMAGE_STORAGE: '1.2.840.10008.5.1.4.1.1.77.1.6',
|
||||
VL_WHOLE_SLIDE_MICROSCOPY_IMAGE_STORAGE: "1.2.840.10008.5.1.4.1.1.77.1.6"
|
||||
};
|
||||
|
||||
const DicomMicroscopySopClassHandler = {
|
||||
id: 'DicomMicroscopySopClassHandlerPlugin',
|
||||
id: "DicomMicroscopySopClassHandlerPlugin",
|
||||
sopClassUids: [SOP_CLASS_UIDS.VL_WHOLE_SLIDE_MICROSCOPY_IMAGE_STORAGE],
|
||||
getDisplaySetFromSeries(series, study, dicomWebClient) {
|
||||
const instance = series.getFirstInstance();
|
||||
@ -15,14 +15,14 @@ const DicomMicroscopySopClassHandler = {
|
||||
// Note: We are passing the dicomweb client into each viewport!
|
||||
|
||||
return {
|
||||
plugin: 'microscopy',
|
||||
plugin: "microscopy",
|
||||
displaySetInstanceUid: utils.guid(),
|
||||
dicomWebClient,
|
||||
sopInstanceUid: instance.getSOPInstanceUID(),
|
||||
seriesInstanceUid: series.getSeriesInstanceUID(),
|
||||
studyInstanceUid: study.getStudyInstanceUID(),
|
||||
studyInstanceUid: study.getStudyInstanceUID()
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
export default DicomMicroscopySopClassHandler;
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
import { MODULE_TYPES, utils } from 'ohif-core';
|
||||
import { MODULE_TYPES, utils } from "@ohif/core";
|
||||
|
||||
// TODO: Should probably use dcmjs for this
|
||||
const SOP_CLASS_UIDS = {
|
||||
ENCAPSULATED_PDF: '1.2.840.10008.5.1.4.1.1.104.1'
|
||||
ENCAPSULATED_PDF: "1.2.840.10008.5.1.4.1.1.104.1"
|
||||
};
|
||||
|
||||
const OHIFDicomPDFSopClassHandler = {
|
||||
id: 'OHIFDicomPDFSopClassHandlerPlugin',
|
||||
id: "OHIFDicomPDFSopClassHandlerPlugin",
|
||||
type: MODULE_TYPES.SOP_CLASS_HANDLER,
|
||||
sopClassUids: [SOP_CLASS_UIDS.ENCAPSULATED_PDF],
|
||||
getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) {
|
||||
const instance = series.getFirstInstance();
|
||||
|
||||
return {
|
||||
plugin: 'pdf',
|
||||
plugin: "pdf",
|
||||
displaySetInstanceUid: utils.guid(),
|
||||
wadoRoot: study.getData().wadoRoot,
|
||||
wadoUri: instance.getData().wadouri,
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import OHIF from 'ohif-core';
|
||||
import OHIFComponentPlugin from './OHIFComponentPlugin.js';
|
||||
import DicomPDFViewport from './DicomPDFViewport';
|
||||
import React, { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import OHIF from "@ohif/core";
|
||||
import OHIFComponentPlugin from "./OHIFComponentPlugin.js";
|
||||
import DicomPDFViewport from "./DicomPDFViewport";
|
||||
|
||||
const { DICOMWeb } = OHIF;
|
||||
|
||||
@ -18,44 +18,69 @@ class OHIFDicomPDFViewport extends Component {
|
||||
error: null
|
||||
};
|
||||
|
||||
static id = 'DicomPDFViewportPDF';
|
||||
static id = "DicomPDFViewportPDF";
|
||||
|
||||
static init() {
|
||||
console.log('DicomPDFViewport init()');
|
||||
console.log("DicomPDFViewport init()");
|
||||
}
|
||||
|
||||
static destroy() {
|
||||
console.log('DicomPDFViewport destroy()');
|
||||
console.log("DicomPDFViewport destroy()");
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { displaySet } = this.props.viewportData;
|
||||
const { studyInstanceUid, seriesInstanceUid, sopInstanceUid, wadoRoot, wadoUri, authorizationHeaders} = displaySet;
|
||||
const {
|
||||
studyInstanceUid,
|
||||
seriesInstanceUid,
|
||||
sopInstanceUid,
|
||||
wadoRoot,
|
||||
wadoUri,
|
||||
authorizationHeaders
|
||||
} = displaySet;
|
||||
|
||||
this.retrieveDicomData(studyInstanceUid, seriesInstanceUid, sopInstanceUid, wadoRoot, wadoUri, authorizationHeaders).then(byteArray => {
|
||||
this.setState({
|
||||
byteArray
|
||||
});
|
||||
}, error => {
|
||||
this.setState({
|
||||
error
|
||||
});
|
||||
this.retrieveDicomData(
|
||||
studyInstanceUid,
|
||||
seriesInstanceUid,
|
||||
sopInstanceUid,
|
||||
wadoRoot,
|
||||
wadoUri,
|
||||
authorizationHeaders
|
||||
).then(
|
||||
byteArray => {
|
||||
this.setState({
|
||||
byteArray
|
||||
});
|
||||
},
|
||||
error => {
|
||||
this.setState({
|
||||
error
|
||||
});
|
||||
|
||||
throw new Error(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
retrieveDicomData(studyInstanceUid, seriesInstanceUid, sopInstanceUid, wadoRoot, wadoUri, authorizationHeaders) {
|
||||
retrieveDicomData(
|
||||
studyInstanceUid,
|
||||
seriesInstanceUid,
|
||||
sopInstanceUid,
|
||||
wadoRoot,
|
||||
wadoUri,
|
||||
authorizationHeaders
|
||||
) {
|
||||
// TODO: Passing in a lot of data we aren't using
|
||||
|
||||
// TODO: Authorization header depends on the server. If we ever have multiple servers
|
||||
// we will need to figure out how / when to pass this information in.
|
||||
return fetch(wadoUri, {
|
||||
headers: authorizationHeaders
|
||||
}).then(response => response.arrayBuffer()).then(arraybuffer => {
|
||||
return new Uint8Array(arraybuffer);
|
||||
});
|
||||
})
|
||||
.then(response => response.arrayBuffer())
|
||||
.then(arraybuffer => {
|
||||
return new Uint8Array(arraybuffer);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import OHIF from 'ohif-core';
|
||||
import { View2D } from 'react-vtkjs-viewport';
|
||||
import { connect } from 'react-redux';
|
||||
import OHIF from "@ohif/core";
|
||||
import { View2D } from "react-vtkjs-viewport";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const { setViewportActive, setViewportSpecificData } = OHIF.redux.actions;
|
||||
|
||||
@ -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));
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -63,10 +63,10 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
||||
// Store the API details for later
|
||||
//setViewportSpecificData({ vtkApi: api });
|
||||
|
||||
if (afterCreation && typeof afterCreation === 'function') {
|
||||
if (afterCreation && typeof afterCreation === "function") {
|
||||
afterCreation(api);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
return props;
|
||||
};
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
import React, { Component } from 'react';
|
||||
import { getImageData, loadImageData } from 'react-vtkjs-viewport';
|
||||
import React, { Component } from "react";
|
||||
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 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";
|
||||
|
||||
const { StackManager } = OHIF.utils;
|
||||
|
||||
@ -24,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 = {};
|
||||
@ -42,7 +42,7 @@ const volumeCache = {};
|
||||
*/
|
||||
function createLabelMapImageData(backgroundImageData) {
|
||||
const labelMapData = vtkImageData.newInstance(
|
||||
backgroundImageData.get('spacing', 'origin', 'direction')
|
||||
backgroundImageData.get("spacing", "origin", "direction")
|
||||
);
|
||||
labelMapData.setDimensions(backgroundImageData.getDimensions());
|
||||
labelMapData.computeTransforms();
|
||||
@ -50,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);
|
||||
|
||||
@ -61,24 +61,24 @@ 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';
|
||||
static id = "OHIFVTKViewport";
|
||||
|
||||
static init() {
|
||||
console.log('OHIFVTKViewport init()');
|
||||
console.log("OHIFVTKViewport init()");
|
||||
}
|
||||
|
||||
static destroy() {
|
||||
console.log('OHIFVTKViewport destroy()');
|
||||
console.log("OHIFVTKViewport destroy()");
|
||||
StackManager.clearStacks();
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ class OHIFVTKViewport extends Component {
|
||||
} else if (sopInstanceUid) {
|
||||
const index = stack.imageIds.findIndex(imageId => {
|
||||
const sopCommonModule = cornerstone.metaData.get(
|
||||
'sopCommonModule',
|
||||
"sopCommonModule",
|
||||
imageId
|
||||
);
|
||||
if (!sopCommonModule) {
|
||||
@ -151,7 +151,7 @@ class OHIFVTKViewport extends Component {
|
||||
|
||||
switch (sopClassUid) {
|
||||
case SOP_CLASSES.SEGMENTATION_STORAGE:
|
||||
throw new Error('Not yet implemented');
|
||||
throw new Error("Not yet implemented");
|
||||
|
||||
const data = handleSegmentationStorage(
|
||||
stack.imageIds,
|
||||
@ -164,7 +164,7 @@ class OHIFVTKViewport extends Component {
|
||||
return loadImageData(imageDataObject).then(() => {
|
||||
return {
|
||||
data: imageDataObject.vtkImageData,
|
||||
labelmap: labelmapDataObject,
|
||||
labelmap: labelmapDataObject
|
||||
};
|
||||
});
|
||||
default:
|
||||
@ -172,7 +172,7 @@ class OHIFVTKViewport extends Component {
|
||||
|
||||
return loadImageData(imageDataObject).then(() => {
|
||||
return {
|
||||
data: imageDataObject.vtkImageData,
|
||||
data: imageDataObject.vtkImageData
|
||||
};
|
||||
});
|
||||
}
|
||||
@ -201,12 +201,12 @@ class OHIFVTKViewport extends Component {
|
||||
displaySetInstanceUid,
|
||||
sopClassUids,
|
||||
sopInstanceUid,
|
||||
frameIndex,
|
||||
frameIndex
|
||||
} = displaySet;
|
||||
|
||||
if (sopClassUids.length > 1) {
|
||||
console.warn(
|
||||
'More than one SOPClassUid in the same series is not yet supported.'
|
||||
"More than one SOPClassUid in the same series is not yet supported."
|
||||
);
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ class OHIFVTKViewport extends Component {
|
||||
this.setState({
|
||||
volumes: [volumeActor],
|
||||
paintFilterBackgroundImageData: data,
|
||||
paintFilterLabelMapImageData: labelmap,
|
||||
paintFilterLabelMapImageData: labelmap
|
||||
});
|
||||
}
|
||||
|
||||
@ -260,12 +260,12 @@ class OHIFVTKViewport extends Component {
|
||||
childrenWithProps = this.props.children.map((child, index) => {
|
||||
return React.cloneElement(child, {
|
||||
viewportIndex: this.props.viewportIndex,
|
||||
key: index,
|
||||
key: index
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const style = { width: '100%', height: '100%', position: 'relative' };
|
||||
const style = { width: "100%", height: "100%", position: "relative" };
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import * as dcmjs from 'dcmjs';
|
||||
import * as dcmjs from "dcmjs";
|
||||
|
||||
import OHIF from 'ohif-core';
|
||||
import { api } from 'dicomweb-client';
|
||||
import OHIF from "@ohif/core";
|
||||
import { api } from "dicomweb-client";
|
||||
|
||||
const { StackManager } = OHIF.utils;
|
||||
|
||||
@ -57,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);
|
||||
@ -117,7 +117,7 @@ async function handleSegmentationStorage(
|
||||
|
||||
if (displaySets.length > 1) {
|
||||
console.warn(
|
||||
'More than one display set with the same seriesInstanceUid. This is not supported yet...'
|
||||
"More than one display set with the same seriesInstanceUid. This is not supported yet..."
|
||||
);
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ async function handleSegmentationStorage(
|
||||
const imageIds = referenceDisplaySet.images.map(image => image.getImageId());
|
||||
|
||||
if (!results) {
|
||||
throw new Error('Fractional segmentations are not supported');
|
||||
throw new Error("Fractional segmentations are not supported");
|
||||
}
|
||||
|
||||
const cachedStack = StackManager.findOrCreateStack(
|
||||
@ -137,13 +137,13 @@ async function handleSegmentationStorage(
|
||||
|
||||
return {
|
||||
referenceDataObject,
|
||||
labelmapDataObject,
|
||||
labelmapDataObject
|
||||
};
|
||||
|
||||
return {
|
||||
studyInstanceUid,
|
||||
displaySetInstanceUid,
|
||||
stack,
|
||||
stack
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { redux } from 'ohif-core';
|
||||
import { redux } from "@ohif/core";
|
||||
|
||||
const { setViewportLayoutAndData } = redux.actions;
|
||||
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
const autoprefixer = require("autoprefixer");
|
||||
// const vtkHtmlRules = require('vtk.js/Utilities/config/dependency.js').webpack
|
||||
// .core.rules;
|
||||
// Optional if you want to load *.css and *.module.css files
|
||||
// var cssRules = require('vtk.js/Utilities/config/dependency.js').webpack.css.rules;
|
||||
const SRC_DIR = path.join(__dirname, './src');
|
||||
const OUTPUT_DIR = path.join(__dirname, './dist');
|
||||
const SRC_DIR = path.join(__dirname, "./src");
|
||||
const OUTPUT_DIR = path.join(__dirname, "./dist");
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
mode: "development",
|
||||
entry: {
|
||||
app: `${SRC_DIR}/index.js`,
|
||||
app: `${SRC_DIR}/index.js`
|
||||
},
|
||||
context: SRC_DIR,
|
||||
// ~~~ MODE
|
||||
output: {
|
||||
path: OUTPUT_DIR,
|
||||
library: 'ohifVtkExtension',
|
||||
libraryTarget: 'umd',
|
||||
filename: 'index.umd.js',
|
||||
auxiliaryComment: 'Text VTK Extension Comment',
|
||||
library: "ohifVtkExtension",
|
||||
libraryTarget: "umd",
|
||||
filename: "index.umd.js",
|
||||
auxiliaryComment: "Text VTK Extension Comment"
|
||||
},
|
||||
stats: {
|
||||
colors: true,
|
||||
@ -31,43 +31,43 @@ module.exports = {
|
||||
chunkModules: true,
|
||||
modules: true,
|
||||
children: true,
|
||||
warnings: true,
|
||||
warnings: true
|
||||
},
|
||||
optimization: {
|
||||
minimize: false,
|
||||
sideEffects: true,
|
||||
sideEffects: true
|
||||
},
|
||||
// ~~~ END MODE
|
||||
resolve: {
|
||||
modules: [
|
||||
path.resolve(__dirname, 'node_modules'),
|
||||
path.resolve(__dirname, '../../node_modules'),
|
||||
SRC_DIR,
|
||||
path.resolve(__dirname, "node_modules"),
|
||||
path.resolve(__dirname, "../../node_modules"),
|
||||
SRC_DIR
|
||||
],
|
||||
extensions: ['.js', '.jsx', '.json', '*'],
|
||||
symlinks: true,
|
||||
extensions: [".js", ".jsx", ".json", "*"],
|
||||
symlinks: true
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
exclude: [/node_modules/],
|
||||
loader: 'babel-loader',
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
// Find babel.config.js in monorepo root
|
||||
// https://babeljs.io/docs/en/options#rootmode
|
||||
rootMode: 'upward',
|
||||
rootMode: "upward",
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
"@babel/preset-env",
|
||||
{
|
||||
// Do not transform ES6 modules to another format.
|
||||
// Webpack will take care of that.
|
||||
modules: false,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
modules: false
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
/**
|
||||
*
|
||||
@ -76,15 +76,15 @@ module.exports = {
|
||||
test: /\.css$/,
|
||||
exclude: /\.module\.css$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
'css-loader',
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
loader: "postcss-loader",
|
||||
options: {
|
||||
plugins: () => [autoprefixer('last 2 version', 'ie >= 10')],
|
||||
},
|
||||
},
|
||||
],
|
||||
plugins: () => [autoprefixer("last 2 version", "ie >= 10")]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
/**
|
||||
*
|
||||
@ -92,7 +92,7 @@ module.exports = {
|
||||
{
|
||||
test: /\.glsl$/i,
|
||||
include: /vtk\.js[\/\\]Sources/,
|
||||
loader: 'shader-loader',
|
||||
loader: "shader-loader"
|
||||
},
|
||||
/**
|
||||
*
|
||||
@ -102,13 +102,13 @@ module.exports = {
|
||||
include: /vtk\.js[\/\\]Sources/,
|
||||
use: [
|
||||
{
|
||||
loader: 'worker-loader',
|
||||
options: { inline: true, fallback: false },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
loader: "worker-loader",
|
||||
options: { inline: true, fallback: false }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
// externals: [
|
||||
// {
|
||||
// cornerstone: {
|
||||
@ -125,7 +125,7 @@ module.exports = {
|
||||
// },
|
||||
// },
|
||||
// '@ohif/i18n',
|
||||
// 'ohif-core',
|
||||
// '@ohif/core',
|
||||
// 'dcmjs',
|
||||
// 'react-viewerbase',
|
||||
// 'react', //: 'React',
|
||||
|
||||
@ -62,13 +62,13 @@ Usage is dependent on the feature(s) you want to leverage. The bulk of
|
||||
_Example: retrieving study metadata from a server_
|
||||
|
||||
```js
|
||||
import { studies } from 'ohif-core'
|
||||
import { studies } from "@ohif/core";
|
||||
|
||||
const studiesMetadata = await studies.retrieveStudiesMetadata(
|
||||
server, // Object
|
||||
studyInstanceUids, // Array
|
||||
seriesInstanceUids // Array (optional)
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
### Contributing
|
||||
@ -89,10 +89,10 @@ When creating tests, place the test file "next to" the file you're testing.
|
||||
|
||||
```js
|
||||
// File
|
||||
index.js
|
||||
index.js;
|
||||
|
||||
// Test for file
|
||||
index.test.js
|
||||
index.test.js;
|
||||
```
|
||||
|
||||
As you add and modify code, `jest` will watch for uncommitted changes and run
|
||||
|
||||
@ -1,46 +1,46 @@
|
||||
import './config';
|
||||
import "./config";
|
||||
// Polyfills
|
||||
import 'core-js/features/array/flat';
|
||||
import 'core-js/stable';
|
||||
import 'regenerator-runtime/runtime';
|
||||
import "core-js/features/array/flat";
|
||||
import "core-js/stable";
|
||||
import "regenerator-runtime/runtime";
|
||||
|
||||
import {
|
||||
CommandsManager,
|
||||
ExtensionManager,
|
||||
HotkeysManager,
|
||||
utils,
|
||||
} from 'ohif-core';
|
||||
import React, { Component } from 'react';
|
||||
utils
|
||||
} from "@ohif/core";
|
||||
import React, { Component } from "react";
|
||||
import {
|
||||
getUserManagerForOpenIdConnectClient,
|
||||
initWebWorkers,
|
||||
} from './utils/index.js';
|
||||
initWebWorkers
|
||||
} from "./utils/index.js";
|
||||
|
||||
import { I18nextProvider } from 'react-i18next';
|
||||
import initCornerstoneTools from './initCornerstoneTools.js';
|
||||
import { I18nextProvider } from "react-i18next";
|
||||
import initCornerstoneTools from "./initCornerstoneTools.js";
|
||||
|
||||
// ~~ EXTENSIONS
|
||||
import { GenericViewerCommands, MeasurementsPanel } from './appExtensions';
|
||||
import OHIFCornerstoneExtension from '@ohif/extension-cornerstone';
|
||||
import OHIFStandaloneViewer from './OHIFStandaloneViewer';
|
||||
import { OidcProvider } from 'redux-oidc';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Provider } from 'react-redux';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
import WhiteLabellingContext from './WhiteLabellingContext';
|
||||
import { getActiveContexts } from './store/layout/selectors.js';
|
||||
import i18n from '@ohif/i18n';
|
||||
import setupTools from './setupTools.js';
|
||||
import store from './store';
|
||||
import { GenericViewerCommands, MeasurementsPanel } from "./appExtensions";
|
||||
import OHIFCornerstoneExtension from "@ohif/extension-cornerstone";
|
||||
import OHIFStandaloneViewer from "./OHIFStandaloneViewer";
|
||||
import { OidcProvider } from "redux-oidc";
|
||||
import PropTypes from "prop-types";
|
||||
import { Provider } from "react-redux";
|
||||
import { BrowserRouter as Router } from "react-router-dom";
|
||||
import WhiteLabellingContext from "./WhiteLabellingContext";
|
||||
import { getActiveContexts } from "./store/layout/selectors.js";
|
||||
import i18n from "@ohif/i18n";
|
||||
import setupTools from "./setupTools.js";
|
||||
import store from "./store";
|
||||
|
||||
// ~~~~ APP SETUP
|
||||
initCornerstoneTools({
|
||||
globalToolSyncEnabled: true,
|
||||
globalToolSyncEnabled: true
|
||||
});
|
||||
|
||||
const commandsManagerConfig = {
|
||||
getAppState: () => store.getState(),
|
||||
getActiveContexts: () => getActiveContexts(store.getState()),
|
||||
getActiveContexts: () => getActiveContexts(store.getState())
|
||||
};
|
||||
|
||||
const commandsManager = new CommandsManager(commandsManagerConfig);
|
||||
@ -64,15 +64,15 @@ class App extends Component {
|
||||
whiteLabelling: PropTypes.object,
|
||||
extensions: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
id: PropTypes.string.isRequired,
|
||||
id: PropTypes.string.isRequired
|
||||
})
|
||||
),
|
||||
)
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
whiteLabelling: {},
|
||||
oidc: [],
|
||||
extensions: [],
|
||||
extensions: []
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@ -137,7 +137,7 @@ function _initExtensions(extensions) {
|
||||
const defaultExtensions = [
|
||||
GenericViewerCommands,
|
||||
MeasurementsPanel,
|
||||
OHIFCornerstoneExtension,
|
||||
OHIFCornerstoneExtension
|
||||
];
|
||||
const mergedExtensions = defaultExtensions.concat(extensions);
|
||||
extensionManager.registerExtensions(mergedExtensions);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { redux } from 'ohif-core';
|
||||
import store from './../../store';
|
||||
import { redux } from "@ohif/core";
|
||||
import store from "./../../store";
|
||||
const { setViewportActive } = redux.actions;
|
||||
|
||||
const actions = {
|
||||
@ -16,24 +16,24 @@ const actions = {
|
||||
newIndex = newIndex < 0 ? maxIndex : newIndex;
|
||||
|
||||
store.dispatch(setViewportActive(newIndex));
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
const definitions = {
|
||||
// Next/Previous active viewport
|
||||
incrementActiveViewport: {
|
||||
commandFn: actions.updateActiveViewport,
|
||||
storeContexts: ['viewports'],
|
||||
options: { direction: 1 },
|
||||
storeContexts: ["viewports"],
|
||||
options: { direction: 1 }
|
||||
},
|
||||
decrementActiveViewport: {
|
||||
commandFn: actions.updateActiveViewport,
|
||||
storeContexts: ['viewports'],
|
||||
options: { direction: -1 },
|
||||
},
|
||||
storeContexts: ["viewports"],
|
||||
options: { direction: -1 }
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
definitions,
|
||||
defaultContext: 'VIEWER',
|
||||
defaultContext: "VIEWER"
|
||||
};
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { MeasurementTable } from 'react-viewerbase';
|
||||
import OHIF from 'ohif-core';
|
||||
import moment from 'moment';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import { connect } from "react-redux";
|
||||
import { MeasurementTable } from "react-viewerbase";
|
||||
import OHIF from "@ohif/core";
|
||||
import moment from "moment";
|
||||
import cornerstone from "cornerstone-core";
|
||||
|
||||
//
|
||||
import jumpToRowItem from './jumpToRowItem.js';
|
||||
import getMeasurementLocationCallback from './../../lib/getMeasurementLocationCallback';
|
||||
import jumpToRowItem from "./jumpToRowItem.js";
|
||||
import getMeasurementLocationCallback from "./../../lib/getMeasurementLocationCallback";
|
||||
|
||||
const { setViewportSpecificData } = OHIF.redux.actions;
|
||||
const { MeasurementApi } = OHIF.measurements;
|
||||
@ -30,7 +30,7 @@ function getAllTools() {
|
||||
|
||||
function getMeasurementText(measurementData) {
|
||||
const { location, description } = measurementData;
|
||||
let text = '...';
|
||||
let text = "...";
|
||||
if (location) {
|
||||
text = location;
|
||||
if (description) {
|
||||
@ -50,7 +50,7 @@ function getDataForEachMeasurementNumber(
|
||||
measurementNumberList.forEach(measurement => {
|
||||
timepoints.forEach(timepoint => {
|
||||
const eachData = {
|
||||
displayText: '...',
|
||||
displayText: "..."
|
||||
};
|
||||
if (measurement.timepointId === timepoint.timepointId) {
|
||||
eachData.displayText = displayFunction(measurement);
|
||||
@ -71,7 +71,7 @@ function convertMeasurementsToTableData(toolCollections, timepoints) {
|
||||
return {
|
||||
groupName: toolGroup.name,
|
||||
groupId: toolGroup.id,
|
||||
measurements: [],
|
||||
measurements: []
|
||||
};
|
||||
});
|
||||
|
||||
@ -81,7 +81,7 @@ function convertMeasurementsToTableData(toolCollections, timepoints) {
|
||||
const { displayFunction } = tool.options.measurementTable;
|
||||
|
||||
// Group by measurementNumber so we can display then all in the same line
|
||||
const groupedMeasurements = groupBy(toolMeasurements, 'measurementNumber');
|
||||
const groupedMeasurements = groupBy(toolMeasurements, "measurementNumber");
|
||||
|
||||
Object.keys(groupedMeasurements).forEach(groupedMeasurementsIndex => {
|
||||
const measurementNumberList =
|
||||
@ -90,7 +90,7 @@ function convertMeasurementsToTableData(toolCollections, timepoints) {
|
||||
const {
|
||||
measurementNumber,
|
||||
lesionNamingNumber,
|
||||
toolType,
|
||||
toolType
|
||||
} = measurementData;
|
||||
const measurementId = measurementData._id;
|
||||
|
||||
@ -103,14 +103,14 @@ function convertMeasurementsToTableData(toolCollections, timepoints) {
|
||||
lesionNamingNumber,
|
||||
toolType,
|
||||
hasWarnings: false, //TODO
|
||||
warningTitle: '', //TODO
|
||||
warningTitle: "", //TODO
|
||||
isSplitLesion: false, //TODO
|
||||
warningList: [], //TODO
|
||||
data: getDataForEachMeasurementNumber(
|
||||
measurementNumberList,
|
||||
timepoints,
|
||||
displayFunction
|
||||
),
|
||||
)
|
||||
};
|
||||
|
||||
// find the group object for the tool
|
||||
@ -139,9 +139,9 @@ function convertTimepointsToTableData(timepoints) {
|
||||
|
||||
return [
|
||||
{
|
||||
label: 'Study date:',
|
||||
date: moment(timepoints[0].latestDate).format('DD-MMM-YY'),
|
||||
},
|
||||
label: "Study date:",
|
||||
date: moment(timepoints[0].latestDate).format("DD-MMM-YY")
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ const mapStateToProps = state => {
|
||||
timepoints
|
||||
),
|
||||
timepointManager: state.timepointManager,
|
||||
viewports: state.viewports,
|
||||
viewports: state.viewports
|
||||
};
|
||||
};
|
||||
|
||||
@ -166,7 +166,7 @@ const mapDispatchToProps = dispatch => {
|
||||
|
||||
const enabledElements = cornerstone.getEnabledElements();
|
||||
if (!enabledElements || enabledElements.length <= activeViewportIndex) {
|
||||
OHIF.log.error('Failed to find the enabled element');
|
||||
OHIF.log.error("Failed to find the enabled element");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -175,9 +175,9 @@ const mapDispatchToProps = dispatch => {
|
||||
const eventData = {
|
||||
event: {
|
||||
clientX: event.clientX,
|
||||
clientY: event.clientY,
|
||||
clientY: event.clientY
|
||||
},
|
||||
element,
|
||||
element
|
||||
};
|
||||
|
||||
const { toolType, measurementId } = measurementData;
|
||||
@ -187,7 +187,7 @@ const mapDispatchToProps = dispatch => {
|
||||
|
||||
const options = {
|
||||
skipAddLabelButton: true,
|
||||
editLocation: true,
|
||||
editLocation: true
|
||||
};
|
||||
|
||||
// Clone the tool not to set empty location initially
|
||||
@ -200,7 +200,7 @@ const mapDispatchToProps = dispatch => {
|
||||
|
||||
const enabledElements = cornerstone.getEnabledElements();
|
||||
if (!enabledElements || enabledElements.length <= activeViewportIndex) {
|
||||
OHIF.log.error('Failed to find the enabled element');
|
||||
OHIF.log.error("Failed to find the enabled element");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -209,9 +209,9 @@ const mapDispatchToProps = dispatch => {
|
||||
const eventData = {
|
||||
event: {
|
||||
clientX: event.clientX,
|
||||
clientY: event.clientY,
|
||||
clientY: event.clientY
|
||||
},
|
||||
element,
|
||||
element
|
||||
};
|
||||
|
||||
const { toolType, measurementId } = measurementData;
|
||||
@ -220,7 +220,7 @@ const mapDispatchToProps = dispatch => {
|
||||
});
|
||||
|
||||
const options = {
|
||||
editDescriptionOnDialog: true,
|
||||
editDescriptionOnDialog: true
|
||||
};
|
||||
|
||||
getMeasurementLocationCallback(eventData, tool, options);
|
||||
@ -285,7 +285,7 @@ const mapDispatchToProps = dispatch => {
|
||||
//dispatch(setActiveMeasurement(measurementData.measurementId))
|
||||
|
||||
// (later): Needs to set some property on state.extensions.cornerstone to synchronize viewport scrolling
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -307,7 +307,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
||||
// TODO: childToolKey should come from the measurement table when it supports child tools
|
||||
const options = {
|
||||
invertViewportTimepointsOrder: false,
|
||||
childToolKey: null,
|
||||
childToolKey: null
|
||||
};
|
||||
|
||||
propsFromDispatch.dispatchJumpToRowItem(
|
||||
@ -338,11 +338,11 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
||||
measurementData: {
|
||||
_id: measurementData.measurementId,
|
||||
lesionNamingNumber: measurementData.lesionNamingNumber,
|
||||
measurementNumber: measurementData.measurementNumber,
|
||||
},
|
||||
},
|
||||
measurementNumber: measurementData.measurementNumber
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { measurements, utils } from 'ohif-core';
|
||||
import { measurements, utils } from "@ohif/core";
|
||||
|
||||
const { MeasurementApi } = measurements;
|
||||
const { studyMetadataManager } = utils;
|
||||
@ -82,7 +82,7 @@ export default function jumpToRowItem(
|
||||
|
||||
const study = studyMetadataManager.get(data.studyInstanceUid);
|
||||
if (!study) {
|
||||
throw new Error('Study not found.');
|
||||
throw new Error("Study not found.");
|
||||
}
|
||||
|
||||
const displaySet = study.findDisplaySet(displaySet => {
|
||||
@ -90,7 +90,7 @@ export default function jumpToRowItem(
|
||||
});
|
||||
|
||||
if (!displaySet) {
|
||||
throw new Error('Display set not found.');
|
||||
throw new Error("Display set not found.");
|
||||
}
|
||||
|
||||
displaySet.sopInstanceUid = data.sopInstanceUid;
|
||||
@ -100,12 +100,12 @@ export default function jumpToRowItem(
|
||||
|
||||
viewportSpecificData.push({
|
||||
viewportIndex,
|
||||
displaySet,
|
||||
displaySet
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
viewportSpecificData,
|
||||
layout: [], // TODO: if we need to change layout, we should return this here
|
||||
layout: [] // TODO: if we need to change layout, we should return this here
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import OHIF from 'ohif-core';
|
||||
import { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import OHIF from "@ohif/core";
|
||||
|
||||
class StudyLoadingMonitor extends Component {
|
||||
static propTypes = {
|
||||
studies: PropTypes.array.isRequired,
|
||||
setStudyLoadingProgress: PropTypes.func.isRequired,
|
||||
clearStudyLoadingProgress: PropTypes.func.isRequired,
|
||||
clearStudyLoadingProgress: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
@ -20,7 +20,7 @@ class StudyLoadingMonitor extends Component {
|
||||
},
|
||||
_clearProgressById: progressId => {
|
||||
this.props.clearStudyLoadingProgress(progressId);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
const { StudyLoadingListener } = OHIF.classes;
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import OHIF from 'ohif-core';
|
||||
import { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import OHIF from "@ohif/core";
|
||||
|
||||
const { StudyPrefetcher } = OHIF.classes;
|
||||
|
||||
class StudyPrefetcherComponent extends Component {
|
||||
static propTypes = {
|
||||
studies: PropTypes.array,
|
||||
studies: PropTypes.array
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import OHIF from 'ohif-core';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
|
||||
import dicomParser from 'dicom-parser';
|
||||
import version from './version.js';
|
||||
import OHIF from "@ohif/core";
|
||||
import cornerstone from "cornerstone-core";
|
||||
import cornerstoneWADOImageLoader from "cornerstone-wado-image-loader";
|
||||
import dicomParser from "dicom-parser";
|
||||
import version from "./version.js";
|
||||
|
||||
window.info = {
|
||||
version,
|
||||
homepage: `${process.env.PUBLIC_URL}`,
|
||||
homepage: `${process.env.PUBLIC_URL}`
|
||||
};
|
||||
|
||||
// For debugging
|
||||
@ -33,7 +33,7 @@ cornerstoneWADOImageLoader.configure({
|
||||
const headers = OHIF.DICOMWeb.getAuthorizationHeader();
|
||||
|
||||
if (headers.Authorization) {
|
||||
xhr.setRequestHeader('Authorization', headers.Authorization);
|
||||
xhr.setRequestHeader("Authorization", headers.Authorization);
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { CineDialog } from 'react-viewerbase';
|
||||
import OHIF from 'ohif-core';
|
||||
import csTools from 'cornerstone-tools';
|
||||
import { connect } from "react-redux";
|
||||
import { CineDialog } from "react-viewerbase";
|
||||
import OHIF from "@ohif/core";
|
||||
import csTools from "cornerstone-tools";
|
||||
// Our target output kills the `as` and "import" throws a keyword error
|
||||
// import { import as toolImport, getToolState } from 'cornerstone-tools';
|
||||
import cloneDeep from 'lodash.clonedeep';
|
||||
import cloneDeep from "lodash.clonedeep";
|
||||
|
||||
const toolImport = csTools.import;
|
||||
const scrollToIndex = toolImport('util/scrollToIndex');
|
||||
const scrollToIndex = toolImport("util/scrollToIndex");
|
||||
const { setViewportSpecificData } = OHIF.redux.actions;
|
||||
|
||||
// Why do I need or care about any of this info?
|
||||
@ -20,14 +20,14 @@ const mapStateToProps = state => {
|
||||
|
||||
const cineData = cine || {
|
||||
isPlaying: false,
|
||||
cineFrameRate: 24,
|
||||
cineFrameRate: 24
|
||||
};
|
||||
|
||||
// New props we're creating?
|
||||
return {
|
||||
activeEnabledElement: dom,
|
||||
activeViewportCineData: cineData,
|
||||
activeViewportIndex: state.viewports.activeViewportIndex,
|
||||
activeViewportIndex: state.viewports.activeViewportIndex
|
||||
};
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
dispatchSetViewportSpecificData: (viewportIndex, data) => {
|
||||
dispatch(setViewportSpecificData(viewportIndex, data));
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -43,7 +43,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
||||
const {
|
||||
activeEnabledElement,
|
||||
activeViewportCineData,
|
||||
activeViewportIndex,
|
||||
activeViewportIndex
|
||||
} = propsFromState;
|
||||
|
||||
return {
|
||||
@ -54,7 +54,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
||||
cine.isPlaying = !cine.isPlaying;
|
||||
|
||||
propsFromDispatch.dispatchSetViewportSpecificData(activeViewportIndex, {
|
||||
cine,
|
||||
cine
|
||||
});
|
||||
},
|
||||
onFrameRateChanged: frameRate => {
|
||||
@ -62,34 +62,34 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
||||
cine.cineFrameRate = frameRate;
|
||||
|
||||
propsFromDispatch.dispatchSetViewportSpecificData(activeViewportIndex, {
|
||||
cine,
|
||||
cine
|
||||
});
|
||||
},
|
||||
onClickNextButton: () => {
|
||||
const stackData = csTools.getToolState(activeEnabledElement, 'stack');
|
||||
const stackData = csTools.getToolState(activeEnabledElement, "stack");
|
||||
if (!stackData || !stackData.data || !stackData.data.length) return;
|
||||
const { currentImageIdIndex, imageIds } = stackData.data[0];
|
||||
if (currentImageIdIndex >= imageIds.length - 1) return;
|
||||
scrollToIndex(activeEnabledElement, currentImageIdIndex + 1);
|
||||
},
|
||||
onClickBackButton: () => {
|
||||
const stackData = csTools.getToolState(activeEnabledElement, 'stack');
|
||||
const stackData = csTools.getToolState(activeEnabledElement, "stack");
|
||||
if (!stackData || !stackData.data || !stackData.data.length) return;
|
||||
const { currentImageIdIndex } = stackData.data[0];
|
||||
if (currentImageIdIndex === 0) return;
|
||||
scrollToIndex(activeEnabledElement, currentImageIdIndex - 1);
|
||||
},
|
||||
onClickSkipToStart: () => {
|
||||
const stackData = csTools.getToolState(activeEnabledElement, 'stack');
|
||||
const stackData = csTools.getToolState(activeEnabledElement, "stack");
|
||||
if (!stackData || !stackData.data || !stackData.data.length) return;
|
||||
scrollToIndex(activeEnabledElement, 0);
|
||||
},
|
||||
onClickSkipToEnd: () => {
|
||||
const stackData = csTools.getToolState(activeEnabledElement, 'stack');
|
||||
const stackData = csTools.getToolState(activeEnabledElement, "stack");
|
||||
if (!stackData || !stackData.data || !stackData.data.length) return;
|
||||
const lastIndex = stackData.data[0].imageIds.length - 1;
|
||||
scrollToIndex(activeEnabledElement, lastIndex);
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { LayoutButton } from 'react-viewerbase';
|
||||
import OHIF from 'ohif-core';
|
||||
import { connect } from 'react-redux';
|
||||
import { LayoutButton } from "react-viewerbase";
|
||||
import OHIF from "@ohif/core";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const { setLayout } = OHIF.redux.actions;
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
currentLayout: state.viewports.layout,
|
||||
currentLayout: state.viewports.layout
|
||||
};
|
||||
};
|
||||
|
||||
@ -21,15 +21,15 @@ const mapDispatchToProps = dispatch => {
|
||||
for (let i = 0; i < numViewports; i++) {
|
||||
viewports.push({
|
||||
height: `${100 / rows}%`,
|
||||
width: `${100 / columns}%`,
|
||||
width: `${100 / columns}%`
|
||||
});
|
||||
}
|
||||
const layout = {
|
||||
viewports,
|
||||
viewports
|
||||
};
|
||||
|
||||
dispatch(setLayout(layout));
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { LayoutManager } from 'react-viewerbase';
|
||||
import { MODULE_TYPES } from 'ohif-core';
|
||||
import { connect } from 'react-redux';
|
||||
import { extensionManager } from './../App.js';
|
||||
import { LayoutManager } from "react-viewerbase";
|
||||
import { MODULE_TYPES } from "@ohif/core";
|
||||
import { connect } from "react-redux";
|
||||
import { extensionManager } from "./../App.js";
|
||||
|
||||
const mapStateToProps = state => {
|
||||
const availableViewportModules = {};
|
||||
@ -24,7 +24,7 @@ const mapStateToProps = state => {
|
||||
// TODO: rename `availableViewportModules`
|
||||
availablePlugins: availableViewportModules,
|
||||
// TODO: rename `defaultViewportModule`
|
||||
defaultPlugin,
|
||||
defaultPlugin
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import OHIF from 'ohif-core';
|
||||
import PluginSwitch from './PluginSwitch.js';
|
||||
import { commandsManager } from './../App.js';
|
||||
import { connect } from 'react-redux';
|
||||
import OHIF from "@ohif/core";
|
||||
import PluginSwitch from "./PluginSwitch.js";
|
||||
import { commandsManager } from "./../App.js";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const { setLayout } = OHIF.redux.actions;
|
||||
|
||||
@ -11,7 +11,7 @@ const mapStateToProps = state => {
|
||||
return {
|
||||
activeViewportIndex,
|
||||
viewportSpecificData,
|
||||
layout,
|
||||
layout
|
||||
};
|
||||
};
|
||||
|
||||
@ -19,7 +19,7 @@ const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
setLayout: data => {
|
||||
dispatch(setLayout(data));
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -81,16 +81,16 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => {
|
||||
},
|
||||
},*/
|
||||
{
|
||||
label: '2D MPR',
|
||||
icon: 'cube',
|
||||
label: "2D MPR",
|
||||
icon: "cube",
|
||||
onClick: () => {
|
||||
commandsManager.runCommand('mpr2d');
|
||||
},
|
||||
},
|
||||
commandsManager.runCommand("mpr2d");
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
return {
|
||||
buttons,
|
||||
buttons
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { connect } from 'react-redux';
|
||||
import StudyLoadingMonitor from '../components/StudyLoadingMonitor.js';
|
||||
import OHIF from 'ohif-core';
|
||||
import { connect } from "react-redux";
|
||||
import StudyLoadingMonitor from "../components/StudyLoadingMonitor.js";
|
||||
import OHIF from "@ohif/core";
|
||||
|
||||
const {
|
||||
setStudyLoadingProgress,
|
||||
clearStudyLoadingProgress,
|
||||
clearStudyLoadingProgress
|
||||
} = OHIF.redux.actions;
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
@ -14,7 +14,7 @@ const mapDispatchToProps = dispatch => {
|
||||
},
|
||||
clearStudyLoadingProgress: progressId => {
|
||||
dispatch(clearStudyLoadingProgress(progressId));
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import { connect } from 'react-redux';
|
||||
import Viewer from './Viewer.js';
|
||||
import OHIF from 'ohif-core';
|
||||
import { connect } from "react-redux";
|
||||
import Viewer from "./Viewer.js";
|
||||
import OHIF from "@ohif/core";
|
||||
|
||||
const { setTimepoints, setMeasurements } = OHIF.redux.actions;
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
return {
|
||||
viewports: state.viewports.viewportSpecificData,
|
||||
activeViewportIndex: state.viewports.activeViewportIndex,
|
||||
activeViewportIndex: state.viewports.activeViewportIndex
|
||||
};
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@ const mapDispatchToProps = dispatch => {
|
||||
},
|
||||
onMeasurementsUpdated: measurements => {
|
||||
dispatch(setMeasurements(measurements));
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import OHIF from 'ohif-core';
|
||||
import ViewerMain from './ViewerMain';
|
||||
import { connect } from 'react-redux';
|
||||
import OHIF from "@ohif/core";
|
||||
import ViewerMain from "./ViewerMain";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const {
|
||||
setViewportSpecificData,
|
||||
clearViewportSpecificData,
|
||||
clearViewportSpecificData
|
||||
} = OHIF.redux.actions;
|
||||
|
||||
const mapStateToProps = state => {
|
||||
@ -14,7 +14,7 @@ const mapStateToProps = state => {
|
||||
activeViewportIndex,
|
||||
layout,
|
||||
viewportSpecificData,
|
||||
viewports: state.viewports,
|
||||
viewports: state.viewports
|
||||
};
|
||||
};
|
||||
|
||||
@ -25,7 +25,7 @@ const mapDispatchToProps = dispatch => {
|
||||
},
|
||||
clearViewportSpecificData: () => {
|
||||
dispatch(clearViewportSpecificData());
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import './ToolbarRow.css';
|
||||
import "./ToolbarRow.css";
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import React, { Component } from "react";
|
||||
import {
|
||||
RoundedButtonGroup,
|
||||
ToolbarButton,
|
||||
ExpandableToolMenu,
|
||||
} from 'react-viewerbase';
|
||||
import { commandsManager, extensionManager } from './../App.js';
|
||||
ExpandableToolMenu
|
||||
} from "react-viewerbase";
|
||||
import { commandsManager, extensionManager } from "./../App.js";
|
||||
|
||||
import ConnectedCineDialog from './ConnectedCineDialog';
|
||||
import ConnectedLayoutButton from './ConnectedLayoutButton';
|
||||
import ConnectedPluginSwitch from './ConnectedPluginSwitch.js';
|
||||
import { MODULE_TYPES } from 'ohif-core';
|
||||
import PropTypes from 'prop-types';
|
||||
import ConnectedCineDialog from "./ConnectedCineDialog";
|
||||
import ConnectedLayoutButton from "./ConnectedLayoutButton";
|
||||
import ConnectedPluginSwitch from "./ConnectedPluginSwitch.js";
|
||||
import { MODULE_TYPES } from "@ohif/core";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
class ToolbarRow extends Component {
|
||||
// TODO: Simplify these? isOpen can be computed if we say "any" value for selected,
|
||||
@ -23,7 +23,7 @@ class ToolbarRow extends Component {
|
||||
selectedLeftSidePanel: PropTypes.string.isRequired,
|
||||
selectedRightSidePanel: PropTypes.string.isRequired,
|
||||
handleSidePanelChange: PropTypes.func,
|
||||
activeContexts: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||
activeContexts: PropTypes.arrayOf(PropTypes.string).isRequired
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@ -41,7 +41,7 @@ class ToolbarRow extends Component {
|
||||
this.state = {
|
||||
toolbarButtons: toolbarButtonDefinitions,
|
||||
activeButtons: [],
|
||||
isCineDialogOpen: false,
|
||||
isCineDialogOpen: false
|
||||
};
|
||||
|
||||
this._handleBuiltIn = _handleBuiltIn.bind(this);
|
||||
@ -51,12 +51,12 @@ class ToolbarRow extends Component {
|
||||
left: [
|
||||
// TODO: This should come from extensions, instead of being baked in
|
||||
{
|
||||
value: 'studies',
|
||||
icon: 'th-large',
|
||||
bottomLabel: 'Series',
|
||||
},
|
||||
value: "studies",
|
||||
icon: "th-large",
|
||||
bottomLabel: "Series"
|
||||
}
|
||||
],
|
||||
right: [],
|
||||
right: []
|
||||
};
|
||||
|
||||
panelModules.forEach(panelExtension => {
|
||||
@ -74,9 +74,9 @@ class ToolbarRow extends Component {
|
||||
const menuOptionEntry = {
|
||||
value: menuOption.target,
|
||||
icon: menuOption.icon,
|
||||
bottomLabel: menuOption.label,
|
||||
bottomLabel: menuOption.label
|
||||
};
|
||||
const from = menuOption.from || 'right';
|
||||
const from = menuOption.from || "right";
|
||||
|
||||
this.buttonGroups[from].push(menuOptionEntry);
|
||||
}
|
||||
@ -90,7 +90,7 @@ class ToolbarRow extends Component {
|
||||
|
||||
if (activeContextsChanged) {
|
||||
this.setState({
|
||||
toolbarButtons: _getVisibleToolbarButtons.call(this),
|
||||
toolbarButtons: _getVisibleToolbarButtons.call(this)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -103,25 +103,25 @@ class ToolbarRow extends Component {
|
||||
);
|
||||
|
||||
const cineDialogContainerStyle = {
|
||||
display: this.state.isCineDialogOpen ? 'block' : 'none',
|
||||
position: 'absolute',
|
||||
top: '82px',
|
||||
zIndex: 999,
|
||||
display: this.state.isCineDialogOpen ? "block" : "none",
|
||||
position: "absolute",
|
||||
top: "82px",
|
||||
zIndex: 999
|
||||
};
|
||||
|
||||
const onPress = (side, value) => {
|
||||
this.props.handleSidePanelChange(side, value);
|
||||
};
|
||||
const onPressLeft = onPress.bind(this, 'left');
|
||||
const onPressRight = onPress.bind(this, 'right');
|
||||
const onPressLeft = onPress.bind(this, "left");
|
||||
const onPressRight = onPress.bind(this, "right");
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="ToolbarRow">
|
||||
<div className="pull-left m-t-1 p-y-1" style={{ padding: '10px' }}>
|
||||
<div className="pull-left m-t-1 p-y-1" style={{ padding: "10px" }}>
|
||||
<RoundedButtonGroup
|
||||
options={this.buttonGroups.left}
|
||||
value={this.props.selectedLeftSidePanel || ''}
|
||||
value={this.props.selectedLeftSidePanel || ""}
|
||||
onValueChanged={onPressLeft}
|
||||
/>
|
||||
</div>
|
||||
@ -130,12 +130,12 @@ class ToolbarRow extends Component {
|
||||
<ConnectedPluginSwitch />
|
||||
<div
|
||||
className="pull-right m-t-1 rm-x-1"
|
||||
style={{ marginLeft: 'auto' }}
|
||||
style={{ marginLeft: "auto" }}
|
||||
>
|
||||
{this.buttonGroups.right.length && (
|
||||
<RoundedButtonGroup
|
||||
options={this.buttonGroups.right}
|
||||
value={this.props.selectedRightSidePanel || ''}
|
||||
value={this.props.selectedRightSidePanel || ""}
|
||||
onValueChanged={onPressRight}
|
||||
/>
|
||||
)}
|
||||
@ -201,11 +201,11 @@ function _handleToolbarButtonClick(button, evt, props) {
|
||||
// TODO: Use Types ENUM
|
||||
// TODO: We can update this to be a `getter` on the extension to query
|
||||
// For the active tools after we apply our updates?
|
||||
if (button.type === 'setToolActive') {
|
||||
if (button.type === "setToolActive") {
|
||||
this.setState({
|
||||
activeButtons: [button.id],
|
||||
activeButtons: [button.id]
|
||||
});
|
||||
} else if (button.type === 'builtIn') {
|
||||
} else if (button.type === "builtIn") {
|
||||
this._handleBuiltIn(button.options);
|
||||
}
|
||||
}
|
||||
@ -232,9 +232,9 @@ function _getVisibleToolbarButtons() {
|
||||
}
|
||||
|
||||
function _handleBuiltIn({ behavior } = {}) {
|
||||
if (behavior === 'CINE') {
|
||||
if (behavior === "CINE") {
|
||||
this.setState({
|
||||
isCineDialogOpen: !this.state.isCineDialogOpen,
|
||||
isCineDialogOpen: !this.state.isCineDialogOpen
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import React, { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import classNames from "classnames";
|
||||
|
||||
import { MODULE_TYPES } from 'ohif-core';
|
||||
import OHIF from 'ohif-core';
|
||||
import moment from 'moment';
|
||||
import WhiteLabellingContext from '../WhiteLabellingContext.js';
|
||||
import ConnectedHeader from './ConnectedHeader.js';
|
||||
import ConnectedToolbarRow from './ConnectedToolbarRow.js';
|
||||
import ConnectedLabellingOverlay from './ConnectedLabellingOverlay';
|
||||
import ConnectedStudyBrowser from './ConnectedStudyBrowser.js';
|
||||
import ConnectedViewerMain from './ConnectedViewerMain.js';
|
||||
import SidePanel from './../components/SidePanel.js';
|
||||
import { extensionManager } from './../App.js';
|
||||
import './Viewer.css';
|
||||
import { MODULE_TYPES } from "@ohif/core";
|
||||
import OHIF from "@ohif/core";
|
||||
import moment from "moment";
|
||||
import WhiteLabellingContext from "../WhiteLabellingContext.js";
|
||||
import ConnectedHeader from "./ConnectedHeader.js";
|
||||
import ConnectedToolbarRow from "./ConnectedToolbarRow.js";
|
||||
import ConnectedLabellingOverlay from "./ConnectedLabellingOverlay";
|
||||
import ConnectedStudyBrowser from "./ConnectedStudyBrowser.js";
|
||||
import ConnectedViewerMain from "./ConnectedViewerMain.js";
|
||||
import SidePanel from "./../components/SidePanel.js";
|
||||
import { extensionManager } from "./../App.js";
|
||||
import "./Viewer.css";
|
||||
/**
|
||||
* Inits OHIF Hanging Protocol's onReady.
|
||||
* It waits for OHIF Hanging Protocol to be ready to instantiate the ProtocolEngine
|
||||
@ -59,7 +59,7 @@ class Viewer extends Component {
|
||||
// window.store.getState().viewports.viewportSpecificData
|
||||
viewports: PropTypes.object.isRequired,
|
||||
// window.store.getState().viewports.activeViewportIndex
|
||||
activeViewportIndex: PropTypes.number.isRequired,
|
||||
activeViewportIndex: PropTypes.number.isRequired
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@ -67,8 +67,8 @@ class Viewer extends Component {
|
||||
OHIF.measurements.MeasurementApi.setConfiguration({
|
||||
dataExchange: {
|
||||
retrieve: this.retrieveMeasurements,
|
||||
store: this.storeMeasurements,
|
||||
},
|
||||
store: this.storeMeasurements
|
||||
}
|
||||
});
|
||||
|
||||
OHIF.measurements.TimepointApi.setConfiguration({
|
||||
@ -77,41 +77,41 @@ class Viewer extends Component {
|
||||
store: this.storeTimepoints,
|
||||
remove: this.removeTimepoint,
|
||||
update: this.updateTimepoint,
|
||||
disassociate: this.disassociateStudy,
|
||||
},
|
||||
disassociate: this.disassociateStudy
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
state = {
|
||||
isLeftSidePanelOpen: true,
|
||||
isRightSidePanelOpen: false,
|
||||
selectedRightSidePanel: '',
|
||||
selectedLeftSidePanel: 'studies', // TODO: Don't hardcode this
|
||||
thumbnails: [],
|
||||
selectedRightSidePanel: "",
|
||||
selectedLeftSidePanel: "studies", // TODO: Don't hardcode this
|
||||
thumbnails: []
|
||||
};
|
||||
|
||||
retrieveMeasurements = (patientId, timepointIds) => {
|
||||
OHIF.log.info('retrieveMeasurements');
|
||||
OHIF.log.info("retrieveMeasurements");
|
||||
// TODO: Retrieve the measurements from the latest available SR
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
storeMeasurements = (measurementData, timepointIds) => {
|
||||
OHIF.log.info('storeMeasurements');
|
||||
OHIF.log.info("storeMeasurements");
|
||||
// TODO: Store the measurements into a new SR sent to the active server
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
retrieveTimepoints = filter => {
|
||||
OHIF.log.info('retrieveTimepoints');
|
||||
OHIF.log.info("retrieveTimepoints");
|
||||
|
||||
// Get the earliest and latest study date
|
||||
let earliestDate = new Date().toISOString();
|
||||
let latestDate = new Date().toISOString();
|
||||
if (this.props.studies) {
|
||||
latestDate = new Date('1000-01-01').toISOString();
|
||||
latestDate = new Date("1000-01-01").toISOString();
|
||||
this.props.studies.forEach(study => {
|
||||
const studyDate = moment(study.studyDate, 'YYYYMMDD').toISOString();
|
||||
const studyDate = moment(study.studyDate, "YYYYMMDD").toISOString();
|
||||
if (studyDate < earliestDate) {
|
||||
earliestDate = studyDate;
|
||||
}
|
||||
@ -124,34 +124,34 @@ class Viewer extends Component {
|
||||
// Return a generic timepoint
|
||||
return Promise.resolve([
|
||||
{
|
||||
timepointType: 'baseline',
|
||||
timepointId: 'TimepointId',
|
||||
timepointType: "baseline",
|
||||
timepointId: "TimepointId",
|
||||
studyInstanceUids: this.props.studyInstanceUids,
|
||||
patientId: filter.patientId,
|
||||
earliestDate,
|
||||
latestDate,
|
||||
isLocked: false,
|
||||
},
|
||||
isLocked: false
|
||||
}
|
||||
]);
|
||||
};
|
||||
|
||||
storeTimepoints = timepointData => {
|
||||
OHIF.log.info('storeTimepoints');
|
||||
OHIF.log.info("storeTimepoints");
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
updateTimepoint = (timepointData, query) => {
|
||||
OHIF.log.info('updateTimepoint');
|
||||
OHIF.log.info("updateTimepoint");
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
removeTimepoint = timepointId => {
|
||||
OHIF.log.info('removeTimepoint');
|
||||
OHIF.log.info("removeTimepoint");
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
disassociateStudy = (timepointIds, studyInstanceUid) => {
|
||||
OHIF.log.info('disassociateStudy');
|
||||
OHIF.log.info("disassociateStudy");
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
@ -170,14 +170,14 @@ class Viewer extends Component {
|
||||
componentDidMount() {
|
||||
const { studies } = this.props;
|
||||
const { TimepointApi, MeasurementApi } = OHIF.measurements;
|
||||
const currentTimepointId = 'TimepointId';
|
||||
const currentTimepointId = "TimepointId";
|
||||
|
||||
const timepointApi = new TimepointApi(currentTimepointId, {
|
||||
onTimepointsUpdated: this.onTimepointsUpdated,
|
||||
onTimepointsUpdated: this.onTimepointsUpdated
|
||||
});
|
||||
|
||||
const measurementApi = new MeasurementApi(timepointApi, {
|
||||
onMeasurementsUpdated: this.onMeasurementsUpdated,
|
||||
onMeasurementsUpdated: this.onMeasurementsUpdated
|
||||
});
|
||||
|
||||
this.currentTimepointId = currentTimepointId;
|
||||
@ -191,7 +191,7 @@ class Viewer extends Component {
|
||||
measurementApi.retrieveMeasurements(patientId, [currentTimepointId]);
|
||||
|
||||
this.setState({
|
||||
thumbnails: _mapStudiesToThumbnails(studies),
|
||||
thumbnails: _mapStudiesToThumbnails(studies)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -206,7 +206,7 @@ class Viewer extends Component {
|
||||
this.measurementApi.retrieveMeasurements(patientId, [currentTimepointId]);
|
||||
|
||||
this.setState({
|
||||
thumbnails: _mapStudiesToThumbnails(studies),
|
||||
thumbnails: _mapStudiesToThumbnails(studies)
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -243,12 +243,12 @@ class Viewer extends Component {
|
||||
selectedLeftSidePanel={
|
||||
this.state.isLeftSidePanelOpen
|
||||
? this.state.selectedLeftSidePanel
|
||||
: ''
|
||||
: ""
|
||||
}
|
||||
selectedRightSidePanel={
|
||||
this.state.isRightSidePanelOpen
|
||||
? this.state.selectedRightSidePanel
|
||||
: ''
|
||||
: ""
|
||||
}
|
||||
handleSidePanelChange={(side, selectedPanel) => {
|
||||
const sideClicked = side && side[0].toUpperCase() + side.slice(1);
|
||||
@ -291,7 +291,7 @@ class Viewer extends Component {
|
||||
</SidePanel>
|
||||
|
||||
{/* MAIN */}
|
||||
<div className={classNames('main-content')}>
|
||||
<div className={classNames("main-content")}>
|
||||
<ConnectedViewerMain studies={this.props.studies} />
|
||||
</div>
|
||||
|
||||
@ -335,16 +335,16 @@ const _mapStudiesToThumbnails = function(studies) {
|
||||
seriesDescription,
|
||||
seriesNumber,
|
||||
instanceNumber,
|
||||
numImageFrames,
|
||||
numImageFrames
|
||||
} = displaySet;
|
||||
|
||||
let imageId;
|
||||
let altImageText = ' '; // modality
|
||||
let altImageText = " "; // modality
|
||||
|
||||
if (displaySet.images && displaySet.images.length) {
|
||||
imageId = displaySet.images[0].getImageId();
|
||||
} else {
|
||||
altImageText = 'SR';
|
||||
altImageText = "SR";
|
||||
}
|
||||
|
||||
return {
|
||||
@ -354,13 +354,13 @@ const _mapStudiesToThumbnails = function(studies) {
|
||||
seriesDescription,
|
||||
seriesNumber,
|
||||
instanceNumber,
|
||||
numImageFrames,
|
||||
numImageFrames
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
studyInstanceUid,
|
||||
thumbnails,
|
||||
thumbnails
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import React, { Component } from 'react';
|
||||
import { metadata, studies, utils } from 'ohif-core';
|
||||
import React, { Component } from "react";
|
||||
import { metadata, studies, utils } from "@ohif/core";
|
||||
|
||||
import ConnectedViewer from './ConnectedViewer.js';
|
||||
import PropTypes from 'prop-types';
|
||||
import { extensionManager } from './../App.js';
|
||||
import ConnectedViewer from "./ConnectedViewer.js";
|
||||
import PropTypes from "prop-types";
|
||||
import { extensionManager } from "./../App.js";
|
||||
|
||||
const { OHIFStudyMetadata } = metadata;
|
||||
const { retrieveStudiesMetadata } = studies;
|
||||
@ -13,12 +13,12 @@ class ViewerRetrieveStudyData extends Component {
|
||||
static propTypes = {
|
||||
studyInstanceUids: PropTypes.array.isRequired,
|
||||
seriesInstanceUids: PropTypes.array,
|
||||
server: PropTypes.object,
|
||||
server: PropTypes.object
|
||||
};
|
||||
|
||||
state = {
|
||||
studies: null,
|
||||
error: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
async componentDidMount() {
|
||||
@ -44,7 +44,7 @@ class ViewerRetrieveStudyData extends Component {
|
||||
study.studyInstanceUid
|
||||
);
|
||||
const sopClassHandlerModules =
|
||||
extensionManager.modules['sopClassHandlerModule'];
|
||||
extensionManager.modules["sopClassHandlerModule"];
|
||||
|
||||
study.displaySets =
|
||||
study.displaySets ||
|
||||
@ -60,11 +60,11 @@ class ViewerRetrieveStudyData extends Component {
|
||||
});
|
||||
|
||||
this.setState({
|
||||
studies: updatedStudies,
|
||||
studies: updatedStudies
|
||||
});
|
||||
} catch (err) {
|
||||
this.setState({
|
||||
error: true,
|
||||
error: true
|
||||
});
|
||||
|
||||
// TODO: Handle gracefully instead of throwing?
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import OHIF from 'ohif-core';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import OHIF from "@ohif/core";
|
||||
import cornerstone from "cornerstone-core";
|
||||
|
||||
export default function updateTableWithNewMeasurementData({
|
||||
toolType,
|
||||
measurementNumber,
|
||||
location,
|
||||
description,
|
||||
description
|
||||
}) {
|
||||
// Update all measurements by measurement number
|
||||
const measurementApi = OHIF.measurements.MeasurementApi.Instance;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import React, { Component } from 'react';
|
||||
import { log, metadata, studies, utils } from 'ohif-core';
|
||||
import React, { Component } from "react";
|
||||
import { log, metadata, studies, utils } from "@ohif/core";
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import Viewer from '../connectedComponents/Viewer';
|
||||
import { extensionManager } from './../App.js';
|
||||
import qs from 'querystring';
|
||||
import PropTypes from "prop-types";
|
||||
import Viewer from "../connectedComponents/Viewer";
|
||||
import { extensionManager } from "./../App.js";
|
||||
import qs from "querystring";
|
||||
|
||||
const { OHIFStudyMetadata } = metadata;
|
||||
const { retrieveStudiesMetadata } = studies;
|
||||
@ -13,12 +13,12 @@ const { studyMetadataManager, updateMetaDataManager } = utils;
|
||||
class StandaloneRouting extends Component {
|
||||
state = {
|
||||
studies: null,
|
||||
error: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
location: PropTypes.object,
|
||||
store: PropTypes.object,
|
||||
store: PropTypes.object
|
||||
};
|
||||
|
||||
static parseQueryAndFetchStudies(query) {
|
||||
@ -26,7 +26,7 @@ class StandaloneRouting extends Component {
|
||||
const url = query.url;
|
||||
|
||||
if (!url) {
|
||||
reject(new Error('No URL was specified. Use ?url=$yourURL'));
|
||||
reject(new Error("No URL was specified. Use ?url=$yourURL"));
|
||||
}
|
||||
|
||||
// Define a request to the server to retrieve the study data
|
||||
@ -34,19 +34,19 @@ class StandaloneRouting extends Component {
|
||||
const oReq = new XMLHttpRequest();
|
||||
|
||||
// Add event listeners for request failure
|
||||
oReq.addEventListener('error', error => {
|
||||
log.warn('An error occurred while retrieving the JSON data');
|
||||
oReq.addEventListener("error", error => {
|
||||
log.warn("An error occurred while retrieving the JSON data");
|
||||
reject(error);
|
||||
});
|
||||
|
||||
// When the JSON has been returned, parse it into a JavaScript Object
|
||||
// and render the OHIF Viewer with this data
|
||||
oReq.addEventListener('load', () => {
|
||||
oReq.addEventListener("load", () => {
|
||||
// Parse the response content
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseText
|
||||
if (!oReq.responseText) {
|
||||
log.warn('Response was undefined');
|
||||
reject(new Error('Response was undefined'));
|
||||
log.warn("Response was undefined");
|
||||
reject(new Error("Response was undefined"));
|
||||
}
|
||||
|
||||
log.info(JSON.stringify(oReq.responseText, null, 2));
|
||||
@ -54,9 +54,9 @@ class StandaloneRouting extends Component {
|
||||
const data = JSON.parse(oReq.responseText);
|
||||
if (data.servers && query.studyInstanceUids) {
|
||||
const server = data.servers.dicomWeb[0];
|
||||
server.type = 'dicomWeb';
|
||||
server.type = "dicomWeb";
|
||||
|
||||
const studyInstanceUids = query.studyInstanceUids.split(';');
|
||||
const studyInstanceUids = query.studyInstanceUids.split(";");
|
||||
const seriesInstanceUids = [];
|
||||
|
||||
retrieveStudiesMetadata(
|
||||
@ -80,8 +80,8 @@ class StandaloneRouting extends Component {
|
||||
// In this case we have a server-side route called /api/
|
||||
// which responds to GET requests with the study data
|
||||
log.info(`Sending Request to: ${url}`);
|
||||
oReq.open('GET', url);
|
||||
oReq.setRequestHeader('Accept', 'application/json');
|
||||
oReq.open("GET", url);
|
||||
oReq.setRequestHeader("Accept", "application/json");
|
||||
|
||||
// Fire the request to the server
|
||||
oReq.send();
|
||||
@ -102,7 +102,7 @@ class StandaloneRouting extends Component {
|
||||
study.studyInstanceUid
|
||||
);
|
||||
const sopClassHandlerModules =
|
||||
extensionManager.modules['sopClassHandlerModule'];
|
||||
extensionManager.modules["sopClassHandlerModule"];
|
||||
|
||||
study.displaySets =
|
||||
study.displaySets ||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import OHIF from 'ohif-core';
|
||||
import updateTableWithNewMeasurementData from './lib/updateTableWithNewMeasurementData';
|
||||
import OHIF from "@ohif/core";
|
||||
import updateTableWithNewMeasurementData from "./lib/updateTableWithNewMeasurementData";
|
||||
|
||||
function getToolLabellingFlowCallback(store) {
|
||||
const setLabellingFlowDataAction = labellingFlowData => ({
|
||||
type: 'SET_LABELLING_FLOW_DATA',
|
||||
labellingFlowData,
|
||||
type: "SET_LABELLING_FLOW_DATA",
|
||||
labellingFlowData
|
||||
});
|
||||
|
||||
const setLabellingFlowData = labellingFlowData => {
|
||||
@ -47,7 +47,7 @@ function getToolLabellingFlowCallback(store) {
|
||||
editResponse: options.editResponse,
|
||||
editDescriptionOnDialog: options.editDescriptionOnDialog,
|
||||
labellingDoneCallback,
|
||||
updateLabelling,
|
||||
updateLabelling
|
||||
};
|
||||
|
||||
setLabellingFlowData(labellingFlowData);
|
||||
@ -55,14 +55,14 @@ function getToolLabellingFlowCallback(store) {
|
||||
}
|
||||
|
||||
const resetLabellingAndContextMenuAction = state => ({
|
||||
type: 'RESET_LABELLING_AND_CONTEXT_MENU',
|
||||
state,
|
||||
type: "RESET_LABELLING_AND_CONTEXT_MENU",
|
||||
state
|
||||
});
|
||||
|
||||
const setToolContextMenuDataAction = (viewportIndex, toolContextMenuData) => ({
|
||||
type: 'SET_TOOL_CONTEXT_MENU_DATA',
|
||||
type: "SET_TOOL_CONTEXT_MENU_DATA",
|
||||
viewportIndex,
|
||||
toolContextMenuData,
|
||||
toolContextMenuData
|
||||
});
|
||||
|
||||
function getOnRightClickCallback(store) {
|
||||
@ -76,7 +76,7 @@ function getOnRightClickCallback(store) {
|
||||
const getOnCloseCallback = viewportIndex => {
|
||||
return function onClose() {
|
||||
const toolContextMenuData = {
|
||||
visible: false,
|
||||
visible: false
|
||||
};
|
||||
|
||||
store.dispatch(
|
||||
@ -92,7 +92,7 @@ function getOnRightClickCallback(store) {
|
||||
const toolContextMenuData = {
|
||||
eventData,
|
||||
isTouchEvent: false,
|
||||
onClose: getOnCloseCallback(viewportIndex),
|
||||
onClose: getOnCloseCallback(viewportIndex)
|
||||
};
|
||||
|
||||
setToolContextMenuData(viewportIndex, toolContextMenuData);
|
||||
@ -110,7 +110,7 @@ function getOnTouchPressCallback(store) {
|
||||
const getOnCloseCallback = viewportIndex => {
|
||||
return function onClose() {
|
||||
const toolContextMenuData = {
|
||||
visible: false,
|
||||
visible: false
|
||||
};
|
||||
|
||||
store.dispatch(
|
||||
@ -126,7 +126,7 @@ function getOnTouchPressCallback(store) {
|
||||
const toolContextMenuData = {
|
||||
eventData,
|
||||
isTouchEvent: true,
|
||||
onClose: getOnCloseCallback(viewportIndex),
|
||||
onClose: getOnCloseCallback(viewportIndex)
|
||||
};
|
||||
|
||||
setToolContextMenuData(viewportIndex, toolContextMenuData);
|
||||
@ -142,78 +142,78 @@ function getResetLabellingAndContextMenu(store) {
|
||||
export default function setupTools(store) {
|
||||
const toolLabellingFlowCallback = getToolLabellingFlowCallback(store);
|
||||
const availableTools = [
|
||||
{ name: 'Pan', mouseButtonMasks: [1, 4] },
|
||||
{ name: 'Zoom', mouseButtonMasks: [1, 2] },
|
||||
{ name: 'Wwwc', mouseButtonMasks: [1] },
|
||||
{ name: "Pan", mouseButtonMasks: [1, 4] },
|
||||
{ name: "Zoom", mouseButtonMasks: [1, 2] },
|
||||
{ name: "Wwwc", mouseButtonMasks: [1] },
|
||||
{
|
||||
name: 'Bidirectional',
|
||||
name: "Bidirectional",
|
||||
props: {
|
||||
configuration: {
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
||||
},
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback
|
||||
}
|
||||
},
|
||||
mouseButtonMasks: [1],
|
||||
mouseButtonMasks: [1]
|
||||
},
|
||||
{
|
||||
name: 'Length',
|
||||
name: "Length",
|
||||
props: {
|
||||
configuration: {
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
||||
},
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback
|
||||
}
|
||||
},
|
||||
mouseButtonMasks: [1],
|
||||
mouseButtonMasks: [1]
|
||||
},
|
||||
{
|
||||
name: 'Angle',
|
||||
name: "Angle",
|
||||
props: {
|
||||
configuration: {
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
||||
},
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback
|
||||
}
|
||||
},
|
||||
mouseButtonMasks: [1],
|
||||
mouseButtonMasks: [1]
|
||||
},
|
||||
{ name: 'StackScroll', mouseButtonMasks: [1] },
|
||||
{ name: 'Brush', mouseButtonMasks: [1] },
|
||||
{ name: "StackScroll", mouseButtonMasks: [1] },
|
||||
{ name: "Brush", mouseButtonMasks: [1] },
|
||||
{
|
||||
name: 'FreehandMouse',
|
||||
name: "FreehandMouse",
|
||||
configuration: {
|
||||
configuration: {
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
||||
},
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback
|
||||
}
|
||||
},
|
||||
mouseButtonMasks: [1],
|
||||
mouseButtonMasks: [1]
|
||||
},
|
||||
{
|
||||
name: 'EllipticalRoi',
|
||||
name: "EllipticalRoi",
|
||||
props: {
|
||||
configuration: {
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
||||
},
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback
|
||||
}
|
||||
},
|
||||
mouseButtonMasks: [1],
|
||||
mouseButtonMasks: [1]
|
||||
},
|
||||
{
|
||||
name: 'CircleRoi',
|
||||
name: "CircleRoi",
|
||||
props: {
|
||||
configuration: {
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
||||
},
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback
|
||||
}
|
||||
},
|
||||
mouseButtonMasks: [1],
|
||||
mouseButtonMasks: [1]
|
||||
},
|
||||
{
|
||||
name: 'RectangleRoi',
|
||||
name: "RectangleRoi",
|
||||
props: {
|
||||
configuration: {
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
||||
},
|
||||
getMeasurementLocationCallback: toolLabellingFlowCallback
|
||||
}
|
||||
},
|
||||
mouseButtonMasks: [1],
|
||||
mouseButtonMasks: [1]
|
||||
},
|
||||
{ name: 'PanMultiTouch' },
|
||||
{ name: 'ZoomTouchPinch' },
|
||||
{ name: 'StackScrollMouseWheel' },
|
||||
{ name: 'StackScrollMultiTouch' },
|
||||
{ name: "PanMultiTouch" },
|
||||
{ name: "ZoomTouchPinch" },
|
||||
{ name: "StackScrollMouseWheel" },
|
||||
{ name: "StackScrollMultiTouch" }
|
||||
];
|
||||
|
||||
const onRightClick = getOnRightClickCallback(store);
|
||||
@ -221,13 +221,13 @@ export default function setupTools(store) {
|
||||
const onNewImage = getResetLabellingAndContextMenu(store);
|
||||
const onMouseClick = getResetLabellingAndContextMenu(store);
|
||||
const onTouchStart = getResetLabellingAndContextMenu(store);
|
||||
const toolAction = OHIF.redux.actions.setExtensionData('cornerstone', {
|
||||
const toolAction = OHIF.redux.actions.setExtensionData("cornerstone", {
|
||||
availableTools,
|
||||
onNewImage,
|
||||
onRightClick,
|
||||
onTouchPress,
|
||||
onTouchStart,
|
||||
onMouseClick,
|
||||
onMouseClick
|
||||
});
|
||||
|
||||
store.dispatch(toolAction);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { applyMiddleware, combineReducers, createStore } from 'redux';
|
||||
import { applyMiddleware, combineReducers, createStore } from "redux";
|
||||
|
||||
// import { createLogger } from 'redux-logger';
|
||||
import layoutReducers from './layout/reducers.js';
|
||||
import { reducer as oidcReducer } from 'redux-oidc';
|
||||
import { redux } from 'ohif-core';
|
||||
import thunkMiddleware from 'redux-thunk';
|
||||
import layoutReducers from "./layout/reducers.js";
|
||||
import { reducer as oidcReducer } from "redux-oidc";
|
||||
import { redux } from "@ohif/core";
|
||||
import thunkMiddleware from "redux-thunk";
|
||||
|
||||
// Combine our ohif-core, ui, and oidc reducers
|
||||
// Set init data, using values found in localStorage
|
||||
@ -28,7 +28,7 @@ const store = createStore(
|
||||
// Update our cached preferences in localStorage
|
||||
store.subscribe(() => {
|
||||
localStorage.saveState({
|
||||
preferences: store.getState().preferences,
|
||||
preferences: store.getState().preferences
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,31 +1,31 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import OHIF from 'ohif-core';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { StudyList } from 'react-viewerbase';
|
||||
import ConnectedHeader from '../connectedComponents/ConnectedHeader.js';
|
||||
import moment from 'moment';
|
||||
import React, { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import OHIF from "@ohif/core";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import { StudyList } from "react-viewerbase";
|
||||
import ConnectedHeader from "../connectedComponents/ConnectedHeader.js";
|
||||
import moment from "moment";
|
||||
|
||||
class StudyListWithData extends Component {
|
||||
state = {
|
||||
searchData: {},
|
||||
studies: null,
|
||||
error: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
patientId: PropTypes.string,
|
||||
server: PropTypes.object,
|
||||
user: PropTypes.object,
|
||||
history: PropTypes.object,
|
||||
history: PropTypes.object
|
||||
};
|
||||
|
||||
static rowsPerPage = 25;
|
||||
static defaultSort = { field: 'patientName', order: 'desc' };
|
||||
static defaultSort = { field: "patientName", order: "desc" };
|
||||
|
||||
static studyListDateFilterNumDays = 25000; // TODO: put this in the settings
|
||||
static defaultStudyDateFrom = moment()
|
||||
.subtract(StudyListWithData.studyListDateFilterNumDays, 'days')
|
||||
.subtract(StudyListWithData.studyListDateFilterNumDays, "days")
|
||||
.toDate();
|
||||
static defaultStudyDateTo = new Date();
|
||||
|
||||
@ -42,7 +42,7 @@ class StudyListWithData extends Component {
|
||||
rowsPerPage: StudyListWithData.rowsPerPage,
|
||||
studyDateFrom: StudyListWithData.defaultStudyDateFrom,
|
||||
studyDateTo: StudyListWithData.defaultStudyDateTo,
|
||||
sortData: StudyListWithData.defaultSort,
|
||||
sortData: StudyListWithData.defaultSort
|
||||
}
|
||||
) => {
|
||||
const { server } = this.props;
|
||||
@ -55,7 +55,7 @@ class StudyListWithData extends Component {
|
||||
studyDateFrom: searchData.studyDateFrom,
|
||||
studyDateTo: searchData.studyDateTo,
|
||||
limit: searchData.rowsPerPage,
|
||||
offset: searchData.currentPage * searchData.rowsPerPage,
|
||||
offset: searchData.currentPage * searchData.rowsPerPage
|
||||
};
|
||||
|
||||
// TODO: add sorting
|
||||
@ -70,9 +70,9 @@ class StudyListWithData extends Component {
|
||||
|
||||
const { field, order } = searchData.sortData;
|
||||
let sortedStudies = studies.map(study => {
|
||||
if (!moment(study.studyDate, 'MMM DD, YYYY', true).isValid()) {
|
||||
study.studyDate = moment(study.studyDate, 'YYYYMMDD').format(
|
||||
'MMM DD, YYYY'
|
||||
if (!moment(study.studyDate, "MMM DD, YYYY", true).isValid()) {
|
||||
study.studyDate = moment(study.studyDate, "YYYYMMDD").format(
|
||||
"MMM DD, YYYY"
|
||||
);
|
||||
}
|
||||
return study;
|
||||
@ -81,11 +81,11 @@ class StudyListWithData extends Component {
|
||||
sortedStudies.sort(function(a, b) {
|
||||
let fieldA = a[field];
|
||||
let fieldB = b[field];
|
||||
if (field === 'studyDate') {
|
||||
if (field === "studyDate") {
|
||||
fieldA = moment(fieldA).toISOString();
|
||||
fieldB = moment(fieldB).toISOString();
|
||||
}
|
||||
if (order === 'desc') {
|
||||
if (order === "desc") {
|
||||
if (fieldA < fieldB) {
|
||||
return -1;
|
||||
}
|
||||
@ -105,12 +105,12 @@ class StudyListWithData extends Component {
|
||||
});
|
||||
|
||||
this.setState({
|
||||
studies: sortedStudies,
|
||||
studies: sortedStudies
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
this.setState({
|
||||
error: true,
|
||||
error: true
|
||||
});
|
||||
|
||||
throw new Error(error);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user