fix(planar): map dynamic-volume flattened indices to their group-local slice#2801
Merged
Conversation
…l slice getVolumeImageIdIndexWorldPoint assumed a one-to-one imageId to k-slice mapping, but StreamingDynamicImageVolume flattens its imageIds across all dimension groups while dimensions[2] is the slice count of a single group. A referenced image or explicitly carried initial slice from any later dimension group therefore had a flattened index of at least dimensions[2], and the clamp sent every such image to the final slice. Convert the flattened index through the volume's own flatImageIdIndexToImageIdIndex mapping (duck-typed; static volumes have no such method and pass through unchanged) before resolving the IJK world center.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe planar slice world-point calculation now maps flattened dynamic-volume image indices to group-local slice indices before computing coordinates. A Jest test covers both remapped and unchanged indices. ChangesDynamic volume world-point mapping
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
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.
Context
Follow-up to #2800.
getVolumeImageIdIndexWorldPointassumes a one-to-one imageId-to-k-slice mapping, butStreamingDynamicImageVolumeflattens its imageIds across all dimension groups whiledimensions[2]is the slice count of a single group. A referenced image (navigation) or an explicitly carried initial slice from any later dimension group therefore has a flattened index of at leastdimensions[2], and the clamp sent every such image to the final slice instead of its group-local k.Changes & Results
flatImageIdIndexToImageIdIndexmapping (the k axis repeats per dimension group) before resolving the IJK world center. Duck-typed: static volumes have no such method and pass through unchanged, keeping fix(planar): anchor imageId-addressed slices at their exact IJK world center #2800's behavior identical for 3D volumes.referencedImageId/ snapped plane points, and the mount-timeinitialImageIdIndex) route through this shared helper, so one conversion covers both.Testing
npx jest(packages/core): 31 suites, 535 passed.pnpm --filter @cornerstonejs/core run build:esmclean.Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Summary by CodeRabbit
Bug Fixes
Tests