comparison Core/DicomParsing/FromDcmtkBridge.cpp @ 3160:fc9a4a2dad63

merge
author Alain Mazy <alain@mazy.be>
date Thu, 24 Jan 2019 10:55:19 +0100
parents 0c2b719c3796
children 47ef29168698
comparison
equal deleted inserted replaced
3159:4cfed5c2eacd 3160:fc9a4a2dad63
39 39
40 #if !defined(ORTHANC_SANDBOXED) 40 #if !defined(ORTHANC_SANDBOXED)
41 # error The macro ORTHANC_SANDBOXED must be defined 41 # error The macro ORTHANC_SANDBOXED must be defined
42 #endif 42 #endif
43 43
44 #if !defined(DCMTK_VERSION_NUMBER)
45 # error The macro DCMTK_VERSION_NUMBER must be defined
46 #endif
47
44 #include "FromDcmtkBridge.h" 48 #include "FromDcmtkBridge.h"
45 #include "ToDcmtkBridge.h" 49 #include "ToDcmtkBridge.h"
46 #include "../Logging.h" 50 #include "../Logging.h"
47 #include "../Toolbox.h" 51 #include "../Toolbox.h"
48 #include "../OrthancException.h" 52 #include "../OrthancException.h"
163 { 167 {
164 } 168 }
165 169
166 ~DictionaryLocker() 170 ~DictionaryLocker()
167 { 171 {
172 #if DCMTK_VERSION_NUMBER >= 364
173 dcmDataDict.wrunlock();
174 #else
168 dcmDataDict.unlock(); 175 dcmDataDict.unlock();
176 #endif
169 } 177 }
170 178
171 DcmDataDictionary& operator*() 179 DcmDataDictionary& operator*()
172 { 180 {
173 return dictionary_; 181 return dictionary_;
2045 } 2053 }
2046 2054
2047 if (output.type() != Json::objectValue) 2055 if (output.type() != Json::objectValue)
2048 { 2056 {
2049 throw OrthancException(ErrorCode_LuaBadOutput, 2057 throw OrthancException(ErrorCode_LuaBadOutput,
2050 "Lua: IncomingFindRequestFilter must return a table"); 2058 "Lua: The script must return a table");
2051 } 2059 }
2052 2060
2053 Json::Value::Members members = output.getMemberNames(); 2061 Json::Value::Members members = output.getMemberNames();
2054 2062
2055 for (size_t i = 0; i < members.size(); i++) 2063 for (size_t i = 0; i < members.size(); i++)
2056 { 2064 {
2057 if (output[members[i]].type() != Json::stringValue) 2065 if (output[members[i]].type() != Json::stringValue)
2058 { 2066 {
2059 throw OrthancException(ErrorCode_LuaBadOutput, 2067 throw OrthancException(ErrorCode_LuaBadOutput,
2060 "Lua: IncomingFindRequestFilter must return a table " 2068 "Lua: The script must return a table "
2061 "mapping names of DICOM tags to strings"); 2069 "mapping names of DICOM tags to strings");
2062 } 2070 }
2063 2071
2064 DicomTag tag(ParseTag(members[i])); 2072 DicomTag tag(ParseTag(members[i]));
2065 target.SetValue(tag, output[members[i]].asString(), false); 2073 target.SetValue(tag, output[members[i]].asString(), false);