Viewers
Viewers copied to clipboard
[Bug] TMTV PET window level not preserved on viewport reset
Describe the Bug
For a specific PET data in TMTV mode the window level value is changing on resetting viewport using hotkey SPACE
Data: https://viewer.ohif.org/tmtv?StudyInstanceUIDs=1.2.840.113619.2.290.3.3767434740.232.1619607454.466
Similar issue: https://github.com/cornerstonejs/cornerstone3D/issues/2104
https://github.com/user-attachments/assets/392bcb44-1b55-4234-81b3-39ca1008bc81
Steps to Reproduce
- Launch the viewer with the following URL:
- https://viewer.ohif.org/tmtv?StudyInstanceUIDs=1.2.840.113619.2.290.3.3767434740.232.1619607454.466
- Observe the window level values in the PET viewport.
- Press the SPACE key to reset the viewport.
- Observe the window level values again in the PET viewport.
The current behavior
Initial window level (VOI) values are not preserved after viewport reset
The expected behavior
VOI values should be preserved to their initial state after a viewport reset
OS
Ubuntu
Node version
22
Browser
Chrome 134.0.0
@sedghi It seems the issue is caused by a mismatch in the VOI range applied initially through the hanging protocol attribute getPTVOIRange. Here, the VOI range is set to { lower: 0, upper: 4 } (windowWidth: 5, windowCenter: 2.5,), calculated using the toLowHighRange function.
However, after resetting the viewport, the VOI range is replaced with the default volume VOI range { lower: 0, upper: 5} (windowWidth: 6, windowCenter: 2.5,), as seen in setDefaultVolumeVOI.ts.
It's not about the window level; rather, the PT viewports are all inverted. So, when we reset properties, they become non-inverted.
I'm gonna close this in favor of this https://github.com/OHIF/Viewers/issues/5372