fix(segmentation): When synchronizing a segmentation representation, use the type of the source viewport segmentation to determine the type of the target viewport segmentation (#5546)

This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2025-11-05 12:00:41 -05:00
1 parent bee60a5482
commit a0556b08be
1 file changed
+3 -2
@@ -43,7 +43,7 @@ const segmentationRepresentationModifiedCallback = async (
) => {
const event = sourceEvent as ToolsTypes.EventTypes.SegmentationRepresentationModifiedEventType;
const { segmentationId } = event.detail;
const { segmentationId, type: segmentationRepresentationType } = event.detail;
const { segmentationService } = servicesManager.services;
const targetViewportId = targetViewport.viewportId;
@@ -69,7 +69,8 @@ const segmentationRepresentationModifiedCallback = async (
const type: Enums.SegmentationRepresentations =
viewport.type === CoreEnums.ViewportType.VOLUME_3D
? Enums.SegmentationRepresentations.Surface
: Enums.SegmentationRepresentations.Labelmap;
: ((segmentationRepresentationType as Enums.SegmentationRepresentations) ??
Enums.SegmentationRepresentations.Labelmap);
await segmentationService.addSegmentationRepresentation(targetViewportId, {
segmentationId,