cornerstonejs / cornerstone3D

Cornerstone is a set of JavaScript libraries that can be used to build web-based medical imaging applications. It provides a framework to build radiology applications such as the OHIF Viewer.
https://cornerstonejs.org
MIT License
538 stars 278 forks source link

Invert function not working some CR images #764

Open idemopacs opened 1 year ago

idemopacs commented 1 year ago

Describe the Bug

I am facing issue with Invert / Reset function with some of CR images. When I apply the invert function to the image with below code , image is getting invert const { invert } = viewport.getProperties(); viewport.setProperties({ invert: !invert }); viewport.render();

but after that if I reset viewport properties , Invert property of image is not getting reset viewport.resetCamera();
viewport.resetProperties();

After loading image in viewport if I check the Invert property of image , I am getting value as 'true'. const { invert } = viewport.getProperties();

Steps to Reproduce

CRInvertIssue.zip

  1. Copy attached files to tools example folder 'tools\examples\local'.
  2. run example 'yarn run example local'
  3. Load the attached image
  4. Click Invert button
  5. Click Reset button

The current behavior

After clicking Invert button image is getting inverted but after clicking Reset button Invert property of image is not getting reset

The expected behavior

Invert property of Image should be reset.

OS

Windows 10

Node version

v16.17.1

Browser

Chrome 114.0.5735.134

idemopacs commented 1 year ago

@jbocce , have you checked this issue?

Thanks idemopacs

jbocce commented 1 year ago

Possibly related to https://community.ohif.org/t/images-gets-inverted-when-resetting-zoom/1000?

idemopacs commented 10 months ago

@jbocce , @sedghi

I have upgraded cornerstoneJS from V1.19.1 to latest V1.27.1 and this issue is reappearing. Please check the example attached in above post with latest V1.27.1

Thanks

jbocce commented 10 months ago

@idemopacs, thanks for bringing this to our attention. I have also just confirmed that it is indeed reappearing..

Max-Kharitonov commented 10 months ago

@jbocce I this issue with Photometric Interpretation. So MONOCHROME1 should be inverted by deafult. and it looks that when we are reseting viewport stackviewport doesn`t care about it. https://dicom.innolitics.com/ciods/rt-dose/image-pixel/00280004

jbocce commented 10 months ago

@Max-Kharitonov, are you saying that this is still an issue for you? If so, if possible, please provide fully anonymized DICOM data that demonstrates the problem. Thank you.

Max-Kharitonov commented 10 months ago

1out.json @jbocce

jbocce commented 10 months ago

Thanks @Max-Kharitonov. Could you please provide the actual anonymized DICOM file instead? Thanks.