Mercurial > hg > orthanc
comparison Core/DicomParsing/Internals/DicomImageDecoder.cpp @ 3932:bf46e10de8ae transcoding
clarifying debug message
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 15 May 2020 11:17:55 +0200 |
parents | 795c9ca5eb91 |
children |
comparison
equal
deleted
inserted
replaced
3931:e6606d3ec892 | 3932:bf46e10de8ae |
---|---|
808 * second example of the following page: | 808 * second example of the following page: |
809 * http://support.dcmtk.org/docs/mod_dcmjpeg.html#Examples | 809 * http://support.dcmtk.org/docs/mod_dcmjpeg.html#Examples |
810 **/ | 810 **/ |
811 | 811 |
812 { | 812 { |
813 LOG(INFO) << "Decoding a compressed image by converting its transfer syntax to Little Endian"; | 813 LOG(INFO) << "Trying to decode a compressed image by transcoding it to Little Endian Explicit"; |
814 | 814 |
815 std::unique_ptr<DcmDataset> converted(dynamic_cast<DcmDataset*>(dataset.clone())); | 815 std::unique_ptr<DcmDataset> converted(dynamic_cast<DcmDataset*>(dataset.clone())); |
816 converted->chooseRepresentation(EXS_LittleEndianExplicit, NULL); | 816 converted->chooseRepresentation(EXS_LittleEndianExplicit, NULL); |
817 | 817 |
818 if (converted->canWriteXfer(EXS_LittleEndianExplicit)) | 818 if (converted->canWriteXfer(EXS_LittleEndianExplicit)) |
819 { | 819 { |
820 return DecodeUncompressedImage(*converted, frame); | 820 return DecodeUncompressedImage(*converted, frame); |
821 } | 821 } |
822 } | 822 } |
823 | 823 |
824 throw OrthancException(ErrorCode_BadFileFormat, | 824 DicomTransferSyntax s; |
825 "Cannot decode a DICOM image with the built-in decoder"); | 825 if (FromDcmtkBridge::LookupOrthancTransferSyntax(s, dataset.getCurrentXfer())) |
826 { | |
827 throw OrthancException(ErrorCode_NotImplemented, | |
828 "The built-in DCMTK decoder cannot decode some DICOM instance " | |
829 "whose transfer syntax is: " + std::string(GetTransferSyntaxUid(s))); | |
830 } | |
831 else | |
832 { | |
833 throw OrthancException(ErrorCode_NotImplemented, | |
834 "The built-in DCMTK decoder cannot decode some DICOM instance"); | |
835 } | |
826 } | 836 } |
827 | 837 |
828 | 838 |
829 static bool IsColorImage(PixelFormat format) | 839 static bool IsColorImage(PixelFormat format) |
830 { | 840 { |