2020-04-24 12:25:05 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
|
2020-03-13 20:45:26 +01:00
|
|
|
import init from './init.js';
|
|
|
|
|
import toolbarModule from './toolbarModule.js';
|
|
|
|
|
import sopClassHandlerModule from './OHIFDicomSegSopClassHandler.js';
|
2020-04-24 12:25:05 +02:00
|
|
|
import SegmentationPanel from './components/SegmentationPanel/SegmentationPanel.js';
|
2020-03-13 20:45:26 +01:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
/**
|
|
|
|
|
* Only required property. Should be a unique value across all extensions.
|
|
|
|
|
*/
|
|
|
|
|
id: 'com.ohif.dicom-segmentation',
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param {object} [configuration={}]
|
|
|
|
|
* @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
|
|
|
|
|
*/
|
|
|
|
|
preRegistration({ servicesManager, configuration = {} }) {
|
|
|
|
|
init({ servicesManager, configuration });
|
|
|
|
|
},
|
|
|
|
|
getToolbarModule({ servicesManager }) {
|
|
|
|
|
return toolbarModule;
|
|
|
|
|
},
|
2020-04-24 12:25:05 +02:00
|
|
|
getPanelModule({ commandsManager }) {
|
|
|
|
|
const ExtendedSegmentationPanel = props => {
|
|
|
|
|
const segItemClickHandler = segData => {
|
|
|
|
|
commandsManager.runCommand('jumpToImage', segData);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<SegmentationPanel {...props} onSegItemClick={segItemClickHandler} />
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
menuOptions: [
|
|
|
|
|
{
|
|
|
|
|
icon: 'list',
|
|
|
|
|
label: 'Segmentations',
|
|
|
|
|
target: 'segmentation-panel',
|
|
|
|
|
isDisabled: studies => {
|
|
|
|
|
if (!studies) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < studies.length; i++) {
|
|
|
|
|
const study = studies[i];
|
|
|
|
|
|
|
|
|
|
if (study && study.series) {
|
|
|
|
|
for (let j = 0; j < study.series.length; j++) {
|
|
|
|
|
const series = study.series[j];
|
|
|
|
|
|
|
|
|
|
if (series.Modality === 'SEG') {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
components: [
|
|
|
|
|
{
|
|
|
|
|
id: 'segmentation-panel',
|
|
|
|
|
component: ExtendedSegmentationPanel,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
defaultContext: ['VIEWER'],
|
|
|
|
|
};
|
2020-03-13 20:45:26 +01:00
|
|
|
},
|
|
|
|
|
getSopClassHandlerModule({ servicesManager }) {
|
|
|
|
|
return sopClassHandlerModule;
|
|
|
|
|
},
|
|
|
|
|
};
|