-
Notifications
You must be signed in to change notification settings - Fork 295
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
Weasis shows green hues instead of black in JPEG-compressed Ultrasound images #140
Comments
The DICOM standard does not exclude having a 1.2.840.10008.1.2.4.50 syntax with an RGB color model but in practice using RGB for jpeg lossy does not make sense. If there really is a manufacturer who configures his equipment to produce jpeg lossy with an RGB model, you should ask him why he does this. On the other hand in Weasis and dcm4che, the RGB model is forced to become YBR_FULL_422 for the syntax 1.2.840.10008.1.2.4.50 because it is an error that is made by some manufacturers who define an RGB model when the data is actually in YBR. In summary Weasis could display this image correctly but in practice this type of image should not exist, however there are many images with a fake RGB models instead of YBR. |
Hallo, |
This image displays correctly in older versions of Weasis (try 2.6.1). The question is not how to fix this problem, but rather how to deal with images that have an RGB model but actually have YBR data. In the development of Weasis we have always tried to be as close as possible to the DICOM standard.This forced color model conversion is one of the rare adaptations made to the standard because these images exist while those in lossy jpeg with an RGB model, this is the first time I've seen them. The only solution to handle both situations would be to add an option to display one or the other mode. However from a data compression point of view, producing lossy jpeg images with an RGB model remains an absurdity even if it is not forbidden in DICOM. |
Besides the fact that I now consider to let Orthanc transcode all incoming compressed RGB data from this ultrasound device to YBR to save space, wouldn't it be possible to restrict the application of this forced YUV interpretation to the manufacturers / devices where the misbehaviour of sending YBR but specifying RGB as PhotometricInterpretation is known? This information could be gained from Manufacturer or ManufacturerModelName tags. |
I publish a fix ea29756 Let me know if you see other manufacturers with these kind of images |
Thanks for the quick fix. Works for me, the files are displayed in correct colors now. |
Hallo,
we have a problem with the current stable release of Weasis (v3.6.1) on Windows. The DICOM files generated by our SonoScape P40 ultrasound device are rendered with a green background instead of the black color which is expected. The error occurs as soon as compression for JPEG images is switched on in the ultrasound device, no matter whether it's lossless or lossy compression.
Attached is an example DICOM-file with a lossy compression on quality setting "high". This file can be previewed in the Orthanc Web preview without issues, the contained JPEG is displayed correctly by GIMP after extracting it with dcmdump from the DICOM file.
PhotometricInterpretation tag is set to "RGB", which seems correct as GIMP shows the same color model when opening the extracted raw data.
Help is appreciated.
Screenshot of Weasis misbehaviour:
Sample file used for the screenshot:
c63d93be-53d2-4892-8e51-20ea37c20e32.zip
The text was updated successfully, but these errors were encountered: