# HG changeset patch # User Sebastien Jodogne # Date 1479129765 -3600 # Node ID 8cbb55089a1d7f1ece37581aaf7448f34710587e # Parent 9a272d552c271eb17a5cbdeb22a8345a4d93c248 New configuration option: "LoadPrivateDictionary" diff -r 9a272d552c27 -r 8cbb55089a1d NEWS --- 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 -------- diff -r 9a272d552c27 -r 8cbb55089a1d OrthancServer/FromDcmtkBridge.cpp --- 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 diff -r 9a272d552c27 -r 8cbb55089a1d OrthancServer/FromDcmtkBridge.h --- 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, diff -r 9a272d552c27 -r 8cbb55089a1d OrthancServer/OrthancInitialization.cpp --- 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 diff -r 9a272d552c27 -r 8cbb55089a1d Resources/Configuration.json --- 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" ] } }