diff --git a/extensions/dicom-rt/src/components/RTPanel/RTPanel.js b/extensions/dicom-rt/src/components/RTPanel/RTPanel.js index 879c45e7b..e7c03df01 100644 --- a/extensions/dicom-rt/src/components/RTPanel/RTPanel.js +++ b/extensions/dicom-rt/src/components/RTPanel/RTPanel.js @@ -37,6 +37,7 @@ const RTPanel = ({ activeIndex, isOpen, onContourItemClick, + noContoursNotification, activeContexts = [], contexts = {}, }) => { @@ -156,6 +157,12 @@ const RTPanel = ({ imageIds ); + if (!imageId) { + noContoursNotification(); + + return; + } + const frameIndex = imageIds.indexOf(imageId); const SOPInstanceUID = cornerstone.metaData.get( 'SOPInstanceUID', diff --git a/extensions/dicom-rt/src/index.js b/extensions/dicom-rt/src/index.js index fae258a11..a38561c0c 100644 --- a/extensions/dicom-rt/src/index.js +++ b/extensions/dicom-rt/src/index.js @@ -20,10 +20,21 @@ export default { preRegistration({ servicesManager, configuration = {} }) { init({ servicesManager, configuration }); }, - getPanelModule({ commandsManager, api }) { + getPanelModule({ commandsManager, servicesManager, api }) { + const { UINotificationService } = servicesManager.services; + const ExtendedRTPanel = props => { const { activeContexts } = api.hooks.useAppContext(); + const noContoursNotificationHandler = () => { + UINotificationService.show({ + title: 'ROI Contour empty', + message: 'The ROI contour has no structure set data.', + type: 'error', + autoClose: false, + }); + }; + const contourItemClickHandler = contourData => { commandsManager.runCommand('jumpToImage', contourData); }; @@ -34,6 +45,7 @@ export default { onContourItemClick={contourItemClickHandler} activeContexts={activeContexts} contexts={api.contexts} + noContoursNotification={noContoursNotificationHandler} /> ); };