changeset 3932:bf46e10de8ae transcoding

clarifying debug message
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 15 May 2020 11:17:55 +0200
parents e6606d3ec892
children f67b48833a4f
files Core/DicomParsing/Internals/DicomImageDecoder.cpp
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomParsing/Internals/DicomImageDecoder.cpp	Fri May 15 09:22:31 2020 +0200
+++ b/Core/DicomParsing/Internals/DicomImageDecoder.cpp	Fri May 15 11:17:55 2020 +0200
@@ -810,7 +810,7 @@
      **/
     
     {
-      LOG(INFO) << "Decoding a compressed image by converting its transfer syntax to Little Endian";
+      LOG(INFO) << "Trying to decode a compressed image by transcoding it to Little Endian Explicit";
 
       std::unique_ptr<DcmDataset> converted(dynamic_cast<DcmDataset*>(dataset.clone()));
       converted->chooseRepresentation(EXS_LittleEndianExplicit, NULL);
@@ -821,8 +821,18 @@
       }
     }
 
-    throw OrthancException(ErrorCode_BadFileFormat,
-                           "Cannot decode a DICOM image with the built-in decoder");
+    DicomTransferSyntax s;
+    if (FromDcmtkBridge::LookupOrthancTransferSyntax(s, dataset.getCurrentXfer()))
+    {
+      throw OrthancException(ErrorCode_NotImplemented,
+                             "The built-in DCMTK decoder cannot decode some DICOM instance "
+                             "whose transfer syntax is: " + std::string(GetTransferSyntaxUid(s)));
+    }
+    else
+    {
+      throw OrthancException(ErrorCode_NotImplemented,
+                             "The built-in DCMTK decoder cannot decode some DICOM instance");
+    }
   }