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,
|
||||
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',
|
||||
|
||||
@ -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}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user