-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(viewport-sync): Enable re-sync image slices in a different position when needed #3984
fix(viewport-sync): Enable re-sync image slices in a different position when needed #3984
Conversation
✅ Deploy Preview for ohif-dev canceled.
|
✅ Deploy Preview for ohif-platform-docs canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3984 +/- ##
==========================================
- Coverage 46.23% 44.41% -1.83%
==========================================
Files 78 80 +2
Lines 1276 1333 +57
Branches 312 327 +15
==========================================
+ Hits 590 592 +2
- Misses 548 588 +40
- Partials 138 153 +15 ☔ View full report in Codecov by Sentry. |
@@ -152,6 +154,8 @@ export default class SyncGroupService { | |||
return; | |||
} | |||
|
|||
this.unRegisterSpatialRegistration(synchronizer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we filter and only do this for image slice sync synchronizer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, @sedghi; I sure can do it; Must does not seem to exists a way to differentiate the synchronizer other than the name.
Is checking the name of the sincronizer enough for this situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @sedghi. I have updated the code, and it is working as expected now. Let me know if you think I should improve anything else.
4681557
to
592d7a6
Compare
592d7a6
to
919602b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I still need to test this, @mateusfreira can you provide reproducible steps to follow that shows the bug? |
…/bug/unable-to-re-sync-image-slice-sync-tool
…/github.com/mateusfreira/Viewers into pr/mateusfreira/bug/unable-to-re-sync-image-slice-sync-tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it and worked great, Lovely fix, thanks a lot!
Context
Changes & Results
This is a specific change SyncGroupService.ts to clean up the previously registered
spatialRegistrationMetadataProvider
by cornerstone.js.When creating the correlation matrix among the viewports cornerstone.js for performance reasons, it caches the matrix using the
spatialRegistrationMetadataProvider
, but when the tool is disabled, it does not clean it up. This makes it impossible to re-sync the viewports to a different point if the user wants to.This is a common use case when radiologists are comparing 2 studies (one current and one prior) and by mistake, enable the sync on a non-optimal point and want to disable it, scrool one of the viewports to the correct point and then lock the scroll again.
Here Cornestone calculateViewportsSpatialRegistration and it never gets cleaned up.
Testing
I Have demonstrated this Bug on a video available in youtube also show the fix
(Watch from 2:20:50 to 2:25:52 where I demo the Bug and the fix after my code change)
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
macOS apple M1