Describe the Bug
Switching between layouts that include a 3D viewport can cause the labelmap-to-surface conversion to run twice for the same segmentation.
The duplicate conversion occurs because triggerSegmentationDataModified is triggered twice: once when adding the labelmap representation to the viewport and again from internalAddSegmentationRepresentation. As a result, the labelmap-to-surface conversion is triggered twice, causing unnecessary duplicate processing in web workers.
Steps to Reproduce
- Load a study with a segmentation.
- Use a layout that includes a 3D viewport and displays the segmentation.
- Switch to another layout that also includes a 3D viewport.
- Observe the labelmap-to-surface conversion and the associated segmentation data modification events.
The current behavior
The labelmap-to-surface conversion runs twice when switching between layouts containing a 3D viewport. This results in duplicate conversion requests and unnecessary web worker processing.
The expected behavior
The labelmap-to-surface conversion should run only once for the segmentation after the viewport representation has been added and rendering is complete.
System Information
System:
OS: Linux 6.11 Ubuntu 24.10 24.10 (Oracular Oriole)
Node: 22.16.0 - ~/.nvm/versions/node/v22.16.0/bin/node
Chrome: 139.0.7258.154
Describe the Bug
Switching between layouts that include a 3D viewport can cause the labelmap-to-surface conversion to run twice for the same segmentation.
The duplicate conversion occurs because triggerSegmentationDataModified is triggered twice: once when adding the labelmap representation to the viewport and again from internalAddSegmentationRepresentation. As a result, the labelmap-to-surface conversion is triggered twice, causing unnecessary duplicate processing in web workers.
Steps to Reproduce
The current behavior
The labelmap-to-surface conversion runs twice when switching between layouts containing a 3D viewport. This results in duplicate conversion requests and unnecessary web worker processing.
The expected behavior
The labelmap-to-surface conversion should run only once for the segmentation after the viewport representation has been added and rendering is complete.
System Information
System:
OS: Linux 6.11 Ubuntu 24.10 24.10 (Oracular Oriole)
Node: 22.16.0 - ~/.nvm/versions/node/v22.16.0/bin/node
Chrome: 139.0.7258.154