Distorted image stack after update from 0.31.2 to current 1.2.4

Describe Your Question

After updating cornerstonejs-core and cornerstonejs-tools to the latest 1.2.4 I’m seeing a distorted image when viewing an image stack.

What steps can we follow to reproduce the bug?

  1. Use cornerstonejs version 0.31.2
  2. Image stack renders fine
  3. Use cornerstonejs version 1.2.4 (or older)
  4. Image stack renders broken / distorted

After some more research I found out that the rendering issue is introduced with version 0.44.0 where the default image loader was changed to the DICOM loader.

We are displaying a stack of PNG images using the cornerstone-web-image-loader.

Any hints to the cause of the issue would be highly appreciated. :pray:

Hello @stemps and welcome to the community forum.

Would it be possible for you to send along an anonymized version of the DICOM files you are trying to view? If so then that would be great.

Hi @jbocce,

thanks for the quick reply. I’m attaching an anonymized (blurred) image. I tested with this image and the distortion effect happens there as well.

After some more testing I found out that the issue seems GPU rendering related. When forcing CPU rendering the images renders fine.

Btw… I also ran into a separate issue with the zoom-tool in CPU rendering mode, which I’m happy to report separately. Where’s the prefered place for reporting issues like this? Github or this community forum?

distortion

I provided an example project on github (branch distorted-image-stack) that reproduces the issue: GitHub - stemps/cornerstonejs-playground at distorted-image-stack

run npm install and npm run start and open localhost port 8080.

You can uncomment cornerstonejs-playground/src/index.js at 8d9b266099ee077349f23e2118ba702ac621938d · stemps/cornerstonejs-playground · GitHub to force cpu rendering to compare.

Thanks @stemps for all that you provided.

I was able to confirm the distorted image problem.

We typically recommend NOT using CPU rendering. So feel free to log an issue, but it may not get prioritized.

To answer your question about reporting bugs. There is nothing wrong with first asking your question or presenting your problem here. But it is also perfectly fine to go directly to logging an issue on GitHub, especially when you have the issue reproduction steps you have provided here.

So if you would be so kind as to log these two issues, then what would greatly be appreciated. Might be best to provide links from the issues to this thread and vice versa.

Thanks so much.

Github issue: [Bug] Distorted PNG in image stack in 0.44.0 and newer · Issue #662 · cornerstonejs/cornerstone3D · GitHub

Hi @jbocce,

You mentioned

We typically recommend NOT using CPU rendering.

Could you elaborate why CPU rendering is not supported and what the risks of using CPU rendering are?

I’m asking because in one view of our application we render a long grid view of image stacks (100+ stacks) and we observed that this page takes very long (10+ seconds) to render and there seem to be race conditions in the JS code(TypeError: target argument of Proxy must be an object, got null).

However, when I force CPU rendering the page renders reasonable quickly and without errors. What would be your recommendation for us to go forward with this view?

Simon

You can’t have volume rendering with CPU. So basically you are tied to stack viewing and no MPR