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

fix: data type view after scaling #509

Merged

Conversation

Ouwen
Copy link
Contributor

@Ouwen Ouwen commented Feb 4, 2023

@sedghi @swederik, I was going through to make sure CSWIL would automatically select the proper type for cs3d and think there might be a bug. I could very likely wrong though since afaik no such issue has been reported...

Essentially, cs3d will rely on the native decoded array type CSWIL provides. In the case the PixelData is PixelRepresentation === 0, it is usually a Uint16ArrayBuffer view for CT data. However, usually this data is preScaled within CSWIL and after scaling, a Uint16ArrayBuffer view should really be a Int16ArrayBuffer. However, it does not seem like this view is used in the setPixelDataType function.

It seems like PixelRepresentation also only refers to the stored pixel data tag, not post slope + intercept. (https://groups.google.com/g/comp.protocols.dicom/c/LQv-Vq8fQYA)

A Uint16 view can easily be recast to Int16 view downstream, which may be why no issues have popped up thus far?

Let me know if I'm missing anything here as I'm a bit confused how a Uint16 typed PixelData + rescale would provide back a proper imageFrame.pixelData without the changes below.

@netlify
Copy link

netlify bot commented Feb 4, 2023

Deploy Preview for cornerstone-wado-image-loader ready!

Name Link
🔨 Latest commit 01b63dc
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-wado-image-loader/deploys/63ddee619d9b400008409c9c
😎 Deploy Preview https://deploy-preview-509--cornerstone-wado-image-loader.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 settings.

@sedghi sedghi changed the title fix: scaling view fix: data type view after scaling Feb 15, 2023
@sedghi sedghi merged commit 9cb6213 into cornerstonejs:master Feb 15, 2023
@sedghi
Copy link
Member

sedghi commented Feb 15, 2023

🎉 This PR is included in version 4.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants