* 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:
James Petts 2020-07-13 15:29:29 +01:00 committed by GitHub
parent b6b5a8414f
commit 4a2922dda0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -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',

View File

@ -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}
/>
);
};