import React from 'react'; import init from './init.js'; import toolbarModule from './toolbarModule.js'; import sopClassHandlerModule from './OHIFDicomSegSopClassHandler.js'; import SegmentationPanel from './components/SegmentationPanel/SegmentationPanel.js'; 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; }, getPanelModule({ commandsManager }) { const ExtendedSegmentationPanel = props => { const segItemClickHandler = segData => { commandsManager.runCommand('jumpToImage', segData); }; return ( ); }; 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'], }; }, getSopClassHandlerModule({ servicesManager }) { return sopClassHandlerModule; }, };