PhotometricInterpretation Conversion

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
George
Posts: 52
Joined: Sun, 2023-11-12, 16:50

PhotometricInterpretation Conversion

#1 Post by George »

Hello,

I have intrest in making covnersion between types of PhotometricInterpretation, does the dcmtk have any support for that?
I see based on my search that there is only DiYBRPixelTemplate::convert(), that convert YBCR to RGB.
Regardinf the DiYBRPixelTemplate::convert(), it is used by dcmtk library in DicomImage::init() after construction, can I convert
all types to any destenation by making the init public function that way I can convert any photometric to other using dcmtk?

I also noticed that there is only other libraries like FreeImage(), OpenCV, ImageMagic. Do you know the most lightwieght library
with maximum support to convert any PhotometricInterpretation to other?

Best Regards
George

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

Re: PhotometricInterpretation Conversion

#2 Post by Marco Eichelberg »

I am not aware of any library that would support conversion of color models (PhotometricInterpretation) from any to any.
This also does not make too much sense:
  • For display on a monitor, you always need RGB, because that is how screens work
  • Palette Color is essentially a space-efficient encoding for RGB. Conversion to palette color is a lossy process, though, and involves quantization (see dcmquant tool)
  • YCbCr is useful only for lossy compression, but it is very useful for that purpose
  • Some color models like ICT and RCT do not exist in uncompressed form, they can only exist in a JPEG 2000 bitstream
For some of the common color models like RGB and YCbCr (YBR_FULL), conversion formula can be found in the DICOM standard and are also easy to find in general image processing literature.
Things become really complicated when you have a calibrated color image containing an ICC Input Device Profile. Calibrated display requires specialized tools and software, and is also not supported in DCMTK.

Post Reply

Who is online

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