cornerstonejs / cornerstoneWADOImageLoader

[DEPRECATED] DICOM WADO Image Loader for the cornerstone library
MIT License
285 stars 264 forks source link

Inconsistent display of RGB + 16bits #306

Open malaterre opened 4 years ago

malaterre commented 4 years ago

The WADO example has an inconsistent display depending on the transfer syntax even though this is a lossless transformation.

Here is what I get for the following DICOM DataSet:

image

Here is how they should looks like:

image

Zip file:

issue306.zip

dannyrb commented 4 years ago

@malaterre, the more info, tests, etc. that you can provide here the better. These issues traditionally take a while to track down, troubleshoot, and fix -- we don't have much funding to dedicate to working through these issues from start-to-finish. If it becomes a "no-brainer" to fix because we have enough information to make this easy to complete compared to the value of the fix, the easier it is to prioritize with our limited resources.

malaterre commented 4 years ago

@dannyrb I believe this is a no-brainer. I gave a zip with all the combination, if you compare the code path of the RLE against the one in JPEG LSyou should see quickly what is so different. My guess is that you are doing somewhere : if bits-allocated == 16 then, which should be if bits-allocated === 16 and sample-per-pixel === 1 then. 2cts

malaterre commented 4 years ago

@dannyrb That coe section does not look right:

It should read:

          if (this.numBytes === 1) {
              if (this.numComp === 3) {
                  this.getter = this.getValueRGB;
                  this.setter = this.setValueRGB;
                  this.output = this.outputRGB;
              } else {
                  this.getter = this.getValue8;
                  this.setter = this.setValue8;
                  this.output = this.outputSingle;
              }
          } else {
              if (this.numComp === 3) {
                  this.getter = this.getValueRGB16;
                  this.setter = this.setValueRGB16;
                  this.output = this.outputRGB16;
              } else {
              this.getter = this.getValue16;
              this.setter = this.setValue16;
              this.output = this.outputSingle;
              }
          }