changeset 6935:987befd8303d

fix build against old versions of DCMTK
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Jun 2026 18:05:46 +0200
parents a5ded5f913ed
children 610bde3b8311
files OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp
diffstat 1 files changed, 9 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp	Fri Jun 05 17:58:48 2026 +0200
+++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp	Fri Jun 05 18:05:46 2026 +0200
@@ -2020,22 +2020,18 @@
       case EVR_OB:
         return ValueRepresentation_OtherByte;
 
+#if DCMTK_VERSION_NUMBER >= 361
       case EVR_OD:
-#if DCMTK_VERSION_NUMBER >= 361
         return ValueRepresentation_OtherDouble;
-#else
-        throw OrthancException(ErrorCode_NotSupported, "OD value representation is not supported, as using DCMTK <= 3.6.0");
 #endif
 
       case EVR_OF:
         return ValueRepresentation_OtherFloat;
 
+#if DCMTK_VERSION_NUMBER >= 362
       case EVR_OL:
-#if DCMTK_VERSION_NUMBER >= 362
+        // Even though EVR_OL was introduced in DCMTK 3.6.1, its implementation was broken
         return ValueRepresentation_OtherLong;
-#else
-        // Even though EVR_OL was introduced in DCMTK 3.6.1, its implementation was broken
-        throw OrthancException(ErrorCode_NotSupported, "OL value representation is not supported, as using DCMTK <= 3.6.1");
 #endif
 
       case EVR_OW:
@@ -2062,11 +2058,9 @@
       case EVR_TM:
         return ValueRepresentation_Time;
 
+#if DCMTK_VERSION_NUMBER >= 361
       case EVR_UC:
-#if DCMTK_VERSION_NUMBER >= 361
         return ValueRepresentation_UnlimitedCharacters;
-#else
-        throw OrthancException(ErrorCode_NotSupported, "UC value representation is not supported, as using DCMTK <= 3.6.0");
 #endif
 
       case EVR_UI:
@@ -2078,11 +2072,9 @@
       case EVR_UN:
         return ValueRepresentation_Unknown;
 
+#if DCMTK_VERSION_NUMBER >= 361
       case EVR_UR:
-#if DCMTK_VERSION_NUMBER >= 361
         return ValueRepresentation_UniversalResource;
-#else
-        throw OrthancException(ErrorCode_NotSupported, "UR value representation is not supported, as using DCMTK <= 3.6.0");
 #endif
 
       case EVR_US:
@@ -2091,28 +2083,23 @@
       case EVR_UT:
         return ValueRepresentation_UnlimitedText;
 
+#if DCMTK_VERSION_NUMBER >= 365
       case EVR_OV:
-#if DCMTK_VERSION_NUMBER >= 365
         return ValueRepresentation_OtherVeryLong;
-#else
-        throw OrthancException(ErrorCode_NotSupported, "OV value representation is not supported, as using DCMTK <= 3.6.4");
 #endif
 
+#if DCMTK_VERSION_NUMBER >= 365
       case EVR_SV:
-#if DCMTK_VERSION_NUMBER >= 365
         return ValueRepresentation_SignedVeryLong;
-#else
-        throw OrthancException(ErrorCode_NotSupported, "SV value representation is not supported, as using DCMTK <= 3.6.4");
 #endif
 
+#if DCMTK_VERSION_NUMBER >= 365
       case EVR_UV:
-#if DCMTK_VERSION_NUMBER >= 365
         return ValueRepresentation_UnsignedVeryLong;
-#else
-        throw OrthancException(ErrorCode_NotSupported, "UV value representation is not supported, as using DCMTK <= 3.6.4");
 #endif
 
       default:
+        // This notably happens if the version of DCMTK is too old
         return ValueRepresentation_NotSupported;
     }
   }