Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

[Bug] TMTV PET window level not preserved on viewport reset

Open Devu-trenser opened this issue 5 months ago • 1 comments

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

  1. Launch the viewer with the following URL:
  2. https://viewer.ohif.org/tmtv?StudyInstanceUIDs=1.2.840.113619.2.290.3.3767434740.232.1619607454.466
  3. Observe the window level values in the PET viewport.
  4. Press the SPACE key to reset the viewport.
  5. 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

Devu-trenser avatar Jun 18 '25 07:06 Devu-trenser

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

Devu-trenser avatar Jun 18 '25 08:06 Devu-trenser

It's not about the window level; rather, the PT viewports are all inverted. So, when we reset properties, they become non-inverted.

sedghi avatar Oct 06 '25 13:10 sedghi

I'm gonna close this in favor of this https://github.com/OHIF/Viewers/issues/5372

sedghi avatar Oct 06 '25 13:10 sedghi