Skip to content

[Bug]: Labelmap-to-surface conversion is triggered twice when switching layouts with a 3D viewport #2874

Description

@Devu-trenser

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions