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

JPEGBaseline color images rendered wrong #46

Closed
bisol opened this issue Jun 28, 2016 · 2 comments
Closed

JPEGBaseline color images rendered wrong #46

bisol opened this issue Jun 28, 2016 · 2 comments
Labels
🐛 Bug: Report Bug reported, but not verified.

Comments

@bisol
Copy link

bisol commented Jun 28, 2016

Hi,

Cornerstone is rendering this US image in shades of green/magenta
(REMOVED because it appeared to have PHI)

I've been able to reproduce this by converting images to JPEGExtended (1.2.840.10008.1.2.4.51) transfer syntax with dcmtk's "dcmcjpeg.exe +ee"

It seems the JPEGBaseline decoder is aplying an unecessary color transform to the image: setting colorTransform to false in decoders/external/jpeg.js:955 fixes this:

case 3:
    // The default transform for three components is true
    colorTransform = false; //true;

I know DICOM is full of weird corner cases, do you think this is a valid solution?

@swederik swederik added the 🐛 Bug: Report Bug reported, but not verified. label Apr 3, 2017
@swederik
Copy link
Member

swederik commented Apr 3, 2017

Thanks for the report. I removed the image from your post since it appeared to have PHI in it. It does still appear in green / magenta, though, so I have tagged this as a bug.

@swederik
Copy link
Member

swederik commented Apr 4, 2017

You were correct. It appears that the jpeg-jg library is applying a YCbCr -> RGB color transform internally. We don't want this to happen since we handle the color space conversion afterwards. I have just added jpeg.colorTransform=false flag to prevent this, rather than editing the library code itself.

@swederik swederik closed this as completed Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug: Report Bug reported, but not verified.
Projects
None yet
Development

No branches or pull requests

2 participants