cornerstonejs / cornerstoneWADOImageLoader

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

Cornerstone 3D Image Rendering using TargetBugger #498

Closed jmannau closed 1 year ago

jmannau commented 1 year ago

Hi Team,

I have been building a new viewer with the 3D Beta. I have run into 2 image rendering issues using the WADO loader and C3D.

I have put together a small repo to reproduce these issues https://github.com/jmannau/cornerstone-3d-test. This repo includes 2 tiny projects with the latest versions from NPM of C3D (0.23.0), WadoLoader (4.4.0) and Cornerstone-Core (2.6.1).

These issues appear to be related to the use the targetBuffer https://github.com/cornerstonejs/cornerstoneWADOImageLoader/blob/master/src/imageLoader/createImage.js#L205 as both render the same as the legacy cornerstone if imageFrame.pixelData = typedArray; on line 205 is commented out.

The dicom files that are used for these issues are located https://github.com/jmannau/cornerstone-3d-test/tree/main/test-files

  1. Colour Image (fundus.dcm)

    Screen Shot 2022-12-14 at 2 53 31 pm
  2. Corrupt Frames (oct.dcm)

    Screen Shot 2022-12-14 at 2 51 55 pm

There are a number of frames in this oct that are corrupted. Specifically frame 98

jmannau commented 1 year ago

Thanks @swederik the fix for this is to add

cornerstoneWadoImageLoader.configure({
  useWebWorkers: true,
  /**
   * Required for Cornerstone 3D
   */
  decodeConfig: {
    convertFloatPixelDataToInt: false,
  },
});

I have updated my test repo with this fix and the issue is resolved.