Skip to content
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

[Bug] SEG/RTSTRUCT changes W/L after loading #3410

Closed
03shek opened this issue May 19, 2023 · 11 comments · Fixed by #3560
Closed

[Bug] SEG/RTSTRUCT changes W/L after loading #3410

03shek opened this issue May 19, 2023 · 11 comments · Fixed by #3560
Assignees
Labels
Bug Verified Bug reported, reproducible, and verified.

Comments

@03shek
Copy link

03shek commented May 19, 2023

Describe the Bug

W/L changes after loading a SEG

Steps to Reproduce

  1. Open a study on OHIFv3 demo: https://v3-demo.ohif.org/viewer?StudyInstanceUIDs=1.3.12.2.1107.5.2.32.35162.30000015050317233592200000046

  2. Note the auto W/L=95/35
    image

  3. Drag the SEG into the viewport

  4. Previous W/L has been undone to become W/L=689/315
    image

  5. Open a study on OHIFv3 demo: https://v3-demo.ohif.org/viewer?StudyInstanceUIDs=1.3.6.1.4.1.14519.5.2.1.3671.4754.298665348758363466150039312520

  6. Note the auto W/L in each viewport: A=1048/524; B=3644/1822; C=173/86; D=2400/1300.
    image

  7. Drag the T2 Weighted Axial SEG into viewport A

  8. Previous W/L for viewports A and C have been undone.
    image

The current behavior

W/L changes after loading a SEG

The expected behavior

W/L should not change after loading a SEG

OS

Windows 10

Node version

16.14.0

Browser

Chrome 111.0.0

@03shek 03shek added Awaiting Reproduction Can we reproduce the reported bug? Community: Report 🐛 labels May 19, 2023
@03shek 03shek changed the title W/L changes after loading a SEG[Bug] W/L changes after loading a SEG/RTSTRUCT [Bug] May 19, 2023
@03shek 03shek changed the title W/L changes after loading a SEG/RTSTRUCT [Bug] SEG/RTSTRUCT changes W/L after loading [Bug] May 19, 2023
@03shek 03shek changed the title SEG/RTSTRUCT changes W/L after loading [Bug] [Bug] SEG/RTSTRUCT changes W/L after loading May 25, 2023
@jbocce jbocce added Bug Verified Bug reported, reproducible, and verified. and removed Awaiting Reproduction Can we reproduce the reported bug? labels Jun 21, 2023
@sedghi
Copy link
Member

sedghi commented Jul 3, 2023

I believe this is by design. At first (before loading the SEG or RT) the viewports are StackViewport and in Stack settings we apply the per-image windowlevel, in case of the Brain MR 95/35, and after the SEG is loaded a volume viewport is mounted (since we have 3D segmentations), and for the window level the full volume range is used for calculation of the window level.

@sedghi
Copy link
Member

sedghi commented Jul 3, 2023

actually seems like the window level for the volume viewport is picked from the window level of the middle image in stack viewport.

Image

I think it should use the range, let me look deeper

@sedghi
Copy link
Member

sedghi commented Jul 3, 2023

Ok so here is what happens

We can't really do a range on full volume since we don't have full scalarData to get the min and max, so we are limited to grabbing the range from the middle slice.

  1. We can't carry over the stack viewport current slice window level to the volume since as you can see in some of our examples each slice can have different window level

There are two things that can/should make this better

  1. If the user modifies the window level, we assume that is what user wants so we right now carry it over to the volume viewport (with SEG) with our StateSyncService
  2. If the user specifies a window level in hanging protocol it should prioritize that

@sedghi
Copy link
Member

sedghi commented Jul 3, 2023

Though there was an issue for PT which is solved after this https://github.com/cornerstonejs/cornerstone3D/pull/676/files

@03shek
Copy link
Author

03shek commented Jul 4, 2023

Thanks @sedghi . Yes I believe #1 of the two recommendations you listed above would be more intuitive. #2 would be a workaround if the W/L can't be carried over to the volume viewport.

@sedghi
Copy link
Member

sedghi commented Jul 4, 2023

Number one is already implemented

@03shek
Copy link
Author

03shek commented Jul 4, 2023

Thanks for clarifying. Sorry, for the present implementation of number one on demo, it's only keeping the modified W/L for the viewport that has the SEG loaded, and not any other viewports I had opened with modified W/L. Is it possible to extend the keeping of W/L for the other viewports as well?

@sedghi
Copy link
Member

sedghi commented Jul 4, 2023

Unfortunatelly I don't follow what you are saying, the state sync bw stack and volume viewport is already implemented in master branch you can see here

OHIF-Viewer.webm

@03shek
Copy link
Author

03shek commented Jul 4, 2023

I'm working with the study with multiple series without entering MPR: https://v3-demo.ohif.org/viewer?StudyInstanceUIDs=1.3.6.1.4.1.14519.5.2.1.1706.8374.643249677828306008300337414785

So I have toggled the W/L for each viewport.
image

And then as soon as I load the SEG into Viewport C (since series 5 is the series the SEG was drawn on), the W/L for viewport C has been kept (like you said), but viewports A and B have defaulted again.
image

Viewports A and B should be kept as the user had modified them

@sedghi
Copy link
Member

sedghi commented Jul 4, 2023

I see now what you mean, ok let me investigate

@james-hanks
Copy link

PR #3560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Verified Bug reported, reproducible, and verified.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants