diff OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp @ 4507:b4c58795f3a8

widening the use of DicomTransferSyntax enum
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Feb 2021 09:33:48 +0100
parents d9473bd5ed43
children 8f9090b137f1
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Wed Feb 10 17:01:44 2021 +0100
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Thu Feb 11 09:33:48 2021 +0100
@@ -1683,38 +1683,9 @@
   }
 
 
-  bool ParsedDicomFile::LookupTransferSyntax(std::string& result) const
+  bool ParsedDicomFile::LookupTransferSyntax(DicomTransferSyntax& result) const
   {
-#if 0
-    // This was the implementation in Orthanc <= 1.6.1
-
-    // TODO - Shouldn't "dataset.getCurrentXfer()" be used instead of
-    // using the meta header?
-    const char* value = NULL;
-
-    if (GetDcmtkObjectConst().getMetaInfo() != NULL &&
-        GetDcmtkObjectConst().getMetaInfo()->findAndGetString(DCM_TransferSyntaxUID, value).good() &&
-        value != NULL)
-    {
-      result.assign(value);
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-#else
-    DicomTransferSyntax s;
-    if (FromDcmtkBridge::LookupOrthancTransferSyntax(s, GetDcmtkObjectConst()))
-    {
-      result.assign(GetTransferSyntaxUid(s));
-      return true;
-    }
-    else
-    {
-      return false;
-    }
-#endif
+    return FromDcmtkBridge::LookupOrthancTransferSyntax(result, GetDcmtkObjectConst());
   }
 
 
@@ -1787,6 +1758,20 @@
   {
     return const_cast<const ParsedDicomFile&>(*this).LookupTransferSyntax(result);
   }
+  
+  bool ParsedDicomFile::LookupTransferSyntax(std::string& result) const
+  {
+    DicomTransferSyntax s;
+    if (LookupTransferSyntax(s))
+    {
+      result = GetTransferSyntaxUid(s);
+      return true;
+    }
+    else
+    {
+      return false;
+    }
+  }
 
   bool ParsedDicomFile::GetTagValue(std::string& value,
                                     const DicomTag& tag)