changeset 4385:92737070b301

If meta-header is missing, best-effort to extract "TransferSyntax" in "/instances/{id}/metadata"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 18 Dec 2020 11:48:40 +0100
parents 7e0d015ad109
children 3ea753570c6d
files NEWS OrthancServer/Sources/DicomInstanceToStore.cpp
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Dec 18 11:13:00 2020 +0100
+++ b/NEWS	Fri Dec 18 11:48:40 2020 +0100
@@ -28,6 +28,7 @@
 
 * Allow concurrency on the OrthancPluginRegisterIncomingHttpRequestFilter() callbacks
 * Allow empty request body in "/modalities/{id}/echo"
+* If meta-header is missing, best-effort to extract "TransferSyntax" in "/instances/{id}/metadata"
 
 
 Version 1.8.1 (2020-12-07)
--- a/OrthancServer/Sources/DicomInstanceToStore.cpp	Fri Dec 18 11:13:00 2020 +0100
+++ b/OrthancServer/Sources/DicomInstanceToStore.cpp	Fri Dec 18 11:48:40 2020 +0100
@@ -373,6 +373,18 @@
           return true;
         }
       }
+      else
+      {
+        // This is a DICOM file without a proper meta-header. Fallback
+        // to DCMTK, which will fully parse the dataset to retrieve
+        // the transfer syntax. Added in Orthanc 1.8.2.
+        std::string transferSyntax;
+        if (GetParsedDicomFile().LookupTransferSyntax(transferSyntax))
+        {
+          result = Toolbox::StripSpaces(transferSyntax);
+          return true;
+        }
+      }
 
       return false;
     }