Skip to content

Commit 5188892

Browse files
committed
fix: empty image filter
1 parent 7d3304e commit 5188892

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/adapters/src/adapters/Cornerstone3D/Segmentation/labelmapImagesFromBuffer.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,14 @@ const getArrayOfLabelMapImagesWithSegmentData = ({
485485
const labelMapImages = referencedImageIds
486486
.map((referencedImageId, i) => {
487487
const hasEmptySegmentData = !arr[i];
488-
if (hasEmptySegmentData && !largestArrayIndex) {
489-
return;
490-
}
488+
489+
// @TODO: right now cornerstone loses reference of the images when you don't have the complete set of images for each
490+
// grouping of segments, but in order to save memory we would ideally only duplicate images where the there is overlapping
491+
// so when this losing of reference is fixed, we can implement some filter like the one below in order to get rid of empty
492+
// segment images that only take up memory space
493+
// if (hasEmptySegmentData && i !== largestArrayIndex) {
494+
// return;
495+
// }
491496

492497
const labelMapImage =
493498
imageLoader.createAndCacheDerivedLabelmapImage(

0 commit comments

Comments
 (0)