Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CT Image GPU renderer adds lot of white noise #225

Open
toropok opened this issue Sep 26, 2022 · 20 comments
Open

CT Image GPU renderer adds lot of white noise #225

toropok opened this issue Sep 26, 2022 · 20 comments

Comments

@toropok
Copy link

toropok commented Sep 26, 2022

Hi,

For our custom DICOM viewer we use following libs:

"@cornerstonejs/core": "^0.16.3",
"@kitware/vtk.js": "24.18.7",
"wslink": "^1.8.2",
"gl-matrix": "^3.4.3”,
"cornerstone-wado-image-loader": "^4.2.1"

Unexpetedly cornerstone adds a lot of white to images while rendering (except first image in series):

Screen.Recording.2022-09-26.at.10.25.24.mov

But if you're setting CPU render only - this "white" effect dissappears

cornerstone.setUseCPURendering(true)
Screen.Recording.2022-09-26.at.10.48.08.mov

What may cause that?

regards,
--leo

@toropok toropok changed the title CT Image GPU render issue adds lot of white noise CT Image GPU renderer adds lot of white noise Sep 26, 2022
@md-prog
Copy link
Contributor

md-prog commented Nov 14, 2022

@toropok This might have been fixed by 0.16.8

@toropok
Copy link
Author

toropok commented Nov 16, 2022

@md-prog Thanks! will try it asap

@toropok
Copy link
Author

toropok commented Nov 22, 2022

@md-prog

This might have been fixed by 0.16.8

unfortunately it doesn't help

@md-prog
Copy link
Contributor

md-prog commented Nov 22, 2022

@toropok Indeed, it's unfortunate. It resolved mine.

@md-prog
Copy link
Contributor

md-prog commented Nov 22, 2022

@toropok Is there any chance you can post the anonymized DICOM file for us to test and fix?

wayfarer3130 added a commit that referenced this issue Jan 20, 2023
* feature(dcmjs): Adding cobb-angle support

* feat(dcmjs): Add adapter for CobbAngle, and add description and location mapping

* fix(dcmjs): Fix the arrow, cobb and length to all get the description/group in the same way

* feat(dcmjs):Add adapters for FreehandRoi, RectangleRoi and Angle

* fix(dcmjs): Fixed the angle and rectangle cornerstone adapters

* fix(dcmjs): Store an optional second point for the arrow annotation
The point TID300 normally takes 1 point, but seems to be ok if an extra
one is added for the source of the indicator.

* fix(dcmjs):Use the SCT codes rather than SRT as requested
@jlopes90
Copy link
Contributor

jlopes90 commented Mar 1, 2023

It's really my problem.

image

I tested using cornerstone.setUseCPURendering(true) and it worked.

A very strange thing, I've been testing example "DICOM P10 from local file system" the result was right. I don't see what the difference is.

image

@medicalconnections
Copy link
Contributor

I am having the same issue and could provide an anonymized study that reproduces it. I think it has to do with the way the windowing values are used but unsure. I tried the CPU rendering and the images will render correctly (but breaks some other things so I would like to stick to GPU rendering).

The odd thing is that when I load only 1 canvas, I am able to scroll through the images and it gets rendered correctly.
image

NOTE: The thumbnails are bitmaps so they are not cornerstone canvases.

As soon as another canvas comes in play, it will become white like this:
image

The cached images (when it was only 1 canvas active and I scrolled through few images) are actually loading fine and only the newly rendered images become white:
image

It really feels like one of the group 28 attributes is causing this issue and only for GPU rendering.
Hope this can be fixed.

@sedghi
Copy link
Member

sedghi commented May 5, 2023

can you try again now, I moved the canvas rendering to gpu, but the API has changed to accept an object

@sgielen
Copy link
Contributor

sgielen commented Oct 17, 2023

For me, two issues were causing problems with window levels. I will file them separately, but for future reference I'll put a summary here:

  cornerstoneDICOMImageLoader.webWorkerManager.initialize({
    maxWebWorkers: concurrency,
    startWebWorkersOnDemand: true,
    taskConfiguration: {
      decodeTask: {
        initializeCodecsOnStartup: false,
      },
    },
  });

These issues are filed separately as #887 and #888, and might be related to this issue.

@sedghi
Copy link
Member

sedghi commented Oct 18, 2023

Could you kindly provide the data if it has been anonymized and you can confirm that there is no patient health information present in any of the headers or embedded within the pixel data?

@mivan08
Copy link

mivan08 commented Nov 6, 2023

The issues is occurring from me as well.
Hope to fix this issue asap.

@sedghi
Copy link
Member

sedghi commented Nov 6, 2023

Could you kindly provide the data if it has been anonymized and you can confirm that there is no patient health information present in any of the headers or embedded within the pixel data?

@mivan08
Copy link

mivan08 commented Nov 6, 2023

https://drive.google.com/file/d/1XdpbPhwQQH3_3QiKiVmZ_QevRK2ECyFO/view?usp=sharing

Here is the images that I tried.

@mivan08
Copy link

mivan08 commented Nov 6, 2023

image
image

@fafa92
Copy link

fafa92 commented Nov 7, 2023

Any solution for this will be appreciated!

@sgielen
Copy link
Contributor

sgielen commented Nov 14, 2023

I've filed #887 and #888 as possible root causes for this issue, including reproduction cases and a workaround.

@dxhsmwqcwelllee
Copy link

dxhsmwqcwelllee commented May 13, 2024

use cpu render

private _resizeUsingCustomResizeHandler(
customRenderingViewports: StackViewport[],
keepCamera = true,
immediate = true
) {
// 1. If viewport has a custom resize method, call it here.
...
// 3. Reset viewport cameras
customRenderingViewports.forEach((vp) => {
const prevCamera = vp.getCamera();
vp.resetCamera();

  if (keepCamera) {
    vp.setCamera(prevCamera);
  }
});

// 2. If render is immediate: Render all
if (immediate === true) {
  this.render();
}

}

private getCameraCPU(): Partial {
const { metadata, viewport } = this._cpuFallbackEnabledElement;
const { direction } = metadata;
...
}

there is an error: Cannot read properties of undefined (reading 'direction') @sedghi

@dxhsmwqcwelllee
Copy link

dxhsmwqcwelllee commented May 13, 2024

use cpu render. Enums.Events.VOI_MODIFIED Will not trigger the first time @sedghi

@linear linear bot changed the title CT Image GPU renderer adds lot of white noise CT Image GPU renderer adds lot of white noise Nov 6, 2024
Copy link
Member

sedghi commented Nov 14, 2024

Can you check the latest OHIF viewer, which now includes Cornerstone 3D 2.0?

Here are the migration guides:

Try OHIF locally: https://viewer-dev.ohif.org/localbasic
Try Cornerstone3D 2.0 locally: https://www.cornerstonejs.org/live-examples/local.html

https://docs.ohif.org/migration-guide/3p8-to-3p9/

Copy link
Member

sedghi commented Nov 25, 2024

Any update here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants