fix(synchronization): Slice Synchronization Fails for Series with Mismatched FOR - #2825
Open
arul-trenser wants to merge 1 commit into
Open
fix(synchronization): Slice Synchronization Fails for Series with Mismatched FOR#2825arul-trenser wants to merge 1 commit into
arul-trenser wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthrough
ChangesViewport spatial registration
Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 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 |
|
@sedghi Could you please take a look at this PR? |
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
When two viewports have different
FrameOfReferenceUID, scroll synchronization falls back tocalculateViewportsSpatialRegistration()to align them usingimagePositionPatientThis fallback was calling
viewport.getSliceIndex()and passing the returned slice number as theimageIdtometaData.get(imagePlaneModule, imageId). Since a slice index is not a validimageId, the metadata lookup returned undefined, so the spatial registration was silently skipped, breaking scroll sync whenever viewports belonged to different frames of reference. Sync only appeared to work whenFrameOfReferenceUIDwas identical (or empty/undefined on both sides), because that path bypasses the fallback entirely.The PR is incorporated by FlyWheel.io.
Fixes: #2762
Changes & Results
File changed:
calculateViewportsSpatialRegistration.tsviewport.getSliceIndex()withviewport.getImageIds()[0]to get the imageId of each viewport.imageIddirectly tometaData.get('imagePlaneModule', imageId), instead of the slice index.Result:
imagePlaneModulemetadata now resolves correctly for both viewports, so the translation betweenimagePositionPatientvalues is calculated properly, and scroll synchronization works again for viewports with mismatchedFrameOfReferenceUID.Before:
2762-before.mp4
After:
2762-after.mp4
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Summary by CodeRabbit