cornerstonejs / cornerstone3D

Cornerstone is a set of JavaScript libraries that can be used to build web-based medical imaging applications. It provides a framework to build radiology applications such as the OHIF Viewer.
https://cornerstonejs.org
MIT License
476 stars 250 forks source link

[Bug] VOI LUT images not rendered correctly #938

Open abustany opened 7 months ago

abustany commented 7 months ago

Describe the Bug

Images with a VOI LUT don't get their levels computed correctly when rendering, so they display incorrectly.

Cornerstone3D version: 1.36.3 This works as expected when using Cornerstone JS 2.6.1 (wado image loader 3.3.2)

Attached is a file which demonstrates the issue. hand.dcm.zip

Correct rendering

hand

Current rendering

(ignore the green annotation in the top right corner)

image

Tags relevant to VOI LUT

(0028,3010) SQ (Sequence with undefined length #=1)     # u/l, 1 VOILUTSequence
  (fffe,e000) na (Item with undefined length #=6)         # u/l, 1 Item
    (0028,3002) US 16384\0\14                               #   6, 3 LUTDescriptor
    (0028,3003) LO [User Selection]                         #  14, 1 LUTExplanation
    (0028,3006) OW 0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000... # 32768, 1 LUTData
    (07a3,0010) LO [ELSCINT1]                               #   8, 1 PrivateCreator
    (07a3,109d) DS [2332]                                   #   4, 1 Unknown Tag & Data
    (07a3,109e) DS [1149]                                   #   4, 1 Unknown Tag & Data

Steps to Reproduce

  1. Load an image with a VOI LUT

The current behavior

The image gets rendered with incorrect levels

The expected behavior

The image renders with correct levels. This used to work in the "old" cornerstone.

OS

Linux

Node version

18.18.2

Browser

Chromium 119.0.6045.159, Firefox 120.0b9

sedghi commented 6 months ago

Unfortunately, we currently do not have support for using the predefined VOI LUT in DICOM.

abustany commented 6 months ago

Do you have an idea how hard it’d be to port the logic from the “old” cornerstone? Just to know if it’s something I, as a total outsider, could consider doing…

sedghi commented 6 months ago

Hmm, was it working in the old cs?

abustany commented 6 months ago

Yup, there it worked without doing anything special

AnnaKuduk commented 3 months ago

Hello, Are there any plans to implement a predefined VOI LUT in DICOM?

AnnaKuduk commented 3 months ago

Hmm, if I switch to setUseCPURendering(true) => Then it works fine. I'm trying to make a workaround - I'm trying to dynamically change the rendering engine and viewport - but it doesn't seem to work :( - no success