Skip to content

feat(demo): add button to reproduce labelmap removal crash#2566

Merged
wayfarer3130 merged 2 commits into
cornerstonejs:mainfrom
theoc0702:Bug--Delete-Labelmap-Representation
Jun 23, 2026
Merged

feat(demo): add button to reproduce labelmap removal crash#2566
wayfarer3130 merged 2 commits into
cornerstonejs:mainfrom
theoc0702:Bug--Delete-Labelmap-Representation

Conversation

@theoc0702

Copy link
Copy Markdown
Contributor

Context

This PR shows a crash that occurs when removing a segmentation representation from a MIP (Maximum Intensity Projection) viewport.
In the SEGMENTATION_REPRESENTATION_REMOVED event listener, the code attempts to immediately re-create a volume actor using createVolumeActor. However, it passes the uid (which is the Actor UID being removed) as the volumeId.
For derived volumes (like labelmaps generated in memory), this incorrect ID causes volumeLoader to fail, often throwing the error: Error: ImageIds must be provided to create a streaming image volume. This happens because the loader cannot find the derived volume by that ID and falls back to the streaming loader, which requires ImageIds.

Changes & Results

Added a button for trying to delete the Labelmap eepresentation and cause the error.

Testing

In the example labelmapMip, add a Labelmap Representation then click on the button "Delete Labelmap Representation" wich try to delete the labelmap and shows the error

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • "OS: Ubuntu v24.04.3 LTS
  • "Node version: v24.11.0
  • "Browser: Chrome Version 143.0.7499.169

@salimkanoun

Copy link
Copy Markdown
Contributor

This PR is to demonstrate a bug we found, we didn't succeed to understand the logic to fix the bug

@wayfarer3130

Copy link
Copy Markdown
Collaborator

When I try it, it goes all weird:
image

@wayfarer3130 wayfarer3130 force-pushed the Bug--Delete-Labelmap-Representation branch from 977c40c to 6086ee2 Compare February 9, 2026 22:32

@wayfarer3130 wayfarer3130 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be an empty change based on the 3.12 release version. Can you close, or else look at the purple background issue I posted in the comments/

@salimkanoun

Copy link
Copy Markdown
Contributor

@wayfarer3130 the initial bug is fixed,

The other bug I have is when I remove the segmentation I loose my SlabThinkness see :
Screencast from 2026-02-19 23-09-29.webm

However it is probably another bug, can we merge this PR to get this button to remove segmentation and then we will see what we can do on this viewport property loss

@wayfarer3130 wayfarer3130 merged commit 2409652 into cornerstonejs:main Jun 23, 2026
7 of 9 checks passed
wayfarer3130 added a commit that referenced this pull request Jun 24, 2026
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants