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

pixel normalization #1135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Max-Kharitonov
Copy link

@Max-Kharitonov Max-Kharitonov commented Mar 1, 2024

Context

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

Changes & Results

Such images have a pixel range of [negative, negative]. Therefore, we are modifying the pixels per LUT to normal values [0, 255]. After these manipulations, everything renders fine.

Testing

Try to open stackViewport with this series using GPU rendering:
DICOM.sample.Issue.with.Invertion (1).zip

Copy link

netlify bot commented Mar 1, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 9a9c5ba
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/65e194fd5cb3e00008e6e9ed
😎 Deploy Preview https://deploy-preview-1135--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please provide context, what was the issue and how are you solving it with your PR? basically please fill in the template for the PR and provide test steps

@Max-Kharitonov
Copy link
Author

@sedghi
this PR is related to #985. Such images have a pixel range of [negative, negative]. Therefore, we are modifying the pixels per LUT to normal values [0, 255]. After these manipulations, everything renders fine.

You could find test series in original report: #985

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your pull request. I apologize for the delay; I was away, but I'm now back to contributing to open source more actively.

I don't think your approach is correct. The minimum value can be negative, and there's no issue with that. The problem lies in the upper and lower voi ranges being the same, preventing setVOI from grabbing the correct range from the data

I'm willing to merge your pull request if you implement it like this.

CleanShot 2024-05-15 at 16 45 25@2x

@Max-Kharitonov
Copy link
Author

Max-Kharitonov commented May 16, 2024

Thanks for your pull request. I apologize for the delay; I was away, but I'm now back to contributing to open source more actively.

I don't think your approach is correct. The minimum value can be negative, and there's no issue with that. The problem lies in the upper and lower voi ranges being the same, preventing setVOI from grabbing the correct range from the data

I'm willing to merge your pull request if you implement it like this.

CleanShot 2024-05-15 at 16 45 25@2x

In case if min and max values negative? I mean all pixels are negative

@s2ramana
Copy link

@sedghi any update on this?

@sedghi
Copy link
Member

sedghi commented Jul 12, 2024

I'm not sure if this is the right direction

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

Successfully merging this pull request may close these issues.

3 participants