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 ?
Photometric Interpretation from I2DJpegSource::readPixelData
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: Photometric Interpretation from I2DJpegSource::readPixel
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
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
Re: Photometric Interpretation from I2DJpegSource::readPixel
Thanks Michael, i believe readPixel function and try to set those values to dicom tags.
Sincerely,
Yusuke
Sincerely,
Yusuke
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest