Reading YBR_FULL_422 color image

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
st80rules
Posts: 190
Joined: Tue, 2007-05-08, 17:45

Reading YBR_FULL_422 color image

#1 Post by st80rules »

Hi,

I'm trying to read an US image that has the YBR_FULL_422 photometric type, my goal is to obtain the pixels converted to a standard RGB representation, and I'm having a hard time.

First it's not too clear if I'm supported to use the DicomImage class or DiColorImage. In trying to use DicomImage, I cannot succeed in reading the pixels by using getInterData.

Trying to use the DiColorImage class, I don't understand even the constructor of the class.

Can someone point me to the right direction to achieve this?

Thanks

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

Re: Reading YBR_FULL_422 color image

#2 Post by J. Riesmeier »

Maybe, the following is helpful...

First of all, you should use the interface class DicomImage instead of the internal class DiColorImage.
Then, the internal representation of color images is usually RGB (independent of the input color model).
Finally, why do you want to access the internal representation of the pixel data at all? What is the use case?

By the way, the photometric interpretation "YBR_FULL_422" is typically used for compressed DICOM images, so the DicomImage class will usually not "see" it
(because the underlying "dcmjpeg" module creates an uncompressed RGB representation from the input data).

st80rules
Posts: 190
Joined: Tue, 2007-05-08, 17:45

Re: Reading YBR_FULL_422 color image

#3 Post by st80rules »

It is somewhat helpful, but I'm still blocked.

Ok for using DicomImage, that's what I thought but the documentation is not very clear on this.

I'm trying to obtain the "raw" pixels are we do our own rendering of images, so I want to avoid VOIs, window leveling, etc being applied to the pixels, but I do want the pixels in RGB.

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

Re: Reading YBR_FULL_422 color image

#4 Post by J. Riesmeier »

For color images, there are no "VOIs, window leveling" etc. At least the dcmimgle/dcmimage modules do not support such transformations (for color images). So, for color images DicomImage usually gives you RGB pixel data as the rendered output.

Anyway, if you are not interested in the rendered output of a DICOM image, you should not use these modules at all:
The following excerpt is from the documentation of the main interface class DicomImage:

Code: Select all

/*
* [...]
* Interface class for dcmimgle/dcmimage module.
* The main purpose of these modules is image display.
* [...]
*/

st80rules
Posts: 190
Joined: Tue, 2007-05-08, 17:45

Re: Reading YBR_FULL_422 color image

#5 Post by st80rules »

OK so how do I get the RGB pixels from such an image then?

I'll try it and see if it fits our needs.

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

Re: Reading YBR_FULL_422 color image

#6 Post by J. Riesmeier »

Just use one of the DicomImage::getOutputData() methods.

Post Reply

Who is online

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