comparison 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
comparison
equal deleted inserted replaced
2422:b340f0a9022c 2423:5a7c5c541a1d
217 bool DicomImageInformation::ExtractPixelFormat(PixelFormat& format, 217 bool DicomImageInformation::ExtractPixelFormat(PixelFormat& format,
218 bool ignorePhotometricInterpretation) const 218 bool ignorePhotometricInterpretation) const
219 { 219 {
220 if (photometric_ == PhotometricInterpretation_Palette) 220 if (photometric_ == PhotometricInterpretation_Palette)
221 { 221 {
222 return false; 222 if (GetBitsStored() == 8 && GetChannelCount() == 1 && !IsSigned())
223 } 223 {
224 224 format = PixelFormat_RGB24;
225 return true;
226 }
227
228 if (GetBitsStored() == 16 && GetChannelCount() == 1 && !IsSigned())
229 {
230 format = PixelFormat_RGB48;
231 return true;
232 }
233 }
234
225 if (ignorePhotometricInterpretation || 235 if (ignorePhotometricInterpretation ||
226 photometric_ == PhotometricInterpretation_Monochrome1 || 236 photometric_ == PhotometricInterpretation_Monochrome1 ||
227 photometric_ == PhotometricInterpretation_Monochrome2) 237 photometric_ == PhotometricInterpretation_Monochrome2)
228 { 238 {
229 if (GetBitsStored() == 8 && GetChannelCount() == 1 && !IsSigned()) 239 if (GetBitsStored() == 8 && GetChannelCount() == 1 && !IsSigned())