Skip to content

[Bug] Colormaps do not respect invert #2397

@msatti-shg

Description

@msatti-shg

Describe the Bug

When a colormap is applied to a viewport that has been inverted, the colormap is not inverted.

Steps to Reproduce

Scenario 1: Apply colormap then invert

  1. Go to https://www.cornerstonejs.org/live-examples/stackapi
  2. Click 'Apply Colormap'
  3. Click 'Invert'
    ✅ The colormap is inverted

Scenario 2: Apply invert then colormap

  1. Go to https://www.cornerstonejs.org/live-examples/stackapi
  2. Click 'Invert'
  3. Click 'Apply Colormap'
    🔴 The colormap is not inverted, even though the invert state is true

The current behavior

As above

The expected behavior

I would expect scenario 1 and scenario 2 to have the same outcome as the viewports have the same colormap and invert state.

System Information

npx envinfo --system --binaries --browsers
System:
OS: macOS 26.0.1
CPU: (14) arm64 Apple M4 Pro
Memory: 5.35 GB / 24.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.17.0 - /usr/local/bin/node
Yarn: 1.22.22 - /usr/local/bin/yarn
npm: 11.4.2 - /usr/local/bin/npm
Browsers:
Chrome: 141.0.7390.78
Edge: 141.0.3537.71
Safari: 26.0.1

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