Photometric Interpretation from I2DJpegSource::readPixelData

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
yusuke
Posts: 7
Joined: Fri, 2014-08-29, 08:21

Photometric Interpretation from I2DJpegSource::readPixelData

#1 Post by yusuke »

I want to analyze jpg file using I2DJpegSource class to get photometric interpretation, rows, cols and sampled per pixel.
But, it seems that I2DJpegSource::readPixelData returs "MONOCHROME2" or "YBR_FULL_422" as photometric interpretation.
Why this function does not return other photometric interpretation like "MONOCHROME1", "YBR_FULL" and so on ?

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Photometric Interpretation from I2DJpegSource::readPixel

#2 Post by Michael Onken »

Hi,

the function should return the color model that should be used by the resulting DICOM file (I2DJpegSource is a reader for JPEG files that should be converted to DICOM images).

To my knowledge:

The JPEG Interchange format (JFIF) providing the JPEG fileformat only specifies in a single byte that the JPEG data consists of either 1 color component (grayscale image) or 3 color components. If it is one, the resulting image has to be interpreted as specified by DICOM's color model MONOCHROME2. In case of 3 componets the matching DICOM color model is YBR_FULL_422 (JFIF links to the ITU-R BT.601 which defines the YBR model to be used).

Best,
Michael

yusuke
Posts: 7
Joined: Fri, 2014-08-29, 08:21

Re: Photometric Interpretation from I2DJpegSource::readPixel

#3 Post by yusuke »

Thanks Michael, i believe readPixel function and try to set those values to dicom tags.

Sincerely,
Yusuke

Post Reply

Who is online

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