fix: Segmentation not displayed and unable to draw segments in volume viewport after converting Labelmap to Surface (#5488)

* fix: unable to draw segment after 3d layout

* comment update

---------
This commit is contained in:
Devu-trenser authored and GitHub committed 2025-10-15 09:35:26 -04:00
1 parent 05ecdfe512
commit faea09e7ef
2 files changed
+10 -17

No files matched your search

@@ -1336,17 +1336,12 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi
const { segmentationId, type, hydrated } = presentationItem;
const { Labelmap, Surface } = csToolsEnums.SegmentationRepresentations;
const representationType = (() => {
if (type === Surface) {
if (viewport.type === csEnums.ViewportType.VOLUME_3D) {
return Surface;
} else {
return Labelmap;
}
}
const isVolume3D = viewport.type === csEnums.ViewportType.VOLUME_3D;
return type;
})();
// Determine the appropriate segmentation representation for the viewport.
// If the current type is Surface but the viewport is not 3D, fallback to Labelmap.
// Otherwise, use the existing type.
const representationType = type === Surface && !isVolume3D ? Labelmap : type;
if (hydrated) {
segmentationService.addSegmentationRepresentation(viewport.id, {