Dicom Image display in Green Color

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
mail2vguna
Posts: 41
Joined: Tue, 2013-07-23, 12:15
Location: Chennai, India

Dicom Image display in Green Color

#1 Post by mail2vguna »

Hi

When i load the US modality images in the viewer its displayed as GREEN Color.

(0028,0002) SamplesPerPixel 3
(0028,0004) PhotometricInterpretation RGB
(0028,0006) PlanarConfiguration 0
(0028,0008) NumberOfFrames 1
(0028,0010) Rows 900
(0028,0011) Columns 1200
(0028,0014) UltrasoundColorDataPresent 1
(0028,0100) BitsAllocated 8
(0028,0101) BitsStored 8
(0028,0102) HighBit 7
(0028,0103) PixelRepresentation 0
(0028,0301) BurnedInAnnotation YES
(0028,1052) RescaleIntercept 0
(0028,1053) RescaleSlope 1

Kindly help me to fix the issue and load the image as normal in the viewer

Appreciated your help. Thanks
Thanks
Guna

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Dicom Image display in Green Color

#2 Post by J. Riesmeier »

Is the image JPEG compressed? Which viewer do you mean? What is the output of dcmj2pnm?

mail2vguna
Posts: 41
Joined: Tue, 2013-07-23, 12:15
Location: Chennai, India

Re: Dicom Image display in Green Color

#3 Post by mail2vguna »

Hi

Thanks for your response.
Yes, JPEG Lossless compression.

dcmj2pnm output below.

dcmj2pnm.exe I0010001 I0010001.bmp
E: can't change to unencapsulated representation for pixel data
E: can't determine 'PhotometricInterpretation' of decompressed image
E: mandatory attribute 'PhotometricInterpretation' is missing or can't be determined
F: Missing attribute

dcmj2pnm.exe I0010001 I0010001.jpg
E: can't change to unencapsulated representation for pixel data
E: can't determine 'PhotometricInterpretation' of decompressed image
E: mandatory attribute 'PhotometricInterpretation' is missing or can't be determined
F: Missing attribute

Looking forward your support.
Thanks
Guna

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Dicom Image display in Green Color

#4 Post by J. Riesmeier »

Are you sure that the image is not JPEG 2000 Lossless compressed? What is the Transfer Syntax UID (e.g. output of "dcmdump <filename> +P TransferSyntaxUID")?

mail2vguna
Posts: 41
Joined: Tue, 2013-07-23, 12:15
Location: Chennai, India

Re: Dicom Image display in Green Color

#5 Post by mail2vguna »

Hi

dcmdump.exe I0010001 +P TransferSyntaxUID
(0002,0010) UI =JPEG2000LosslessOnly # 22, 1 TransferSyntaxUID

Sorry it was JPEG2000 Lossless.

Any Solution ? Thanks

Looking forward your support.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Dicom Image display in Green Color

#6 Post by J. Riesmeier »

Unfortunately, the public DCMTK does not support the decompression of JPEG 2000 compressed images. This would require the DCMJP2K extension, which is not freely available and must be licensed separately.

However, I guess that the value for Photometric Interpretation (0028,0004) in your sample file is incorrect. Instead of "RGB", you should give "YBR_FULL" and "YBR_RCT" a try (see Table 8.2.4-1 in DICOM PS3.5). You could modify the value with DCMTK's dcmodify tool.

mail2vguna
Posts: 41
Joined: Tue, 2013-07-23, 12:15
Location: Chennai, India

Re: Dicom Image display in Green Color

#7 Post by mail2vguna »

Hi
I guess that the value for Photometric Interpretation (0028,0004) in your sample file is incorrect. Instead of "RGB", you should give "YBR_FULL" and "YBR_RCT" a try (see Table 8.2.4-1 in DICOM PS3.5). You could modify the value with DCMTK's dcmodify tool.
My WorkFlow
Input image - Jpeg Lossless - Photometric Interpretation (0028,0004) - RGB and samplesperpixel - 3

I am importing input image to my application its save as output image as dicom image(Jpeg2000 Lossless and Photometric Interpretation (0028,0004) - RGB and samplesperpixel - 3)

When i try to load the image in the viewer i am saving the output image as temporary dicom image and load the temporary dicom image into viewer, (temporary image compression type LittleEndianExplict and Photometric Interpretation (0028,0004) - RGB and samplesperpixel - 3)

In this case i am getting green display in the viewer. the above case based on your suggestion, Shall i change the Photometric Interpretation (0028,0004) - RGB to Photometric Interpretation (0028,0004) - YBR_FULL ? Is it correct way of doing that?. Thanks

Looking forward your support.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Dicom Image display in Green Color

#8 Post by J. Riesmeier »

I'm not sure whether the wrong color space conversion (or inconsistent value for PhotometricInterpretation) already happens during the first step ("Input image - Jpeg Lossless - ...") but you might want to check this out, assuming that you have access to the intermediate image files. An example call would be "dcmodify -m PhotometricInterpretation=YBR_FULL <filename>" (please note that the input file is overwritten, a backup is created).

mail2vguna
Posts: 41
Joined: Tue, 2013-07-23, 12:15
Location: Chennai, India

Re: Dicom Image display in Green Color

#9 Post by mail2vguna »

Okay.

Thanks for the support. Will come back to with change the RGB to YBR_FULL method and update you.

Once again thanks.

mail2vguna
Posts: 41
Joined: Tue, 2013-07-23, 12:15
Location: Chennai, India

Re: Dicom Image display in Green Color

#10 Post by mail2vguna »

Hi

After i changed PhotometricInterpretation vaue RGB to YBR_FULL with jpeg2000 lossless compression i am getting 1 image as green color out of 30 images.

Jpeg 2000 Lossless Images - photometric interpretation - YBR_FULL - 1 image displayed green out of 30 images.

Any reason ?

Looking forward your support.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Dicom Image display in Green Color

#11 Post by J. Riesmeier »

Of course, changing the value of Photometric Interpretation only makes sense if the "original" value was wrong (and the new value is correct). In other words: the right solution depends on the particular image.

mail2vguna
Posts: 41
Joined: Tue, 2013-07-23, 12:15
Location: Chennai, India

Re: Dicom Image display in Green Color

#12 Post by mail2vguna »

Hi

Thanks much.

Shall i share the my sample image(with anonymozed) which are displayed in green color with you? If yes, how can i share the files with you by email or ?

Looking forward your reply. Thanks

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Dicom Image display in Green Color

#13 Post by J. Riesmeier »

If you think there is a bug in the DCMTK that results in this "green image", please send your sample file by email to bugs/at/dcmtk/dot/org.

mail2vguna
Posts: 41
Joined: Tue, 2013-07-23, 12:15
Location: Chennai, India

Re: Dicom Image display in Green Color

#14 Post by mail2vguna »

Hi

based on your request i have shared the images via email. Kindly look in to that images and do the needful. Thanks

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Dicom Image display in Green Color

#15 Post by J. Riesmeier »

Thank you for the sample files.

My sentence started with "If you think there is a bug in the DCMTK that results in this "green image"...". This does not seem to be the case: both images are uncompressed and the value for PhotometricInterpretation is wrong (should be "YBR_FULL" instead of "RGB"). I fixed this by calling "dcmodify -m PhotometricInterpretation=YBR_FULL <filename>" and tested the result with "dcm2pnm <filename>.dcm <filename>.pnm".

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest