changeset 2151:8cbb55089a1d

New configuration option: "LoadPrivateDictionary"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 14 Nov 2016 14:22:45 +0100
parents 9a272d552c27
children cbebc5d072b0
files NEWS OrthancServer/FromDcmtkBridge.cpp OrthancServer/FromDcmtkBridge.h OrthancServer/OrthancInitialization.cpp Resources/Configuration.json
diffstat 5 files changed, 33 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Mon Nov 14 12:10:07 2016 +0100
+++ b/NEWS	Mon Nov 14 14:22:45 2016 +0100
@@ -5,7 +5,7 @@
 -------
 
 * Handling of private tags/creators in the "Dictionary" configuration option
-* New configuration options: "DicomScuTimeout" and "DicomScpTimeout"
+* New configuration options: "LoadPrivateDictionary", "DicomScuTimeout" and "DicomScpTimeout"
 
 REST API
 --------
--- a/OrthancServer/FromDcmtkBridge.cpp	Mon Nov 14 12:10:07 2016 +0100
+++ b/OrthancServer/FromDcmtkBridge.cpp	Mon Nov 14 14:22:45 2016 +0100
@@ -177,7 +177,7 @@
   }
 
 
-  void FromDcmtkBridge::InitializeDictionary()
+  void FromDcmtkBridge::InitializeDictionary(bool loadPrivateDictionary)
   {
     {
       DictionaryLocker locker;
@@ -194,7 +194,16 @@
       //LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_DICONDE);
 
       LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_DICOM);
-      LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_PRIVATE);
+
+      if (loadPrivateDictionary)
+      {
+        LOG(INFO) << "Loading the dictionary of private tags";
+        LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_PRIVATE);
+      }
+      else
+      {
+        LOG(INFO) << "The dictionary of private tags has not been loaded";
+      }
 
 #elif defined(__linux__) || defined(__FreeBSD_kernel__)
       std::string path = DCMTK_DICTIONARY_DIR;
@@ -206,7 +215,16 @@
       }
 
       LoadExternalDictionary(*locker, path, "dicom.dic");
-      LoadExternalDictionary(*locker, path, "private.dic");
+
+      if (loadPrivateDictionary)
+      {
+        LOG(INFO) << "Loading the dictionary of private tags";
+        LoadExternalDictionary(*locker, path, "private.dic");
+      }
+      else
+      {
+        LOG(INFO) << "The dictionary of private tags has not been loaded";
+      }
 
 #else
 #error Support your platform here
--- a/OrthancServer/FromDcmtkBridge.h	Mon Nov 14 12:10:07 2016 +0100
+++ b/OrthancServer/FromDcmtkBridge.h	Mon Nov 14 14:22:45 2016 +0100
@@ -89,7 +89,7 @@
                                    Encoding defaultEncoding);
 
   public:
-    static void InitializeDictionary();
+    static void InitializeDictionary(bool loadPrivateDictionary);
 
     static void RegisterDictionaryTag(const DicomTag& tag,
                                       ValueRepresentation vr,
--- a/OrthancServer/OrthancInitialization.cpp	Mon Nov 14 12:10:07 2016 +0100
+++ b/OrthancServer/OrthancInitialization.cpp	Mon Nov 14 14:22:45 2016 +0100
@@ -481,7 +481,7 @@
     RegisterUserMetadata();
     RegisterUserContentType();
 
-    FromDcmtkBridge::InitializeDictionary();
+    FromDcmtkBridge::InitializeDictionary(GetGlobalBoolParameterInternal("LoadPrivateDictionary", true));
     LoadCustomDictionary(configuration_);
 
 #if ORTHANC_ENABLE_JPEG_LOSSLESS == 1
--- a/Resources/Configuration.json	Mon Nov 14 12:10:07 2016 +0100
+++ b/Resources/Configuration.json	Mon Nov 14 14:22:45 2016 +0100
@@ -317,6 +317,13 @@
   // default, as it requires intensive accesses to the hard drive.
   "AllowFindSopClassesInStudy" : false,
 
+  // If set to "false", Orthanc will not load its default dictionary
+  // of private tags. This might be necessary if you cannot import a
+  // DICOM file encoded using the Implicit VR Endian transfer syntax,
+  // and containing private tags. You can still list your private tags
+  // of interest in the "Dictionary" configuration option below.
+  "LoadPrivateDictionary" : true,
+
   // Register a new tag in the dictionary of DICOM tags that are known
   // to Orthanc. Each line must contain the tag (formatted as 2
   // hexadecimal numbers), the value representation (2 upcase
@@ -326,7 +333,8 @@
   // possibly the Private Creator (for private tags).
   "Dictionary" : {
     // "0014,1020" : [ "DA", "ValidationExpiryDate", 1, 1 ]
-    // "00e1,10c2" : [ "UI", "PET-CT Multi Modality Name", 1, 1, "ELSCINT1" ],
+    // "00e1,10c2" : [ "UI", "PET-CT Multi Modality Name", 1, 1, "ELSCINT1" ]
     // "7053,1003" : [ "ST", "Original Image Filename", 1, 1, "Philips PET Private Group" ]
+    // "2001,5f" : [ "SQ", "StackSequence", 1, 0, "Philips Imaging DD 001" ]
   }
 }