From a0556b08be98e0bba950ad7b9b575d7b971104ba Mon Sep 17 00:00:00 2001 From: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com> Date: Wed, 5 Nov 2025 12:00:41 -0500 Subject: [PATCH] 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) --- .../createHydrateSegmentationSynchronizer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/cornerstone/src/services/SyncGroupService/createHydrateSegmentationSynchronizer.ts b/extensions/cornerstone/src/services/SyncGroupService/createHydrateSegmentationSynchronizer.ts index f20bbd6b8..8bebf6439 100644 --- a/extensions/cornerstone/src/services/SyncGroupService/createHydrateSegmentationSynchronizer.ts +++ b/extensions/cornerstone/src/services/SyncGroupService/createHydrateSegmentationSynchronizer.ts @@ -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,