fix(cornerstone-dicom-rt): adding caching usage to cornerstone-dicom-rt SOP Class Handler (#5387)

This commit is contained in:
Vinícius Alves de Faria Resende authored and GitHub committed 2025-09-05 08:35:16 -04:00
1 parent 7de1c78fc4
commit d6ea179ac4
3 files changed
+52 -54

No files matched your search

@@ -574,10 +574,19 @@ class SegmentationService extends PubSubService {
// find the first image id that contains a referenced SOP instance UID
const firstSegmentedSliceImageId =
referencedImageIds?.find(imageId =>
referencedImageIdsWithGeometry.some(referencedId => imageId.includes(referencedId))
referencedImageIdsWithGeometry.some(referencedId =>
imageId.includes(referencedId as string)
)
) || null;
rtDisplaySet.firstSegmentedSliceImageId = firstSegmentedSliceImageId;
if (!structureSet.ROIContours?.length) {
throw new Error(
'The structureSet does not contain any ROIContours. Please ensure the structureSet is loaded first.'
);
}
// Map ROI contours to RT Struct Data
const allRTStructData = mapROIContoursToRTStructData(structureSet, rtDisplaySetUID);
@@ -600,12 +609,6 @@ class SegmentationService extends PubSubService {
},
};
if (!structureSet.ROIContours?.length) {
throw new Error(
'The structureSet does not contain any ROIContours. Please ensure the structureSet is loaded first.'
);
}
const segments: { [segmentIndex: string]: cstTypes.Segment } = {};
let segmentsCachedStats = {};