Mercurial > hg > orthanc
comparison OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp @ 4902:df86d2505df8
Orthanc 1.9.8 is now known as Orthanc 1.10.0
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 20 Feb 2022 16:57:43 +0100 |
parents | 6971ea27a2a9 |
children | 255b02c68908 |
comparison
equal
deleted
inserted
replaced
4901:0bb73ef7cf07 | 4902:df86d2505df8 |
---|---|
185 numberOfFrames_ = 1; | 185 numberOfFrames_ = 1; |
186 } | 186 } |
187 | 187 |
188 if (bitsAllocated_ != 8 && bitsAllocated_ != 16 && | 188 if (bitsAllocated_ != 8 && bitsAllocated_ != 16 && |
189 bitsAllocated_ != 24 && bitsAllocated_ != 32 && | 189 bitsAllocated_ != 24 && bitsAllocated_ != 32 && |
190 bitsAllocated_ != 1 /* new in Orthanc 1.9.8 */) | 190 bitsAllocated_ != 1 /* new in Orthanc 1.10.0 */) |
191 { | 191 { |
192 throw OrthancException(ErrorCode_IncompatibleImageFormat, "Image not supported: " + boost::lexical_cast<std::string>(bitsAllocated_) + " bits allocated"); | 192 throw OrthancException(ErrorCode_IncompatibleImageFormat, "Image not supported: " + boost::lexical_cast<std::string>(bitsAllocated_) + " bits allocated"); |
193 } | 193 } |
194 else if (numberOfFrames_ == 0) | 194 else if (numberOfFrames_ == 0) |
195 { | 195 { |
205 throw OrthancException(ErrorCode_IncompatibleImageFormat, "Image not supported: samples per pixel is 0"); | 205 throw OrthancException(ErrorCode_IncompatibleImageFormat, "Image not supported: samples per pixel is 0"); |
206 } | 206 } |
207 | 207 |
208 if (bitsStored_ == 1) | 208 if (bitsStored_ == 1) |
209 { | 209 { |
210 // This is the case of DICOM SEG, new in Orthanc 1.9.8 | 210 // This is the case of DICOM SEG, new in Orthanc 1.10.0 |
211 if (bitsAllocated_ != 1) | 211 if (bitsAllocated_ != 1) |
212 { | 212 { |
213 throw OrthancException(ErrorCode_BadFileFormat); | 213 throw OrthancException(ErrorCode_BadFileFormat); |
214 } | 214 } |
215 else if (width_ % 8 != 0) | 215 else if (width_ % 8 != 0) |
363 return true; | 363 return true; |
364 } | 364 } |
365 | 365 |
366 if (GetBitsStored() == 1 && GetChannelCount() == 1 && !IsSigned()) | 366 if (GetBitsStored() == 1 && GetChannelCount() == 1 && !IsSigned()) |
367 { | 367 { |
368 // This is the case of DICOM SEG, new in Orthanc 1.9.8 | 368 // This is the case of DICOM SEG, new in Orthanc 1.10.0 |
369 format = PixelFormat_Grayscale8; | 369 format = PixelFormat_Grayscale8; |
370 return true; | 370 return true; |
371 } | 371 } |
372 } | 372 } |
373 | 373 |