Skip to content

fix: changeColorMap example#2812

Open
bionoone wants to merge 1 commit into
cornerstonejs:mainfrom
bionoone:fix/changeColorMap-example
Open

fix: changeColorMap example#2812
bionoone wants to merge 1 commit into
cornerstonejs:mainfrom
bionoone:fix/changeColorMap-example

Conversation

@bionoone

@bionoone bionoone commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Context

example is broken:
https://www.cornerstonejs.org/live-examples/changecolormap

this example demonstrate issue reported in #826 & #2384

depending on color map, there is an opacity "jump" between 99% and 100%

Changes & Results

Testing

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:
  • [] "Node version:
  • [] "Browser:

Summary by CodeRabbit

  • New Features
    • Updated the fusion viewport example to apply a PET color map to the PT volume.
    • CT and PT volumes are now loaded and displayed together for fused visualization.
    • Rendering is triggered after both volumes are configured, resulting in a smoother, single-step fused scene.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ebe5f00f-2b2b-4605-8bb6-e3638ea02c55

📥 Commits

Reviewing files that changed from the base of the PR and between 60b63eb and 849e7ae.

📒 Files selected for processing (1)
  • packages/tools/examples/changeColormap/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/tools/examples/changeColormap/index.ts

📝 Walkthrough

Walkthrough

The colormap example now waits for the PT volume to load, configures CT and PT together with modality-specific transfer functions, enables fusion, and renders the combined viewport.

Changes

Fused volume colormap setup

Layer / File(s) Summary
Configure fused CT and PT rendering
packages/tools/examples/changeColormap/index.ts
The example types the viewport, defers setup until the PT volume is loading, applies CT and PET transfer functions to their respective actors, enables fusion, and renders.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant run
  participant CTVolume
  participant PTVolume
  participant VolumeViewport
  run->>CTVolume: create CT volume
  run->>PTVolume: start load
  run->>VolumeViewport: setVolumes with CT and PT actors
  VolumeViewport->>VolumeViewport: apply CT and PET transfer functions
  run->>VolumeViewport: enable fusion and render
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning Context is filled, but Changes & Results, Testing, and Tested Environment are left blank or unchecked. Add a short change summary, before/after results, concrete test steps, and complete OS/Node/browser details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, semantic-release style, and matches the change to the changeColormap example.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/tools/examples/changeColormap/index.ts`:
- Around line 204-215: Update the viewport setup flow around viewport.setVolumes
to await its asynchronous completion before setting fused and calling
renderingEngine.render(), ensuring rendering occurs only after both volume
actors are configured.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 69e4feef-5bf6-421b-9d73-80dcbda3f012

📥 Commits

Reviewing files that changed from the base of the PR and between aaf6d3b and 60b63eb.

📒 Files selected for processing (1)
  • packages/tools/examples/changeColormap/index.ts

Comment thread packages/tools/examples/changeColormap/index.ts
@bionoone
bionoone force-pushed the fix/changeColorMap-example branch from 60b63eb to 849e7ae Compare July 17, 2026 15:10
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.

1 participant