Mercurial > hg > orthanc
annotate OrthancServer/Sources/OrthancInitialization.cpp @ 5023:c8c98389080f
use constant for multiply occurring string
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 17 Jun 2022 07:23:57 +0200 |
parents | f377d5643538 |
children | 877bc3b96476 |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1275
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
4870
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
0 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU General Public License as | |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 **/ | |
21 | |
22 | |
831
84513f2ee1f3
pch for unit tests and server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
23 #include "PrecompiledHeadersServer.h" |
2547
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
24 |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
25 #if defined(_WIN32) |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
26 // "Please include winsock2.h before windows.h" |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
27 # include <winsock2.h> |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
28 #endif |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
29 |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
30 #if !defined(HAVE_MALLOPT) |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
31 # error Macro HAVE_MALLOPT must be defined |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
32 #endif |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
33 |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
34 #if HAVE_MALLOPT == 1 |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
35 # include <malloc.h> |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
36 #endif |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
37 |
62 | 38 #include "OrthancInitialization.h" |
0 | 39 |
4045 | 40 #include "../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h" |
41 #include "../../OrthancFramework/Sources/FileStorage/FilesystemStorage.h" | |
4105
c02a2d9efbc2
move FromDcmtkBridge::ExecuteToDicom() to LuaFunctionCall, to remove dependency of DCMTK on Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
42 #include "../../OrthancFramework/Sources/HttpClient.h" |
4045 | 43 #include "../../OrthancFramework/Sources/Logging.h" |
44 #include "../../OrthancFramework/Sources/OrthancException.h" | |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
45 #include "../../OrthancFramework/Sources/SerializationToolbox.h" |
1485
27661b33f624
Creation of Logging.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1429
diff
changeset
|
46 |
3093
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3061
diff
changeset
|
47 #include "Database/SQLiteDatabaseWrapper.h" |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
48 #include "OrthancConfiguration.h" |
1274 | 49 |
4032
058b5ade8acd
renaming embedded resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4031
diff
changeset
|
50 #include <OrthancServerResources.h> |
4031
e3b3af80732d
ServerResources, and moving EmbeddedResourceHttpHandler from Core to OrthancServer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4026
diff
changeset
|
51 |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
52 #include <dcmtk/dcmnet/diutil.h> // For DCM_dcmnetLogger |
1927
b60f27664b8f
simplification in FromDcmtkBridge
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
53 |
b60f27664b8f
simplification in FromDcmtkBridge
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
54 |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
55 static const char* const STORAGE_DIRECTORY = "StorageDirectory"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
56 static const char* const ORTHANC_STORAGE = "OrthancStorage"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
57 |
1927
b60f27664b8f
simplification in FromDcmtkBridge
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
58 |
62 | 59 namespace Orthanc |
0 | 60 { |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
61 static void RegisterUserMetadata(const Json::Value& config) |
1423
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1422
diff
changeset
|
62 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
63 static const char* const USER_METADATA = "UserMetadata"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
64 |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
65 if (config.isMember(USER_METADATA)) |
1423
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1422
diff
changeset
|
66 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
67 const Json::Value& parameter = config[USER_METADATA]; |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
68 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
69 Json::Value::Members members = parameter.getMemberNames(); |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
70 for (size_t i = 0; i < members.size(); i++) |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
71 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
72 const std::string& name = members[i]; |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
73 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
74 if (!parameter[name].isInt()) |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
75 { |
2955 | 76 throw OrthancException(ErrorCode_BadParameterType, |
77 "Not a number in this user-defined metadata: " + name); | |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
78 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
79 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
80 int metadata = parameter[name].asInt(); |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
81 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
82 LOG(INFO) << "Registering user-defined metadata: " << name << " (index " |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
83 << metadata << ")"; |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
84 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
85 try |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
86 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
87 RegisterUserMetadata(metadata, name); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
88 } |
657
5425bb6f1ea5
further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
656
diff
changeset
|
89 catch (OrthancException&) |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
90 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
91 LOG(ERROR) << "Cannot register this user-defined metadata: " << name; |
657
5425bb6f1ea5
further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
656
diff
changeset
|
92 throw; |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
93 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
94 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
95 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
96 } |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
97 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
98 |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
99 static void RegisterUserContentType(const Json::Value& config) |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
100 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
101 static const char* const USER_CONTENT_TYPE = "UserContentType"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
102 |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
103 if (config.isMember(USER_CONTENT_TYPE)) |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
104 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
105 const Json::Value& parameter = config[USER_CONTENT_TYPE]; |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
106 |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
107 Json::Value::Members members = parameter.getMemberNames(); |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
108 for (size_t i = 0; i < members.size(); i++) |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
109 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
110 const std::string& name = members[i]; |
2905
ae20fccdd867
refactoring mime types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2871
diff
changeset
|
111 std::string mime = MIME_BINARY; |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
112 |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
113 const Json::Value& value = parameter[name]; |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
114 int contentType; |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
115 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
116 if (value.isArray() && |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
117 value.size() == 2 && |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
118 value[0].isInt() && |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
119 value[1].isString()) |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
120 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
121 contentType = value[0].asInt(); |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
122 mime = value[1].asString(); |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
123 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
124 else if (value.isInt()) |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
125 { |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
126 contentType = value.asInt(); |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
127 } |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
128 else |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
129 { |
2955 | 130 throw OrthancException(ErrorCode_BadParameterType, |
131 "Not a number in this user-defined attachment type: " + name); | |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
132 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
133 |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
134 LOG(INFO) << "Registering user-defined attachment type: " << name << " (index " |
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
135 << contentType << ") with MIME type \"" << mime << "\""; |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
136 |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
137 try |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
138 { |
1772
53e045b5a8ec
MIME content type can be associated to custom attachments (cf. "UserContentType")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
139 RegisterUserContentType(contentType, name, mime); |
696
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
140 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
141 catch (OrthancException&) |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
142 { |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
143 throw; |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
144 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
145 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
146 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
147 } |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
148 |
4c1860179cc5
dictionary of user-defined content types
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
149 |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
150 static void LoadExternalDictionaries(const Json::Value& configuration) |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
151 { |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
152 static const char* const EXTERNAL_DICTIONARIES = "ExternalDictionaries"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
153 |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
154 if (configuration.type() == Json::objectValue && |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
155 configuration.isMember(EXTERNAL_DICTIONARIES)) |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
156 { |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
157 std::vector<std::string> dictionaries; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
158 SerializationToolbox::ReadArrayOfStrings(dictionaries, configuration, EXTERNAL_DICTIONARIES); |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
159 FromDcmtkBridge::LoadExternalDictionaries(dictionaries); |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
160 } |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
161 } |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
162 |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
163 |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
164 static void LoadCustomDictionary(const Json::Value& configuration) |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
165 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
166 static const char* const DICTIONARY = "Dictionary"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
167 |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
168 if (configuration.type() != Json::objectValue || |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
169 !configuration.isMember(DICTIONARY) || |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
170 configuration[DICTIONARY].type() != Json::objectValue) |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
171 { |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
172 return; |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
173 } |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
174 |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
175 Json::Value::Members tags(configuration[DICTIONARY].getMemberNames()); |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
176 |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
177 for (Json::Value::ArrayIndex i = 0; i < tags.size(); i++) |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
178 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
179 const Json::Value& content = configuration[DICTIONARY][tags[i]]; |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
180 if (content.type() != Json::arrayValue || |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
181 content.size() < 2 || |
2115
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2099
diff
changeset
|
182 content.size() > 5 || |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
183 content[0].type() != Json::stringValue || |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
184 content[1].type() != Json::stringValue || |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
185 (content.size() >= 3 && content[2].type() != Json::intValue) || |
2115
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2099
diff
changeset
|
186 (content.size() >= 4 && content[3].type() != Json::intValue) || |
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2099
diff
changeset
|
187 (content.size() >= 5 && content[4].type() != Json::stringValue)) |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
188 { |
4011
914b15dedae3
fix for non private sequence tags in C-Find
Alain Mazy <alain@mazy.be>
parents:
3640
diff
changeset
|
189 throw OrthancException(ErrorCode_BadFileFormat, "The definition of the '" + tags[i] + "' dictionary entry is invalid."); |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
190 } |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
191 |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
192 DicomTag tag(FromDcmtkBridge::ParseTag(tags[i])); |
2006
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1987
diff
changeset
|
193 ValueRepresentation vr = StringToValueRepresentation(content[0].asString(), true); |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
194 std::string name = content[1].asString(); |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
195 unsigned int minMultiplicity = (content.size() >= 2) ? content[2].asUInt() : 1; |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
196 unsigned int maxMultiplicity = (content.size() >= 3) ? content[3].asUInt() : 1; |
2115
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2099
diff
changeset
|
197 std::string privateCreator = (content.size() >= 4) ? content[4].asString() : ""; |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
198 |
2115
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2099
diff
changeset
|
199 FromDcmtkBridge::RegisterDictionaryTag(tag, vr, name, minMultiplicity, maxMultiplicity, privateCreator); |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
200 } |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
201 } |
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
202 |
4934
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
203 static void LoadMainDicomTags(const Json::Value& configuration) |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
204 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
205 static const char* const EXTRA_MAIN_DICOM_TAGS = "ExtraMainDicomTags"; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
206 |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
207 if (configuration.type() != Json::objectValue || |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
208 !configuration.isMember(EXTRA_MAIN_DICOM_TAGS) || |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
209 configuration[EXTRA_MAIN_DICOM_TAGS].type() != Json::objectValue) |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
210 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
211 return; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
212 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
213 |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
214 Json::Value::Members levels(configuration[EXTRA_MAIN_DICOM_TAGS].getMemberNames()); |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
215 |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
216 for (Json::Value::ArrayIndex i = 0; i < levels.size(); i++) |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
217 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
218 ResourceType level; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
219 if (levels[i] == "Patient") |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
220 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
221 level = ResourceType_Patient; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
222 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
223 else if (levels[i] == "Study") |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
224 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
225 level = ResourceType_Study; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
226 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
227 else if (levels[i] == "Series") |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
228 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
229 level = ResourceType_Series; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
230 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
231 else if (levels[i] == "Instance") |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
232 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
233 level = ResourceType_Instance; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
234 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
235 else |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
236 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
237 throw OrthancException(ErrorCode_BadFileFormat, "Unknown entry '" + levels[i] + "' in ExtraMainDicomTags."); |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
238 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
239 |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
240 const Json::Value& content = configuration[EXTRA_MAIN_DICOM_TAGS][levels[i]]; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
241 |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
242 if (content.type() != Json::arrayValue) |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
243 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
244 throw OrthancException(ErrorCode_BadFileFormat, "The definition of the '" + levels[i] + "' ExtraMainDicomTags entry is invalid (not an array)."); |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
245 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
246 |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
247 if (content.size() > 0) |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
248 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
249 LOG(INFO) << "Configured Extra Main Dicom Tags for " << levels[i] << ":"; |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
250 |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
251 for (Json::Value::ArrayIndex t = 0; t < content.size(); t++) |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
252 { |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
253 const std::string& tagName = content[t].asString(); |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
254 DicomTag tag(FromDcmtkBridge::ParseTag(tagName)); |
4944
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
255 |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
256 if (DicomMap::IsComputedTag(tag)) |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
257 { |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
258 LOG(WARNING) << " - " << tagName << " can not be added in the Extra Main Dicom Tags since the value of this tag is computed when requested"; |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
259 } |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
260 else |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
261 { |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
262 ValueRepresentation vr = FromDcmtkBridge::LookupValueRepresentation(tag); |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
263 if (vr == ValueRepresentation_Sequence) |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
264 { |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
265 LOG(WARNING) << " - " << tagName << " can not be added in the Extra Main Dicom Tags since it is a sequence"; |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
266 } |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
267 else |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
268 { |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
269 DicomMap::AddMainDicomTag(tag, tagName, level); |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
270 LOG(INFO) << " - " << tagName; |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
271 } |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
272 } |
4934
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
273 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
274 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
275 } |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
276 } |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
277 |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
278 static void ConfigurePkcs11(const Json::Value& config) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
279 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
280 static const char* const MODULE = "Module"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
281 static const char* const VERBOSE = "Verbose"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
282 static const char* const PIN = "Pin"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
283 |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
284 if (config.type() != Json::objectValue || |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
285 !config.isMember(MODULE) || |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
286 config[MODULE].type() != Json::stringValue) |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
287 { |
2955 | 288 throw OrthancException(ErrorCode_BadFileFormat, |
289 "No path to the PKCS#11 module (DLL or .so) is provided " | |
290 "for HTTPS client authentication"); | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
291 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
292 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
293 std::string pin; |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
294 if (config.isMember(PIN)) |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
295 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
296 if (config[PIN].type() == Json::stringValue) |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
297 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
298 pin = config[PIN].asString(); |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
299 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
300 else |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
301 { |
2955 | 302 throw OrthancException(ErrorCode_BadFileFormat, |
303 "The PIN number in the PKCS#11 configuration must be a string"); | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
304 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
305 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
306 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
307 bool verbose = false; |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
308 if (config.isMember(VERBOSE)) |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
309 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
310 if (config[VERBOSE].type() == Json::booleanValue) |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
311 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
312 verbose = config[VERBOSE].asBool(); |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
313 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
314 else |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
315 { |
2955 | 316 throw OrthancException(ErrorCode_BadFileFormat, |
317 "The Verbose option in the PKCS#11 configuration must be a Boolean"); | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
318 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
319 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
320 |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
321 HttpClient::InitializePkcs11(config[MODULE].asString(), pin, verbose); |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
322 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
323 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
324 |
1656 | 325 |
62 | 326 void OrthancInitialize(const char* configurationFile) |
0 | 327 { |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
328 static const char* const LOCALE = "Locale"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
329 static const char* const PKCS11 = "Pkcs11"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
330 static const char* const DEFAULT_ENCODING = "DefaultEncoding"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
331 static const char* const MALLOC_ARENA_MAX = "MallocArenaMax"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
332 static const char* const LOAD_PRIVATE_DICTIONARY = "LoadPrivateDictionary"; |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
333 |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
334 OrthancConfiguration::WriterLock lock; |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
335 |
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
336 InitializeServerEnumerations(); |
1423
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1422
diff
changeset
|
337 |
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1422
diff
changeset
|
338 // Read the user-provided configuration |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
339 lock.GetConfiguration().Read(configurationFile); |
435
28ba73274919
registration of user-defined metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
430
diff
changeset
|
340 |
2330
9c7a80c87ae9
"Locale" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2326
diff
changeset
|
341 { |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
342 std::string locale; |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
343 |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
344 if (lock.GetJson().isMember(LOCALE)) |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
345 { |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
346 locale = lock.GetConfiguration().GetStringParameter(LOCALE, ""); |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
347 } |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
348 |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
349 bool loadPrivate = lock.GetConfiguration().GetBooleanParameter(LOAD_PRIVATE_DICTIONARY, true); |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
350 Orthanc::InitializeFramework(locale, loadPrivate); |
2330
9c7a80c87ae9
"Locale" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2326
diff
changeset
|
351 } |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
352 |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
353 // The Orthanc framework is now initialized |
2330
9c7a80c87ae9
"Locale" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2326
diff
changeset
|
354 |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
355 if (lock.GetJson().isMember(DEFAULT_ENCODING)) |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
356 { |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
357 std::string encoding = lock.GetConfiguration().GetStringParameter(DEFAULT_ENCODING, ""); |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
358 SetDefaultDicomEncoding(StringToEncoding(encoding.c_str())); |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
359 } |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
360 else |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
361 { |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
362 SetDefaultDicomEncoding(ORTHANC_DEFAULT_DICOM_ENCODING); |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
363 } |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
364 |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
365 if (lock.GetJson().isMember(PKCS11)) |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
366 { |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
367 ConfigurePkcs11(lock.GetJson()[PKCS11]); |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
368 } |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2020
diff
changeset
|
369 |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
370 RegisterUserMetadata(lock.GetJson()); |
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
371 RegisterUserContentType(lock.GetJson()); |
685
b01cc78caba4
possibility to disable the DICOM/HTTP servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
660
diff
changeset
|
372 |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
373 LoadExternalDictionaries(lock.GetJson()); // New in Orthanc 1.9.4 |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
374 LoadCustomDictionary(lock.GetJson()); |
847
03ea55da7429
fully functional JPEG-LS conversion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
375 |
4944
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
376 lock.GetConfiguration().LoadWarnings(); |
f377d5643538
new Warnings configuration + InstanceAvailability tag
Alain Mazy <am@osimis.io>
parents:
4934
diff
changeset
|
377 |
4934
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
378 LoadMainDicomTags(lock.GetJson()); // New in Orthanc 1.11.0 |
94a7b681b340
added configuration for extra main dicom tags + save signature in metadata + show warning if inconsistent main dicom tags
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
379 |
4031
e3b3af80732d
ServerResources, and moving EmbeddedResourceHttpHandler from Core to OrthancServer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4026
diff
changeset
|
380 lock.GetConfiguration().RegisterFont(ServerResources::FONT_UBUNTU_MONO_BOLD_16); |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
381 |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
382 #if HAVE_MALLOPT == 1 |
4374
79ef2b6d8e76
there will be a 1.8.2 release before 1.9.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4366
diff
changeset
|
383 // New in Orthanc 1.8.2 |
4366
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
384 // https://book.orthanc-server.com/faq/scalability.html#controlling-memory-usage |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
385 unsigned int maxArena = lock.GetConfiguration().GetUnsignedIntegerParameter(MALLOC_ARENA_MAX, 5); |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
386 if (maxArena != 0) |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
387 { |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
388 // https://man7.org/linux/man-pages/man3/mallopt.3.html |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
389 LOG(INFO) << "Calling mallopt(M_ARENA_MAX, " << maxArena << ")"; |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
390 if (mallopt(M_ARENA_MAX, maxArena) != 1 /* success */) |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
391 { |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
392 throw OrthancException(ErrorCode_InternalError, "The call to mallopt(M_ARENA_MAX, " + |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
393 boost::lexical_cast<std::string>(maxArena) + ") has failed"); |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
394 } |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
395 } |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
396 #else |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
397 if (lock.GetJson().isMember(MALLOC_ARENA_MAX)) |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
398 { |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
399 LOG(INFO) << "Your platform does not support mallopt(), ignoring configuration option \"" |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
400 << MALLOC_ARENA_MAX << "\""; |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
401 } |
6a39ca7083b9
New config option "MallocArenaMax" to control memory usage on GNU/Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4281
diff
changeset
|
402 #endif |
0 | 403 } |
404 | |
405 | |
406 | |
62 | 407 void OrthancFinalize() |
0 | 408 { |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
409 OrthancConfiguration::WriterLock lock; |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4011
diff
changeset
|
410 Orthanc::FinalizeFramework(); |
0 | 411 } |
412 | |
413 | |
1274 | 414 static IDatabaseWrapper* CreateSQLiteWrapper() |
415 { | |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
416 OrthancConfiguration::ReaderLock lock; |
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
417 |
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
418 std::string storageDirectoryStr = |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
419 lock.GetConfiguration().GetStringParameter(STORAGE_DIRECTORY, ORTHANC_STORAGE); |
1274 | 420 |
421 // Open the database | |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
422 boost::filesystem::path indexDirectory = lock.GetConfiguration().InterpretStringParameterAsPath( |
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
423 lock.GetConfiguration().GetStringParameter("IndexDirectory", storageDirectoryStr)); |
1274 | 424 |
425 LOG(WARNING) << "SQLite index directory: " << indexDirectory; | |
426 | |
427 try | |
428 { | |
429 boost::filesystem::create_directories(indexDirectory); | |
430 } | |
2836
7133ad478eea
fix Debian warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2801
diff
changeset
|
431 catch (boost::filesystem::filesystem_error&) |
1274 | 432 { |
433 } | |
434 | |
3017
517fc4767ae0
renamed class DatabaseWrapper as SQLiteDatabaseWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2955
diff
changeset
|
435 return new SQLiteDatabaseWrapper(indexDirectory.string() + "/index"); |
1274 | 436 } |
437 | |
438 | |
439 namespace | |
440 { | |
441 // Anonymous namespace to avoid clashes between compilation modules | |
442 | |
443 class FilesystemStorageWithoutDicom : public IStorageArea | |
444 { | |
445 private: | |
446 FilesystemStorage storage_; | |
447 | |
448 public: | |
4185
b289a1234822
giving a try to cross-platform compilation of SyncStorageArea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
449 FilesystemStorageWithoutDicom(const std::string& path, |
b289a1234822
giving a try to cross-platform compilation of SyncStorageArea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
450 bool fsyncOnWrite) : |
b289a1234822
giving a try to cross-platform compilation of SyncStorageArea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
451 storage_(path, fsyncOnWrite) |
1274 | 452 { |
453 } | |
454 | |
455 virtual void Create(const std::string& uuid, | |
456 const void* content, | |
457 size_t size, | |
4484
64f06e7d5fc7
new abstraction IMemoryBuffer to avoid unnecessary copies of std::string buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
458 FileContentType type) ORTHANC_OVERRIDE |
1274 | 459 { |
460 if (type != FileContentType_Dicom) | |
461 { | |
462 storage_.Create(uuid, content, size, type); | |
463 } | |
464 } | |
465 | |
4484
64f06e7d5fc7
new abstraction IMemoryBuffer to avoid unnecessary copies of std::string buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
466 virtual IMemoryBuffer* Read(const std::string& uuid, |
64f06e7d5fc7
new abstraction IMemoryBuffer to avoid unnecessary copies of std::string buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
467 FileContentType type) ORTHANC_OVERRIDE |
1274 | 468 { |
469 if (type != FileContentType_Dicom) | |
470 { | |
4484
64f06e7d5fc7
new abstraction IMemoryBuffer to avoid unnecessary copies of std::string buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
471 return storage_.Read(uuid, type); |
1274 | 472 } |
473 else | |
474 { | |
475 throw OrthancException(ErrorCode_UnknownResource); | |
476 } | |
477 } | |
478 | |
4495
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
479 virtual IMemoryBuffer* ReadRange(const std::string& uuid, |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
480 FileContentType type, |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
481 uint64_t start /* inclusive */, |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
482 uint64_t end /* exclusive */) ORTHANC_OVERRIDE |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
483 { |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
484 if (type != FileContentType_Dicom) |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
485 { |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
486 return storage_.ReadRange(uuid, type, start, end); |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
487 } |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
488 else |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
489 { |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
490 throw OrthancException(ErrorCode_UnknownResource); |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
491 } |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
492 } |
fa2311f94d9f
IStorageArea::ReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4484
diff
changeset
|
493 |
4498
7b99e8bb8246
IStorageArea::HasReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4495
diff
changeset
|
494 virtual bool HasReadRange() const ORTHANC_OVERRIDE |
7b99e8bb8246
IStorageArea::HasReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4495
diff
changeset
|
495 { |
7b99e8bb8246
IStorageArea::HasReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4495
diff
changeset
|
496 return storage_.HasReadRange(); |
7b99e8bb8246
IStorageArea::HasReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4495
diff
changeset
|
497 } |
7b99e8bb8246
IStorageArea::HasReadRange()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4495
diff
changeset
|
498 |
1274 | 499 virtual void Remove(const std::string& uuid, |
4484
64f06e7d5fc7
new abstraction IMemoryBuffer to avoid unnecessary copies of std::string buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
500 FileContentType type) ORTHANC_OVERRIDE |
1274 | 501 { |
502 if (type != FileContentType_Dicom) | |
503 { | |
504 storage_.Remove(uuid, type); | |
505 } | |
506 } | |
507 }; | |
508 } | |
509 | |
510 | |
511 static IStorageArea* CreateFilesystemStorage() | |
512 { | |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
513 static const char* const SYNC_STORAGE_AREA = "SyncStorageArea"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
514 static const char* const STORE_DICOM = "StoreDicom"; |
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
515 |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
516 OrthancConfiguration::ReaderLock lock; |
1274 | 517 |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
518 std::string storageDirectoryStr = |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
519 lock.GetConfiguration().GetStringParameter(STORAGE_DIRECTORY, ORTHANC_STORAGE); |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
520 |
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
521 boost::filesystem::path storageDirectory = |
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
522 lock.GetConfiguration().InterpretStringParameterAsPath(storageDirectoryStr); |
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
523 |
1274 | 524 LOG(WARNING) << "Storage directory: " << storageDirectory; |
525 | |
4185
b289a1234822
giving a try to cross-platform compilation of SyncStorageArea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
526 // New in Orthanc 1.7.4 |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
527 bool fsyncOnWrite = lock.GetConfiguration().GetBooleanParameter(SYNC_STORAGE_AREA, true); |
4185
b289a1234822
giving a try to cross-platform compilation of SyncStorageArea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
528 |
4696
dd6274412ff4
new configuration option "ExternalDictionaries" to load external DICOM dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4662
diff
changeset
|
529 if (lock.GetConfiguration().GetBooleanParameter(STORE_DICOM, true)) |
1274 | 530 { |
4185
b289a1234822
giving a try to cross-platform compilation of SyncStorageArea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
531 return new FilesystemStorage(storageDirectory.string(), fsyncOnWrite); |
1274 | 532 } |
533 else | |
534 { | |
535 LOG(WARNING) << "The DICOM files will not be stored, Orthanc running in index-only mode"; | |
4185
b289a1234822
giving a try to cross-platform compilation of SyncStorageArea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
536 return new FilesystemStorageWithoutDicom(storageDirectory.string(), fsyncOnWrite); |
1274 | 537 } |
538 } | |
539 | |
540 | |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
541 IDatabaseWrapper* CreateDatabaseWrapper() |
1274 | 542 { |
543 return CreateSQLiteWrapper(); | |
544 } | |
545 | |
546 | |
2940
4767d36679ed
refactoring access to Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2933
diff
changeset
|
547 IStorageArea* CreateStorageArea() |
1274 | 548 { |
549 return CreateFilesystemStorage(); | |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
550 } |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
551 |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
552 |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
553 static void SetDcmtkVerbosity(Verbosity verbosity) |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
554 { |
4281
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
555 // INFO_LOG_LEVEL was the DCMTK log level in Orthanc <= 1.8.0 |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
556 // https://support.dcmtk.org/docs-dcmrt/classOFLogger.html#ae20bf2616f15313c1f089da2eefb8245 |
4281
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
557 |
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
558 OFLogger::LogLevel dataLevel, networkLevel; |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
559 |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
560 switch (verbosity) |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
561 { |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
562 case Verbosity_Default: |
4281
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
563 // Turn off logging in DCMTK core |
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
564 dataLevel = OFLogger::OFF_LOG_LEVEL; |
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
565 networkLevel = OFLogger::OFF_LOG_LEVEL; |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
566 break; |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
567 |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
568 case Verbosity_Verbose: |
4281
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
569 dataLevel = OFLogger::INFO_LOG_LEVEL; |
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
570 networkLevel = OFLogger::INFO_LOG_LEVEL; |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
571 break; |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
572 |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
573 case Verbosity_Trace: |
4281
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
574 dataLevel = OFLogger::INFO_LOG_LEVEL; // DEBUG here makes DCMTK too verbose to be useful |
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
575 networkLevel = OFLogger::DEBUG_LOG_LEVEL; |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
576 break; |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
577 |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
578 default: |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
579 throw OrthancException(ErrorCode_ParameterOutOfRange); |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
580 } |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
581 |
4281
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
582 OFLog::configure(dataLevel); |
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
583 assert(dcmtk::log4cplus::Logger::getRoot().getChainedLogLevel() == dataLevel); |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
584 |
4281
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
585 DCM_dcmdataLogger.setLogLevel(dataLevel); // This seems to be implied by "OFLog::configure()" |
d2f79a475b51
debug log for DCMTK SCU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4280
diff
changeset
|
586 DCM_dcmnetLogger.setLogLevel(networkLevel); // This will display PDU in DICOM networking |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
587 } |
4273
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
588 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
589 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
590 void SetGlobalVerbosity(Verbosity verbosity) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
591 { |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
592 SetDcmtkVerbosity(verbosity); |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
593 |
4273
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
594 switch (verbosity) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
595 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
596 case Verbosity_Default: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
597 Logging::EnableInfoLevel(false); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
598 Logging::EnableTraceLevel(false); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
599 break; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
600 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
601 case Verbosity_Verbose: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
602 Logging::EnableInfoLevel(true); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
603 Logging::EnableTraceLevel(false); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
604 break; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
605 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
606 case Verbosity_Trace: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
607 Logging::EnableInfoLevel(true); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
608 Logging::EnableTraceLevel(true); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
609 break; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
610 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
611 default: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
612 throw OrthancException(ErrorCode_ParameterOutOfRange); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
613 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
614 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
615 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
616 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
617 Verbosity GetGlobalVerbosity() |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
618 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
619 if (Logging::IsTraceLevelEnabled()) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
620 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
621 return Verbosity_Trace; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
622 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
623 else if (Logging::IsInfoLevelEnabled()) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
624 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
625 return Verbosity_Verbose; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
626 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
627 else |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
628 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
629 return Verbosity_Default; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
630 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
631 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
632 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
633 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
634 void SetCategoryVerbosity(Logging::LogCategory category, |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
635 Verbosity verbosity) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
636 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
637 switch (verbosity) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
638 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
639 case Verbosity_Default: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
640 Logging::SetCategoryEnabled(Logging::LogLevel_INFO, category, false); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
641 Logging::SetCategoryEnabled(Logging::LogLevel_TRACE, category, false); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
642 break; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
643 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
644 case Verbosity_Verbose: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
645 Logging::SetCategoryEnabled(Logging::LogLevel_INFO, category, true); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
646 Logging::SetCategoryEnabled(Logging::LogLevel_TRACE, category, false); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
647 break; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
648 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
649 case Verbosity_Trace: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
650 Logging::SetCategoryEnabled(Logging::LogLevel_INFO, category, true); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
651 Logging::SetCategoryEnabled(Logging::LogLevel_TRACE, category, true); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
652 break; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
653 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
654 default: |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
655 throw OrthancException(ErrorCode_ParameterOutOfRange); |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
656 } |
4280
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
657 |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
658 if (category == Logging::LogCategory_DICOM) |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
659 { |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
660 SetDcmtkVerbosity(verbosity); |
58e757ded69e
SetDcmtkVerbosity()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4273
diff
changeset
|
661 } |
4273
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
662 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
663 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
664 |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
665 Verbosity GetCategoryVerbosity(Logging::LogCategory category) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
666 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
667 if (Logging::IsCategoryEnabled(Logging::LogLevel_TRACE, category)) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
668 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
669 return Verbosity_Trace; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
670 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
671 else if (Logging::IsCategoryEnabled(Logging::LogLevel_INFO, category)) |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
672 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
673 return Verbosity_Verbose; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
674 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
675 else |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
676 { |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
677 return Verbosity_Default; |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
678 } |
0034f855c023
tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4185
diff
changeset
|
679 } |
0 | 680 } |