-
-
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(state synchronization): SEG and RT viewports should keep their before hydration voi #3560
Conversation
feat(presentation update): Consolidate storePresentation state updates This commit consolidates the storePresentation state updates for the OHIFCornerstoneRTViewport and OHIFCornerstoneSEGViewport components in the cornerston-dicom-rt and cornerstone-dicom-seg extensions, respectively. The storePresentation state is now updated at relevant points during the component lifecycle, ensuring that the state is stored correctly when necessary. No special consideration has been made for the rest of the changes in the codebase.
✅ Deploy Preview for ohif-platform-docs canceled.
|
✅ Deploy Preview for ohif-dev canceled.
|
Codecov Report
@@ Coverage Diff @@
## master #3560 +/- ##
=======================================
Coverage 42.81% 42.81%
=======================================
Files 80 80
Lines 1448 1448
Branches 340 340
=======================================
Hits 620 620
Misses 663 663
Partials 165 165 Continue to review full report in Codecov by Sentry.
|
I started testing these changes with regards to the steps outlined in #3410. And the way I read that issue, there are TWO problems. The first problem in outlined in steps 1-4 and the second problem in steps 5-8. The second problem appears to be resolved with these changes. However, the first problem appears to remain. Namely...
Or is this expected? |
@@ -120,6 +121,7 @@ Here are a list of some options available: | |||
if auth headers are used, a preflight request is required. | |||
- `maxNumRequests`: The maximum number of requests to allow in parallel. It is an object with keys of `interaction`, `thumbnail`, and `prefetch`. You can specify a specific number for each type. | |||
- `showLoadingIndicator`: (default to true), if set to false, the loading indicator will not be shown when navigating between studies. | |||
- `supportsWildcard`: (default to false), if set to true, the datasource will support wildcard matching for patient name and patient id. |
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.
Does it make sense to further specify that this is for study level (QIDO) search?
It is not a problem and it is by design. If you change the w/l it will keep it for SEG, if not it will reset it to volume which is intended |
platform/core/src/services/ViewportGridService/getPresentationIds.ts
Outdated
Show resolved
Hide resolved
@@ -160,6 +168,8 @@ function OHIFCornerstoneSEGViewport(props) { | |||
viewportIndex, | |||
segDisplaySet, | |||
}).then(isHydrated => { | |||
storePresentationState(); |
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.
Why do we store the presentation after/once the SEG is hydrated? I would think that would be too late with respect to fixing issue #3410, but maybe this is for something else. This comment applies to other similar changes in this PR.
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.
I added comment, sorry it was not clear you are right
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.
Sorry, but I am still a bit confused. The then
callback is called AFTER the SEG is hydrated, correct? If so, then the first line of the comment you added seems a bit contradictory. But maybe I am missing something.
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 your changes. However, considering the issue seemed fixed even before the most recent changes, I am not sure if the changes actually contribute to the fix. Just wanted to mention this.
Ok. Thanks. I have verified that it keeps the changed w/l for the SEG. |
See my comments. |
Hmmm. Is this behaviour expected? ScreenHunter.Aug.08.14.07.mp4 |
Yes it is correct, since you chose the second DS but the SEG is on the third DS. |
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.
Approved.
@@ -256,7 +230,9 @@ const OHIFCornerstoneViewport = React.memo(props => { | |||
setImageScrollBarHeight(); | |||
|
|||
return () => { | |||
storePresentation(); | |||
commandsManager.runCommand('storePresentation', { | |||
viewportIndex, |
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.
Please use viewportId throughout - we are trying to remove references to viewportIndex generally.
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.
that is another big PR that I will care later
@@ -616,6 +617,35 @@ function commandsModule({ | |||
); | |||
toolGroup.setToolEnabled(ReferenceLinesTool.toolName); | |||
}, | |||
storePresentation: ({ viewportIndex }) => { |
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.
This is much cleaner to have in the commandsModule to allow re-use.
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.
Generally good with the changes. Might change the viewportId, but will leave that up to you to decide.
fixes #3410
Context
As described in the issue above, when having SEG or RT viewport, and the user clicks on the load/hydrate, the old
viewport VOI LUT is not preserved and is removed. The reason for this is that this action is an "update"
action, and we only storePresentation state on "set" actions (during disable element).
Changes & Results
if in the same viewportIndex and displaySetInstanceUid we are requesting a new presentation id)
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment