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

[Bug] Image does not rendered in proper way (GPU rendering) #985

Open
Max-Kharitonov opened this issue Jan 5, 2024 · 10 comments
Open

[Bug] Image does not rendered in proper way (GPU rendering) #985

Max-Kharitonov opened this issue Jan 5, 2024 · 10 comments
Labels
bug verified Something isn't working, verified by maintainers

Comments

@Max-Kharitonov
Copy link

Describe the Bug

In case if we are using CPU rendering it works fine, but in case GPU this image inverted.
Please see attached anonimized file
DICOM sample Issue with Invertion.zip

Steps to Reproduce

run GPU rendering
image

run CPU rendering
image

The current behavior

Image inverted and not rendered in proper way

The expected behavior

Image should be rendered in the correct way and the result should not depend on the rendering type.

OS

Windows 10, Mac os

Node version

v18.14.1

Browser

Chrome 120.0.6099.131

@sedghi
Copy link
Member

sedghi commented Jan 10, 2024

old cornerstone was rendering it correctly in and OHIF v2
CleanShot 2024-01-10 at 09 07 48

@sedghi sedghi added the bug verified Something isn't working, verified by maintainers label Jan 10, 2024
@Max-Kharitonov
Copy link
Author

@sedghi any updates?

@sedghi
Copy link
Member

sedghi commented Jan 12, 2024

No not yet

@tuongleit
Copy link

Hi @sedghi , Our customer is facing this issue, Would your team please help to check that or any clue we can address?

@Max-Kharitonov
Copy link
Author

Max-Kharitonov commented Jan 23, 2024

@sedghi

could this issue related to function toLowHighRange(
  windowWidth: number,
  windowCenter: number
): {
  lower: number;
  upper: number;
} {
  const delta = 0.001; // small value to prevent zero width
  const lower = windowCenter - 0.5 - (windowWidth - 1) / 2;
  let upper = windowCenter - 0.5 + (windowWidth - 1) / 2;

  // upper and lower should be non equal (upper should be bigger than lower)
  if (upper - lower < delta) {
    upper = lower + delta;
  }
  return { lower, upper };
}

export { toWindowLevel, toLowHighRange };

Upper and lower should be non equal (upper should be bigger than lower).
and for this image we have
Window Width: 1
Window Center: -2

so as a result lower === upper === -2.5

@s2ramana
Copy link

The display is still not perfect with the change suggested by @Max-Kharitonov, but it is a lot better. The issue is that the vtk colorTransferFunction doesn't seem to correctly deal with the case when the window width is set to 1 (threshold value) or we are encountering a rounding issue.

@sedghi
Copy link
Member

sedghi commented Feb 20, 2024

@s2ramana I fixed some issue with window level recently can you check again?

@s2ramana
Copy link

@sedghi which PR was this changed made in?

@Max-Kharitonov
Copy link
Author

@sedghi still reproducible

@Max-Kharitonov
Copy link
Author

@sedghi could you please take a look?
#1135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug verified Something isn't working, verified by maintainers
Projects
None yet
Development

No branches or pull requests

4 participants