fix(240): distinct fractional-overlay palettes and legend visibility sync#388
Open
igoroctaviano wants to merge 2 commits into
Open
fix(240): distinct fractional-overlay palettes and legend visibility sync#388igoroctaviano wants to merge 2 commits into
igoroctaviano wants to merge 2 commits into
Conversation
…sync Use dmv.color.createDistinctColormap() to give each fractional segment and parametric map a perceptually distinct single-hue palette instead of cycling look-alike multi-hue color maps, so overlays are easy to distinguish and to match against the legend. Subscribe to the new dicom-microscopy-viewer visibility events so toggling an overlay from the in-viewport legend keeps the right-panel switches in sync. Refs ImagingDataCommons/dicom-microscopy-viewer#240
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Jun 4, 2026 8:05p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
…/240-frac-seg-colors-overlay-toggle
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Addresses the Slim side of dicom-microscopy-viewer#240 (improve LUT color selection for fractional segmentations + toggle overlays without the side panel).
VIRIDIS → MAGMA → INFERNO → HOT → …) indistinctOverlayColormaps.tswithdmv.color.createDistinctColormap(index), giving each fractional segment and parametric map a perceptually distinct single-hue palette that is easy to distinguish and to match against the legend. DICOMRecommendedDisplayCIELabValueis still honored.SEGMENT_VISIBILITY_CHANGED/PARAMETER_MAPPING_VISIBILITY_CHANGED) so toggling an overlay from the in-viewport legend keeps the right-panel switches in sync (state-only mirror, no toggle loop).createDistinctColormaptype to the localdicom-microscopy-viewertype declarations.Changes
src/utils/distinctOverlayColormaps.ts: usecreateDistinctColormapfor fractional segments and parametric maps.src/components/SlideViewer.tsx: listen for the new visibility events and mirror them intovisibleSegmentUIDs/visibleMappingUIDs.types/dicom-microscopy-viewer/index.d.ts: declarecolor.createDistinctColormap.Depends on
ImagingDataCommons/dicom-microscopy-viewer#242 — Slim must consume a build of that branch (it currently resolves the published
dicom-microscopy-viewer@0.48.21);createDistinctColormapand the events come from there.Test plan