Idc 1892 (#1896)
* fix: 🐛 Fix RT Panel hide/show * Prevent infinite loop by persisting load errors on displaySet. * fix: 🐛 Fix infinite error messages * Fix unit tests. * WIP * fix: 🐛 If no contours for structure, cleanly exit and notify ✅ Closes: #1892
This commit is contained in:
parent
b6b5a8414f
commit
4a2922dda0
@ -37,6 +37,7 @@ const RTPanel = ({
|
|||||||
activeIndex,
|
activeIndex,
|
||||||
isOpen,
|
isOpen,
|
||||||
onContourItemClick,
|
onContourItemClick,
|
||||||
|
noContoursNotification,
|
||||||
activeContexts = [],
|
activeContexts = [],
|
||||||
contexts = {},
|
contexts = {},
|
||||||
}) => {
|
}) => {
|
||||||
@ -156,6 +157,12 @@ const RTPanel = ({
|
|||||||
imageIds
|
imageIds
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!imageId) {
|
||||||
|
noContoursNotification();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const frameIndex = imageIds.indexOf(imageId);
|
const frameIndex = imageIds.indexOf(imageId);
|
||||||
const SOPInstanceUID = cornerstone.metaData.get(
|
const SOPInstanceUID = cornerstone.metaData.get(
|
||||||
'SOPInstanceUID',
|
'SOPInstanceUID',
|
||||||
|
|||||||
@ -20,10 +20,21 @@ export default {
|
|||||||
preRegistration({ servicesManager, configuration = {} }) {
|
preRegistration({ servicesManager, configuration = {} }) {
|
||||||
init({ servicesManager, configuration });
|
init({ servicesManager, configuration });
|
||||||
},
|
},
|
||||||
getPanelModule({ commandsManager, api }) {
|
getPanelModule({ commandsManager, servicesManager, api }) {
|
||||||
|
const { UINotificationService } = servicesManager.services;
|
||||||
|
|
||||||
const ExtendedRTPanel = props => {
|
const ExtendedRTPanel = props => {
|
||||||
const { activeContexts } = api.hooks.useAppContext();
|
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 => {
|
const contourItemClickHandler = contourData => {
|
||||||
commandsManager.runCommand('jumpToImage', contourData);
|
commandsManager.runCommand('jumpToImage', contourData);
|
||||||
};
|
};
|
||||||
@ -34,6 +45,7 @@ export default {
|
|||||||
onContourItemClick={contourItemClickHandler}
|
onContourItemClick={contourItemClickHandler}
|
||||||
activeContexts={activeContexts}
|
activeContexts={activeContexts}
|
||||||
contexts={api.contexts}
|
contexts={api.contexts}
|
||||||
|
noContoursNotification={noContoursNotificationHandler}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user