Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

fix(viewport-sync): Enable re-sync image slices in a different position when needed

Open mateusfreira opened this issue 11 months ago • 3 comments

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. noted

Testing

I Have demonstrated this Bug on a video available in youtube also show the fix

Screenshot 2024-03-09 at 11 14 04 AM

(Watch from 2:20:50 to 2:25:52 where I demo the Bug and the fix after my code change)

Checklist

PR

  • [x] My Pull Request title is descriptive, accurate and follows the semantic-release format and guidelines.

Code

  • [x] My code has been well-documented (function documentation, inline comments, etc.)

Public Documentation Updates

  • [x] The documentation page has been updated as necessary for any public API additions or removals.

Tested Environment

  • [x] OS: macOS apple M1
  • [x] Node version:
  • v18.17.0
  • [x] Browser:
  • Arc Chromium Engine Version 119.0.6045.199
  • Chrome Version 122.0.6261.112 (Official Build) (arm64)

mateusfreira avatar Mar 09 '24 14:03 mateusfreira

Deploy Preview for ohif-dev canceled.

Name Link
Latest commit 273b9d10a3ec250b91219cfae947a9c0903685f4
Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/6626b13166110c00088518d0

netlify[bot] avatar Mar 09 '24 14:03 netlify[bot]

Deploy Preview for ohif-platform-docs canceled.

Name Link
Latest commit 273b9d10a3ec250b91219cfae947a9c0903685f4
Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/6626b1316d1641000892cc34

netlify[bot] avatar Mar 09 '24 14:03 netlify[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 44.41%. Comparing base (8a335bd) to head (273b9d1). Report is 343 commits behind head on master.

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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 09 '24 14:03 codecov[bot]

I still need to test this, @mateusfreira can you provide reproducible steps to follow that shows the bug?

sedghi avatar Apr 22 '24 18:04 sedghi