OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.12k stars 3.29k forks source link

[Bug] Hounsfield measurements are incorrect when using useNorm16Texture(int16Array) - Volume(MPR Layout) #4296

Closed Enriquez-Johnmark closed 1 month ago

Enriquez-Johnmark commented 2 months ago

Describe the Bug

I have observed some unexpected behavior when using tools that measure Hounsfield units, such as the circle or ellipse tool. In a cone beam scan, the Hounsfield value in air or empty space should be -1000. However, I noticed that when useNorm16Texture is enabled, the value reads -7000. Disabling useNorm16Texture restores the expected value, which I believe should be -1000.

Additional Notes: When I refresh the browser or study, the calculation becomes incorrect again.

Steps to Reproduce

  1. Enabled useNorm16Texture in your config files: useNorm16Texture : true
  2. Then select MPR mode.
  3. Use any tool such as the circle, freehand or ellipse and measure the black space/air/empty space in the scan.

The current behavior

So the current behavior is inaccurate, the value reads -7000. I'm not using preferSizeOverAccuracy in my config file. I only use the following settings in my config file:

useSharedArrayBuffer: true,
  useNorm16Texture: true

When useNorm16Texture is enabled, the volume array object is int16Array. When it is disabled, I think it is Float32Array. See image below:
enabled-useNorm16Texture

Using int16Array int16ArrayObject

The expected behavior

It should return a correct Hounsfield value. which I believe should be -1000. This is the correct value, see image below: Using Float32Array disabled-useNorm16Texture

Important Note: We're utilizing useNorm16Texture to manage large volumes for Multi-Planar Reconstruction (MPR) and reduce memory footprints, as our scans are quite large. Set-up: Orthanc + OHIF

OS

OS X 10.15.7

Node version

v22.4.1

Browser

Chrome 126.0.6478.128