Repository navigation
Conversation
ProbeTool overwrote ijk[2] with the stack image index before reading the value through the single-image voxelManager, so every slice except the first returned undefined and no text box was drawn. Read the value with the image-space index and keep the stack index for display only. Regression from 7c91439 (cornerstonejs#2621). Fixes cornerstonejs#2967.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughProbeTool now preserves the rounded image-space voxel index for non-ECG voxel lookups on stack viewports. A new test checks the probe value and stack index on the second image in a two-image stack. ChangesStack Probe Voxel Lookup
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change addresses Probe values on later stack images, and no actionable merge-blocking issue remains after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Context
Fixes #2967
On a
StackViewport,ProbeTooldraws the handle but no text box on any image other than the first one:cachedStats[targetId].valueisundefined._calculateCachedStatsoverwritesijk[2]withviewport.getCurrentImageIdIndex()(for display) and then reads the value withvoxelManager.getAtIJKPoint(ijk). For a stack,getImageData().voxelManagerholds a single image ([w, h, 1]), so any k ≥ 1 is out of range. This is a regression from 7c91439 (#2621); up to 83608ba the value was read beforeijk[2]was overwritten.Changes & Results
ProbeTool: read the value (US and default branches) with the image-space index;ijk[2]is still replaced with the stack index for display, socachedStats.indexis unchanged.ProbeTool_test.js: new case that sets a two-image stack at index 1 and expects the value on the bar (255) andindex[2] === 1. All existing Probe tests usesetStack([imageId], 0), which is why this was not caught.Before: the new test fails with
Expected undefined to be 255.After: all 7 Probe tests pass.Testing
Or manually: load a multi-image series in a stack viewport, scroll past the first image and place a probe — the text box now shows the index and value.
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals. (no public API change)
Tested Environment
Summary by CodeRabbit