feat(segmentation): Add customization for handling missing referencedDisplaySetInstanceUID for the SEG/RTSTRUCT. (#4983)
This commit is contained in:
parent
91d0ae7da6
commit
12de7a85c9
@ -51,6 +51,21 @@ function OHIFCornerstoneRTViewport(props: withAppTypes) {
|
|||||||
const referencedDisplaySetRef = useRef(null);
|
const referencedDisplaySetRef = useRef(null);
|
||||||
|
|
||||||
const referencedDisplaySetInstanceUID = rtDisplaySet.referencedDisplaySetInstanceUID;
|
const referencedDisplaySetInstanceUID = rtDisplaySet.referencedDisplaySetInstanceUID;
|
||||||
|
// If the referencedDisplaySetInstanceUID is not found, it means the RTStruct series is being
|
||||||
|
// launched without its corresponding referenced display set (e.g., the RTStruct series is launched using
|
||||||
|
// series launch /mode?StudyInstanceUIDs=&SeriesInstanceUID).
|
||||||
|
// In such cases, we attempt to handle this scenario gracefully by
|
||||||
|
// invoking a custom handler. Ideally, if a user tries to launch a series that isn't viewable,
|
||||||
|
// (eg.: we can prompt them with an explanation and provide a link to the full study).
|
||||||
|
if (!referencedDisplaySetInstanceUID) {
|
||||||
|
const missingReferenceDisplaySetHandler = customizationService.getCustomization(
|
||||||
|
'missingReferenceDisplaySetHandler'
|
||||||
|
);
|
||||||
|
const { handled } = missingReferenceDisplaySetHandler();
|
||||||
|
if (handled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
const referencedDisplaySet = displaySetService.getDisplaySetByUID(
|
const referencedDisplaySet = displaySetService.getDisplaySetByUID(
|
||||||
referencedDisplaySetInstanceUID
|
referencedDisplaySetInstanceUID
|
||||||
);
|
);
|
||||||
|
|||||||
@ -54,6 +54,21 @@ function OHIFCornerstoneSEGViewport(props: withAppTypes) {
|
|||||||
const { viewports, activeViewportId } = viewportGrid;
|
const { viewports, activeViewportId } = viewportGrid;
|
||||||
|
|
||||||
const referencedDisplaySetInstanceUID = segDisplaySet.referencedDisplaySetInstanceUID;
|
const referencedDisplaySetInstanceUID = segDisplaySet.referencedDisplaySetInstanceUID;
|
||||||
|
// If the referencedDisplaySetInstanceUID is not found, it means the SEG series is being
|
||||||
|
// launched without its corresponding referenced display set (e.g., the SEG series is launched using
|
||||||
|
// series launch /mode?StudyInstanceUIDs=&SeriesInstanceUID).
|
||||||
|
// In such cases, we attempt to handle this scenario gracefully by
|
||||||
|
// invoking a custom handler. Ideally, if a user tries to launch a series that isn't viewable,
|
||||||
|
// (eg.: we can prompt them with an explanation and provide a link to the full study).
|
||||||
|
if (!referencedDisplaySetInstanceUID) {
|
||||||
|
const missingReferenceDisplaySetHandler = customizationService.getCustomization(
|
||||||
|
'missingReferenceDisplaySetHandler'
|
||||||
|
);
|
||||||
|
const { handled } = missingReferenceDisplaySetHandler();
|
||||||
|
if (handled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
const referencedDisplaySet = displaySetService.getDisplaySetByUID(
|
const referencedDisplaySet = displaySetService.getDisplaySetByUID(
|
||||||
referencedDisplaySetInstanceUID
|
referencedDisplaySetInstanceUID
|
||||||
);
|
);
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
export default {
|
||||||
|
missingReferenceDisplaySetHandler: () => {
|
||||||
|
return Promise.resolve({ handled: false });
|
||||||
|
},
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue
Block a user