Mercurial > hg > orthanc
annotate Plugins/Engine/PluginsEnumerations.cpp @ 1768:70f544f9c38f
fix possible deadlock in custom database plugins
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Nov 2015 17:39:42 +0100 |
parents | f4286d99ee0a |
children | 613df4362575 |
rev | line source |
---|---|
1625 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * | |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
22 * | |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
33 #include "../../OrthancServer/PrecompiledHeadersServer.h" | |
34 #include "PluginsEnumerations.h" | |
35 | |
1632
eb8fbcf008b5
fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
36 #if ORTHANC_PLUGINS_ENABLED != 1 |
eb8fbcf008b5
fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
37 #error The plugin support is disabled |
eb8fbcf008b5
fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
38 #endif |
eb8fbcf008b5
fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
39 |
eb8fbcf008b5
fix build with plugins disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
40 |
1625 | 41 #include "../../Core/OrthancException.h" |
42 | |
43 namespace Orthanc | |
44 { | |
45 namespace Plugins | |
46 { | |
47 OrthancPluginResourceType Convert(ResourceType type) | |
48 { | |
49 switch (type) | |
50 { | |
51 case ResourceType_Patient: | |
52 return OrthancPluginResourceType_Patient; | |
53 | |
54 case ResourceType_Study: | |
55 return OrthancPluginResourceType_Study; | |
56 | |
57 case ResourceType_Series: | |
58 return OrthancPluginResourceType_Series; | |
59 | |
60 case ResourceType_Instance: | |
61 return OrthancPluginResourceType_Instance; | |
62 | |
63 default: | |
64 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
65 } | |
66 } | |
67 | |
68 | |
1669
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
69 ResourceType Convert(OrthancPluginResourceType type) |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
70 { |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
71 switch (type) |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
72 { |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
73 case OrthancPluginResourceType_Patient: |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
74 return ResourceType_Patient; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
75 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
76 case OrthancPluginResourceType_Study: |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
77 return ResourceType_Study; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
78 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
79 case OrthancPluginResourceType_Series: |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
80 return ResourceType_Series; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
81 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
82 case OrthancPluginResourceType_Instance: |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
83 return ResourceType_Instance; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
84 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
85 default: |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
86 throw OrthancException(ErrorCode_ParameterOutOfRange); |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
87 } |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
88 } |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
89 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
90 |
1625 | 91 OrthancPluginChangeType Convert(ChangeType type) |
92 { | |
93 switch (type) | |
94 { | |
95 case ChangeType_CompletedSeries: | |
96 return OrthancPluginChangeType_CompletedSeries; | |
97 | |
98 case ChangeType_Deleted: | |
99 return OrthancPluginChangeType_Deleted; | |
100 | |
101 case ChangeType_NewChildInstance: | |
102 return OrthancPluginChangeType_NewChildInstance; | |
103 | |
104 case ChangeType_NewInstance: | |
105 return OrthancPluginChangeType_NewInstance; | |
106 | |
107 case ChangeType_NewPatient: | |
108 return OrthancPluginChangeType_NewPatient; | |
109 | |
110 case ChangeType_NewSeries: | |
111 return OrthancPluginChangeType_NewSeries; | |
112 | |
113 case ChangeType_NewStudy: | |
114 return OrthancPluginChangeType_NewStudy; | |
115 | |
116 case ChangeType_StablePatient: | |
117 return OrthancPluginChangeType_StablePatient; | |
118 | |
119 case ChangeType_StableSeries: | |
120 return OrthancPluginChangeType_StableSeries; | |
121 | |
122 case ChangeType_StableStudy: | |
123 return OrthancPluginChangeType_StableStudy; | |
124 | |
125 default: | |
126 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
127 } | |
128 } | |
129 | |
130 | |
131 OrthancPluginPixelFormat Convert(PixelFormat format) | |
132 { | |
133 switch (format) | |
134 { | |
135 case PixelFormat_Grayscale16: | |
136 return OrthancPluginPixelFormat_Grayscale16; | |
137 | |
138 case PixelFormat_Grayscale8: | |
139 return OrthancPluginPixelFormat_Grayscale8; | |
140 | |
141 case PixelFormat_RGB24: | |
142 return OrthancPluginPixelFormat_RGB24; | |
143 | |
144 case PixelFormat_RGBA32: | |
145 return OrthancPluginPixelFormat_RGBA32; | |
146 | |
147 case PixelFormat_SignedGrayscale16: | |
148 return OrthancPluginPixelFormat_SignedGrayscale16; | |
149 | |
150 default: | |
151 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
152 } | |
153 } | |
154 | |
155 | |
156 PixelFormat Convert(OrthancPluginPixelFormat format) | |
157 { | |
158 switch (format) | |
159 { | |
160 case OrthancPluginPixelFormat_Grayscale16: | |
161 return PixelFormat_Grayscale16; | |
162 | |
163 case OrthancPluginPixelFormat_Grayscale8: | |
164 return PixelFormat_Grayscale8; | |
165 | |
166 case OrthancPluginPixelFormat_RGB24: | |
167 return PixelFormat_RGB24; | |
168 | |
169 case OrthancPluginPixelFormat_RGBA32: | |
170 return PixelFormat_RGBA32; | |
171 | |
172 case OrthancPluginPixelFormat_SignedGrayscale16: | |
173 return PixelFormat_SignedGrayscale16; | |
174 | |
175 default: | |
176 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
177 } | |
178 } | |
179 | |
180 | |
181 OrthancPluginContentType Convert(FileContentType type) | |
182 { | |
183 switch (type) | |
184 { | |
185 case FileContentType_Dicom: | |
186 return OrthancPluginContentType_Dicom; | |
187 | |
188 case FileContentType_DicomAsJson: | |
189 return OrthancPluginContentType_DicomAsJson; | |
190 | |
191 default: | |
192 return OrthancPluginContentType_Unknown; | |
193 } | |
194 } | |
195 | |
196 | |
197 FileContentType Convert(OrthancPluginContentType type) | |
198 { | |
199 switch (type) | |
200 { | |
201 case OrthancPluginContentType_Dicom: | |
202 return FileContentType_Dicom; | |
203 | |
204 case OrthancPluginContentType_DicomAsJson: | |
205 return FileContentType_DicomAsJson; | |
206 | |
207 default: | |
208 return FileContentType_Unknown; | |
209 } | |
210 } | |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
211 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
212 |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
213 DicomToJsonFormat Convert(OrthancPluginDicomToJsonFormat format) |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
214 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
215 switch (format) |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
216 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
217 case OrthancPluginDicomToJsonFormat_Full: |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
218 return DicomToJsonFormat_Full; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
219 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
220 case OrthancPluginDicomToJsonFormat_Short: |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
221 return DicomToJsonFormat_Short; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
222 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
223 case OrthancPluginDicomToJsonFormat_Simple: |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
224 return DicomToJsonFormat_Simple; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
225 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
226 default: |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
227 throw OrthancException(ErrorCode_ParameterOutOfRange); |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
228 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
229 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
230 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1671
diff
changeset
|
231 |
1760
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
232 OrthancPluginIdentifierConstraint Convert(IdentifierConstraintType constraint) |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
233 { |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
234 switch (constraint) |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
235 { |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
236 case IdentifierConstraintType_Equal: |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
237 return OrthancPluginIdentifierConstraint_Equal; |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
238 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
239 case IdentifierConstraintType_GreaterOrEqual: |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
240 return OrthancPluginIdentifierConstraint_GreaterOrEqual; |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
241 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
242 case IdentifierConstraintType_SmallerOrEqual: |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
243 return OrthancPluginIdentifierConstraint_SmallerOrEqual; |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
244 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
245 case IdentifierConstraintType_Wildcard: |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
246 return OrthancPluginIdentifierConstraint_Wildcard; |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
247 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
248 default: |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
249 throw OrthancException(ErrorCode_ParameterOutOfRange); |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
250 } |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
251 } |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
252 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
253 |
1761
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
254 IdentifierConstraintType Convert(OrthancPluginIdentifierConstraint constraint) |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
255 { |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
256 switch (constraint) |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
257 { |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
258 case OrthancPluginIdentifierConstraint_Equal: |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
259 return IdentifierConstraintType_Equal; |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
260 |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
261 case OrthancPluginIdentifierConstraint_GreaterOrEqual: |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
262 return IdentifierConstraintType_GreaterOrEqual; |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
263 |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
264 case OrthancPluginIdentifierConstraint_SmallerOrEqual: |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
265 return IdentifierConstraintType_SmallerOrEqual; |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
266 |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
267 case OrthancPluginIdentifierConstraint_Wildcard: |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
268 return IdentifierConstraintType_Wildcard; |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
269 |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
270 default: |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
271 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
272 } |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
273 } |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
274 |
f4286d99ee0a
fix sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
275 |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
276 #if !defined(ORTHANC_ENABLE_DCMTK) || ORTHANC_ENABLE_DCMTK != 0 |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
277 DcmEVR Convert(OrthancPluginValueRepresentation vr) |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
278 { |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
279 switch (vr) |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
280 { |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
281 case OrthancPluginValueRepresentation_AE: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
282 return EVR_AE; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
283 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
284 case OrthancPluginValueRepresentation_AS: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
285 return EVR_AS; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
286 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
287 case OrthancPluginValueRepresentation_AT: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
288 return EVR_AT; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
289 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
290 case OrthancPluginValueRepresentation_CS: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
291 return EVR_CS; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
292 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
293 case OrthancPluginValueRepresentation_DA: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
294 return EVR_DA; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
295 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
296 case OrthancPluginValueRepresentation_DS: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
297 return EVR_DS; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
298 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
299 case OrthancPluginValueRepresentation_DT: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
300 return EVR_DT; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
301 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
302 case OrthancPluginValueRepresentation_FD: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
303 return EVR_FD; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
304 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
305 case OrthancPluginValueRepresentation_FL: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
306 return EVR_FL; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
307 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
308 case OrthancPluginValueRepresentation_IS: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
309 return EVR_IS; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
310 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
311 case OrthancPluginValueRepresentation_LO: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
312 return EVR_LO; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
313 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
314 case OrthancPluginValueRepresentation_LT: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
315 return EVR_LT; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
316 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
317 case OrthancPluginValueRepresentation_OB: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
318 return EVR_OB; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
319 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
320 case OrthancPluginValueRepresentation_OF: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
321 return EVR_OF; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
322 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
323 case OrthancPluginValueRepresentation_OW: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
324 return EVR_OW; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
325 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
326 case OrthancPluginValueRepresentation_PN: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
327 return EVR_PN; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
328 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
329 case OrthancPluginValueRepresentation_SH: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
330 return EVR_SH; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
331 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
332 case OrthancPluginValueRepresentation_SL: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
333 return EVR_SL; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
334 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
335 case OrthancPluginValueRepresentation_SQ: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
336 return EVR_SQ; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
337 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
338 case OrthancPluginValueRepresentation_SS: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
339 return EVR_SS; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
340 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
341 case OrthancPluginValueRepresentation_ST: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
342 return EVR_ST; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
343 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
344 case OrthancPluginValueRepresentation_TM: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
345 return EVR_TM; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
346 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
347 case OrthancPluginValueRepresentation_UI: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
348 return EVR_UI; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
349 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
350 case OrthancPluginValueRepresentation_UL: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
351 return EVR_UL; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
352 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
353 case OrthancPluginValueRepresentation_UN: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
354 return EVR_UN; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
355 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
356 case OrthancPluginValueRepresentation_US: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
357 return EVR_US; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
358 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
359 case OrthancPluginValueRepresentation_UT: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
360 return EVR_UT; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
361 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
362 default: |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
363 throw OrthancException(ErrorCode_ParameterOutOfRange); |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
364 } |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1646
diff
changeset
|
365 } |
1671
2f2e2ec17bc4
sample database plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
366 #endif |
1625 | 367 } |
368 } |