Mercurial > hg > orthanc
diff Core/DicomFormat/DicomImageInformation.cpp @ 2423:5a7c5c541a1d
Built-in decoding of palette images
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Oct 2017 21:58:08 +0200 |
parents | feb0d2dcfa9b |
children | 878b59270859 |
line wrap: on
line diff
--- a/Core/DicomFormat/DicomImageInformation.cpp Sun Oct 08 11:46:56 2017 +0200 +++ b/Core/DicomFormat/DicomImageInformation.cpp Mon Oct 09 21:58:08 2017 +0200 @@ -219,9 +219,19 @@ { if (photometric_ == PhotometricInterpretation_Palette) { - return false; + if (GetBitsStored() == 8 && GetChannelCount() == 1 && !IsSigned()) + { + format = PixelFormat_RGB24; + return true; + } + + if (GetBitsStored() == 16 && GetChannelCount() == 1 && !IsSigned()) + { + format = PixelFormat_RGB48; + return true; + } } - + if (ignorePhotometricInterpretation || photometric_ == PhotometricInterpretation_Monochrome1 || photometric_ == PhotometricInterpretation_Monochrome2)