changeset 499:e31fdf2eefe3

Fix issue #194 (Upgrade media types to DICOM 2021a, cf. table 8.7.3-5)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 06 May 2021 14:39:07 +0200
parents a9d773afdbc6
children c03fb4c6e00a
files NEWS Plugin/WadoRsRetrieveFrames.cpp
diffstat 2 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed May 05 18:58:36 2021 +0200
+++ b/NEWS	Thu May 06 14:39:07 2021 +0200
@@ -4,6 +4,7 @@
 * New field "Timeout" in "DicomWeb.Servers" to specify HTTP timeout on a per-server basis
 * Reduced memory consumption in STOW-RS server thanks to an optimization of
   Orthanc::MultipartStreamReader in Orthanc framework 1.9.3
+* Fix issue #194 (Upgrade media types to DICOM 2021a, cf. table 8.7.3-5)
 * Fix issue #196 (STOW-RS: Should return 200 only when successfully stored all instances)
 
 
--- a/Plugin/WadoRsRetrieveFrames.cpp	Wed May 05 18:58:36 2021 +0200
+++ b/Plugin/WadoRsRetrieveFrames.cpp	Thu May 06 14:39:07 2021 +0200
@@ -166,19 +166,25 @@
           syntax = Orthanc::DicomTransferSyntax_JPEGProcess14;
           return true;
         }
-        else if (type == "image/x-dicom-rle" && (transferSyntax.empty() ||  // Default
-                                                 transferSyntax == "1.2.840.10008.1.2.5"))
+        else if ((type == "image/x-dicom-rle" ||   // Table 6.1.1.8-3b of DICOM 2017c (backward compatibility)
+                  type == "image/dicom-rle") &&    // Table 8.7.3-5 of DICOM 2021a
+                 (transferSyntax.empty() ||        // Default
+                  transferSyntax == "1.2.840.10008.1.2.5"))
         {
           syntax = Orthanc::DicomTransferSyntax_RLELossless;
           return true;
         }
-        else if (type == "image/x-jls" && (transferSyntax.empty() ||  // Default
-                                           transferSyntax == "1.2.840.10008.1.2.4.80"))
+        else if ((type == "image/x-jls" ||   // Table 6.1.1.8-3b of DICOM 2017c (backward compatibility)
+                  type == "image/jls") &&    // Table 8.7.3-5 of DICOM 2021a
+                 (transferSyntax.empty() ||  // Default
+                  transferSyntax == "1.2.840.10008.1.2.4.80"))
         {
           syntax = Orthanc::DicomTransferSyntax_JPEGLSLossless;
           return true;
         }
-        else if (type == "image/x-jls" && transferSyntax == "1.2.840.10008.1.2.4.81")
+        else if ((type == "image/x-jls" ||   // Table 6.1.1.8-3b of DICOM 2017c (backward compatibility)
+                  type == "image/jls") &&    // Table 8.7.3-5 of DICOM 2021a
+                 transferSyntax == "1.2.840.10008.1.2.4.81")
         {
           syntax = Orthanc::DicomTransferSyntax_JPEGLSLossy;
           return true;
@@ -345,13 +351,16 @@
       return "image/jpeg; transfer-syntax=1.2.840.10008.1.2.4.70";
     
     case Orthanc::DicomTransferSyntax_RLELossless:
-      return "image/x-dicom-rle; transfer-syntax=1.2.840.10008.1.2.5";
+      // Was "image/x-dicom-rle" in DICOMweb <= 1.5
+      return "image/dicom-rle; transfer-syntax=1.2.840.10008.1.2.5";
 
     case Orthanc::DicomTransferSyntax_JPEGLSLossless:
-      return "image/x-jls; transfer-syntax=1.2.840.10008.1.2.4.80";
+      // Was "image/x-jls" in DICOMweb <= 1.5
+      return "image/jls; transfer-syntax=1.2.840.10008.1.2.4.80";
 
     case Orthanc::DicomTransferSyntax_JPEGLSLossy:
-      return "image/x-jls; transfer-syntax=1.2.840.10008.1.2.4.81";
+      // Was "image/x-jls" in DICOMweb <= 1.5
+      return "image/jls; transfer-syntax=1.2.840.10008.1.2.4.81";
 
     case Orthanc::DicomTransferSyntax_JPEG2000LosslessOnly:
       return "image/jp2; transfer-syntax=1.2.840.10008.1.2.4.90";