comparison OrthancFramework/Sources/DicomParsing/FromDcmtkBridge_TransferSyntaxes.impl.h @ 4044:d25f4c0fa160 framework

splitting code into OrthancFramework and OrthancServer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jun 2020 20:30:34 +0200
parents Core/DicomParsing/FromDcmtkBridge_TransferSyntaxes.impl.h@eb044cc49d51
children bf7b9edf6b81
comparison
equal deleted inserted replaced
4043:6c6239aec462 4044:d25f4c0fa160
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
11 *
12 * In addition, as a special exception, the copyright holders of this
13 * program give permission to link the code of its release with the
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
15 * that use the same license as the "OpenSSL" library), and distribute
16 * the linked executables. You must obey the GNU General Public License
17 * in all respects for all of the code used other than "OpenSSL". If you
18 * modify file(s) with this exception, you may extend this exception to
19 * your version of the file(s), but you are not obligated to do so. If
20 * you do not wish to do so, delete this exception statement from your
21 * version. If you delete this exception statement from all source files
22 * in the program, then also delete it here.
23 *
24 * This program is distributed in the hope that it will be useful, but
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public License
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31 **/
32
33 // This file is autogenerated by "../Resources/GenerateTransferSyntaxes.py"
34
35 namespace Orthanc
36 {
37 bool FromDcmtkBridge::LookupDcmtkTransferSyntax(E_TransferSyntax& target,
38 DicomTransferSyntax source)
39 {
40 switch (source)
41 {
42 case DicomTransferSyntax_LittleEndianImplicit:
43 target = EXS_LittleEndianImplicit;
44 return true;
45
46 case DicomTransferSyntax_LittleEndianExplicit:
47 target = EXS_LittleEndianExplicit;
48 return true;
49
50 case DicomTransferSyntax_DeflatedLittleEndianExplicit:
51 target = EXS_DeflatedLittleEndianExplicit;
52 return true;
53
54 case DicomTransferSyntax_BigEndianExplicit:
55 target = EXS_BigEndianExplicit;
56 return true;
57
58 case DicomTransferSyntax_JPEGProcess1:
59 # if DCMTK_VERSION_NUMBER <= 360
60 target = EXS_JPEGProcess1TransferSyntax;
61 # else
62 target = EXS_JPEGProcess1;
63 # endif
64 return true;
65
66 case DicomTransferSyntax_JPEGProcess2_4:
67 # if DCMTK_VERSION_NUMBER <= 360
68 target = EXS_JPEGProcess2_4TransferSyntax;
69 # else
70 target = EXS_JPEGProcess2_4;
71 # endif
72 return true;
73
74 case DicomTransferSyntax_JPEGProcess3_5:
75 # if DCMTK_VERSION_NUMBER <= 360
76 target = EXS_JPEGProcess3_5TransferSyntax;
77 # else
78 target = EXS_JPEGProcess3_5;
79 # endif
80 return true;
81
82 case DicomTransferSyntax_JPEGProcess6_8:
83 # if DCMTK_VERSION_NUMBER <= 360
84 target = EXS_JPEGProcess6_8TransferSyntax;
85 # else
86 target = EXS_JPEGProcess6_8;
87 # endif
88 return true;
89
90 case DicomTransferSyntax_JPEGProcess7_9:
91 # if DCMTK_VERSION_NUMBER <= 360
92 target = EXS_JPEGProcess7_9TransferSyntax;
93 # else
94 target = EXS_JPEGProcess7_9;
95 # endif
96 return true;
97
98 case DicomTransferSyntax_JPEGProcess10_12:
99 # if DCMTK_VERSION_NUMBER <= 360
100 target = EXS_JPEGProcess10_12TransferSyntax;
101 # else
102 target = EXS_JPEGProcess10_12;
103 # endif
104 return true;
105
106 case DicomTransferSyntax_JPEGProcess11_13:
107 # if DCMTK_VERSION_NUMBER <= 360
108 target = EXS_JPEGProcess11_13TransferSyntax;
109 # else
110 target = EXS_JPEGProcess11_13;
111 # endif
112 return true;
113
114 case DicomTransferSyntax_JPEGProcess14:
115 # if DCMTK_VERSION_NUMBER <= 360
116 target = EXS_JPEGProcess14TransferSyntax;
117 # else
118 target = EXS_JPEGProcess14;
119 # endif
120 return true;
121
122 case DicomTransferSyntax_JPEGProcess15:
123 # if DCMTK_VERSION_NUMBER <= 360
124 target = EXS_JPEGProcess15TransferSyntax;
125 # else
126 target = EXS_JPEGProcess15;
127 # endif
128 return true;
129
130 case DicomTransferSyntax_JPEGProcess16_18:
131 # if DCMTK_VERSION_NUMBER <= 360
132 target = EXS_JPEGProcess16_18TransferSyntax;
133 # else
134 target = EXS_JPEGProcess16_18;
135 # endif
136 return true;
137
138 case DicomTransferSyntax_JPEGProcess17_19:
139 # if DCMTK_VERSION_NUMBER <= 360
140 target = EXS_JPEGProcess17_19TransferSyntax;
141 # else
142 target = EXS_JPEGProcess17_19;
143 # endif
144 return true;
145
146 case DicomTransferSyntax_JPEGProcess20_22:
147 # if DCMTK_VERSION_NUMBER <= 360
148 target = EXS_JPEGProcess20_22TransferSyntax;
149 # else
150 target = EXS_JPEGProcess20_22;
151 # endif
152 return true;
153
154 case DicomTransferSyntax_JPEGProcess21_23:
155 # if DCMTK_VERSION_NUMBER <= 360
156 target = EXS_JPEGProcess21_23TransferSyntax;
157 # else
158 target = EXS_JPEGProcess21_23;
159 # endif
160 return true;
161
162 case DicomTransferSyntax_JPEGProcess24_26:
163 # if DCMTK_VERSION_NUMBER <= 360
164 target = EXS_JPEGProcess24_26TransferSyntax;
165 # else
166 target = EXS_JPEGProcess24_26;
167 # endif
168 return true;
169
170 case DicomTransferSyntax_JPEGProcess25_27:
171 # if DCMTK_VERSION_NUMBER <= 360
172 target = EXS_JPEGProcess25_27TransferSyntax;
173 # else
174 target = EXS_JPEGProcess25_27;
175 # endif
176 return true;
177
178 case DicomTransferSyntax_JPEGProcess28:
179 # if DCMTK_VERSION_NUMBER <= 360
180 target = EXS_JPEGProcess28TransferSyntax;
181 # else
182 target = EXS_JPEGProcess28;
183 # endif
184 return true;
185
186 case DicomTransferSyntax_JPEGProcess29:
187 # if DCMTK_VERSION_NUMBER <= 360
188 target = EXS_JPEGProcess29TransferSyntax;
189 # else
190 target = EXS_JPEGProcess29;
191 # endif
192 return true;
193
194 case DicomTransferSyntax_JPEGProcess14SV1:
195 # if DCMTK_VERSION_NUMBER <= 360
196 target = EXS_JPEGProcess14SV1TransferSyntax;
197 # else
198 target = EXS_JPEGProcess14SV1;
199 # endif
200 return true;
201
202 case DicomTransferSyntax_JPEGLSLossless:
203 target = EXS_JPEGLSLossless;
204 return true;
205
206 case DicomTransferSyntax_JPEGLSLossy:
207 target = EXS_JPEGLSLossy;
208 return true;
209
210 case DicomTransferSyntax_JPEG2000LosslessOnly:
211 target = EXS_JPEG2000LosslessOnly;
212 return true;
213
214 case DicomTransferSyntax_JPEG2000:
215 target = EXS_JPEG2000;
216 return true;
217
218 case DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly:
219 target = EXS_JPEG2000MulticomponentLosslessOnly;
220 return true;
221
222 case DicomTransferSyntax_JPEG2000Multicomponent:
223 target = EXS_JPEG2000Multicomponent;
224 return true;
225
226 case DicomTransferSyntax_JPIPReferenced:
227 target = EXS_JPIPReferenced;
228 return true;
229
230 case DicomTransferSyntax_JPIPReferencedDeflate:
231 target = EXS_JPIPReferencedDeflate;
232 return true;
233
234 case DicomTransferSyntax_MPEG2MainProfileAtMainLevel:
235 target = EXS_MPEG2MainProfileAtMainLevel;
236 return true;
237
238 case DicomTransferSyntax_MPEG2MainProfileAtHighLevel:
239 target = EXS_MPEG2MainProfileAtHighLevel;
240 return true;
241
242 #if DCMTK_VERSION_NUMBER >= 361
243 case DicomTransferSyntax_MPEG4HighProfileLevel4_1:
244 target = EXS_MPEG4HighProfileLevel4_1;
245 return true;
246 #endif
247
248 #if DCMTK_VERSION_NUMBER >= 361
249 case DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1:
250 target = EXS_MPEG4BDcompatibleHighProfileLevel4_1;
251 return true;
252 #endif
253
254 #if DCMTK_VERSION_NUMBER >= 361
255 case DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo:
256 target = EXS_MPEG4HighProfileLevel4_2_For2DVideo;
257 return true;
258 #endif
259
260 #if DCMTK_VERSION_NUMBER >= 361
261 case DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo:
262 target = EXS_MPEG4HighProfileLevel4_2_For3DVideo;
263 return true;
264 #endif
265
266 #if DCMTK_VERSION_NUMBER >= 361
267 case DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2:
268 target = EXS_MPEG4StereoHighProfileLevel4_2;
269 return true;
270 #endif
271
272 #if DCMTK_VERSION_NUMBER >= 362
273 case DicomTransferSyntax_HEVCMainProfileLevel5_1:
274 target = EXS_HEVCMainProfileLevel5_1;
275 return true;
276 #endif
277
278 #if DCMTK_VERSION_NUMBER >= 362
279 case DicomTransferSyntax_HEVCMain10ProfileLevel5_1:
280 target = EXS_HEVCMain10ProfileLevel5_1;
281 return true;
282 #endif
283
284 case DicomTransferSyntax_RLELossless:
285 target = EXS_RLELossless;
286 return true;
287
288 default:
289 return false;
290 }
291 }
292
293
294 bool FromDcmtkBridge::LookupOrthancTransferSyntax(DicomTransferSyntax& target,
295 E_TransferSyntax source)
296 {
297 switch (source)
298 {
299 case EXS_LittleEndianImplicit:
300 target = DicomTransferSyntax_LittleEndianImplicit;
301 return true;
302
303 case EXS_LittleEndianExplicit:
304 target = DicomTransferSyntax_LittleEndianExplicit;
305 return true;
306
307 case EXS_DeflatedLittleEndianExplicit:
308 target = DicomTransferSyntax_DeflatedLittleEndianExplicit;
309 return true;
310
311 case EXS_BigEndianExplicit:
312 target = DicomTransferSyntax_BigEndianExplicit;
313 return true;
314
315 # if DCMTK_VERSION_NUMBER <= 360
316 case EXS_JPEGProcess1TransferSyntax:
317 # else
318 case EXS_JPEGProcess1:
319 # endif
320 target = DicomTransferSyntax_JPEGProcess1;
321 return true;
322
323 # if DCMTK_VERSION_NUMBER <= 360
324 case EXS_JPEGProcess2_4TransferSyntax:
325 # else
326 case EXS_JPEGProcess2_4:
327 # endif
328 target = DicomTransferSyntax_JPEGProcess2_4;
329 return true;
330
331 # if DCMTK_VERSION_NUMBER <= 360
332 case EXS_JPEGProcess3_5TransferSyntax:
333 # else
334 case EXS_JPEGProcess3_5:
335 # endif
336 target = DicomTransferSyntax_JPEGProcess3_5;
337 return true;
338
339 # if DCMTK_VERSION_NUMBER <= 360
340 case EXS_JPEGProcess6_8TransferSyntax:
341 # else
342 case EXS_JPEGProcess6_8:
343 # endif
344 target = DicomTransferSyntax_JPEGProcess6_8;
345 return true;
346
347 # if DCMTK_VERSION_NUMBER <= 360
348 case EXS_JPEGProcess7_9TransferSyntax:
349 # else
350 case EXS_JPEGProcess7_9:
351 # endif
352 target = DicomTransferSyntax_JPEGProcess7_9;
353 return true;
354
355 # if DCMTK_VERSION_NUMBER <= 360
356 case EXS_JPEGProcess10_12TransferSyntax:
357 # else
358 case EXS_JPEGProcess10_12:
359 # endif
360 target = DicomTransferSyntax_JPEGProcess10_12;
361 return true;
362
363 # if DCMTK_VERSION_NUMBER <= 360
364 case EXS_JPEGProcess11_13TransferSyntax:
365 # else
366 case EXS_JPEGProcess11_13:
367 # endif
368 target = DicomTransferSyntax_JPEGProcess11_13;
369 return true;
370
371 # if DCMTK_VERSION_NUMBER <= 360
372 case EXS_JPEGProcess14TransferSyntax:
373 # else
374 case EXS_JPEGProcess14:
375 # endif
376 target = DicomTransferSyntax_JPEGProcess14;
377 return true;
378
379 # if DCMTK_VERSION_NUMBER <= 360
380 case EXS_JPEGProcess15TransferSyntax:
381 # else
382 case EXS_JPEGProcess15:
383 # endif
384 target = DicomTransferSyntax_JPEGProcess15;
385 return true;
386
387 # if DCMTK_VERSION_NUMBER <= 360
388 case EXS_JPEGProcess16_18TransferSyntax:
389 # else
390 case EXS_JPEGProcess16_18:
391 # endif
392 target = DicomTransferSyntax_JPEGProcess16_18;
393 return true;
394
395 # if DCMTK_VERSION_NUMBER <= 360
396 case EXS_JPEGProcess17_19TransferSyntax:
397 # else
398 case EXS_JPEGProcess17_19:
399 # endif
400 target = DicomTransferSyntax_JPEGProcess17_19;
401 return true;
402
403 # if DCMTK_VERSION_NUMBER <= 360
404 case EXS_JPEGProcess20_22TransferSyntax:
405 # else
406 case EXS_JPEGProcess20_22:
407 # endif
408 target = DicomTransferSyntax_JPEGProcess20_22;
409 return true;
410
411 # if DCMTK_VERSION_NUMBER <= 360
412 case EXS_JPEGProcess21_23TransferSyntax:
413 # else
414 case EXS_JPEGProcess21_23:
415 # endif
416 target = DicomTransferSyntax_JPEGProcess21_23;
417 return true;
418
419 # if DCMTK_VERSION_NUMBER <= 360
420 case EXS_JPEGProcess24_26TransferSyntax:
421 # else
422 case EXS_JPEGProcess24_26:
423 # endif
424 target = DicomTransferSyntax_JPEGProcess24_26;
425 return true;
426
427 # if DCMTK_VERSION_NUMBER <= 360
428 case EXS_JPEGProcess25_27TransferSyntax:
429 # else
430 case EXS_JPEGProcess25_27:
431 # endif
432 target = DicomTransferSyntax_JPEGProcess25_27;
433 return true;
434
435 # if DCMTK_VERSION_NUMBER <= 360
436 case EXS_JPEGProcess28TransferSyntax:
437 # else
438 case EXS_JPEGProcess28:
439 # endif
440 target = DicomTransferSyntax_JPEGProcess28;
441 return true;
442
443 # if DCMTK_VERSION_NUMBER <= 360
444 case EXS_JPEGProcess29TransferSyntax:
445 # else
446 case EXS_JPEGProcess29:
447 # endif
448 target = DicomTransferSyntax_JPEGProcess29;
449 return true;
450
451 # if DCMTK_VERSION_NUMBER <= 360
452 case EXS_JPEGProcess14SV1TransferSyntax:
453 # else
454 case EXS_JPEGProcess14SV1:
455 # endif
456 target = DicomTransferSyntax_JPEGProcess14SV1;
457 return true;
458
459 case EXS_JPEGLSLossless:
460 target = DicomTransferSyntax_JPEGLSLossless;
461 return true;
462
463 case EXS_JPEGLSLossy:
464 target = DicomTransferSyntax_JPEGLSLossy;
465 return true;
466
467 case EXS_JPEG2000LosslessOnly:
468 target = DicomTransferSyntax_JPEG2000LosslessOnly;
469 return true;
470
471 case EXS_JPEG2000:
472 target = DicomTransferSyntax_JPEG2000;
473 return true;
474
475 case EXS_JPEG2000MulticomponentLosslessOnly:
476 target = DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly;
477 return true;
478
479 case EXS_JPEG2000Multicomponent:
480 target = DicomTransferSyntax_JPEG2000Multicomponent;
481 return true;
482
483 case EXS_JPIPReferenced:
484 target = DicomTransferSyntax_JPIPReferenced;
485 return true;
486
487 case EXS_JPIPReferencedDeflate:
488 target = DicomTransferSyntax_JPIPReferencedDeflate;
489 return true;
490
491 case EXS_MPEG2MainProfileAtMainLevel:
492 target = DicomTransferSyntax_MPEG2MainProfileAtMainLevel;
493 return true;
494
495 case EXS_MPEG2MainProfileAtHighLevel:
496 target = DicomTransferSyntax_MPEG2MainProfileAtHighLevel;
497 return true;
498
499 #if DCMTK_VERSION_NUMBER >= 361
500 case EXS_MPEG4HighProfileLevel4_1:
501 target = DicomTransferSyntax_MPEG4HighProfileLevel4_1;
502 return true;
503 #endif
504
505 #if DCMTK_VERSION_NUMBER >= 361
506 case EXS_MPEG4BDcompatibleHighProfileLevel4_1:
507 target = DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1;
508 return true;
509 #endif
510
511 #if DCMTK_VERSION_NUMBER >= 361
512 case EXS_MPEG4HighProfileLevel4_2_For2DVideo:
513 target = DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo;
514 return true;
515 #endif
516
517 #if DCMTK_VERSION_NUMBER >= 361
518 case EXS_MPEG4HighProfileLevel4_2_For3DVideo:
519 target = DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo;
520 return true;
521 #endif
522
523 #if DCMTK_VERSION_NUMBER >= 361
524 case EXS_MPEG4StereoHighProfileLevel4_2:
525 target = DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2;
526 return true;
527 #endif
528
529 #if DCMTK_VERSION_NUMBER >= 362
530 case EXS_HEVCMainProfileLevel5_1:
531 target = DicomTransferSyntax_HEVCMainProfileLevel5_1;
532 return true;
533 #endif
534
535 #if DCMTK_VERSION_NUMBER >= 362
536 case EXS_HEVCMain10ProfileLevel5_1:
537 target = DicomTransferSyntax_HEVCMain10ProfileLevel5_1;
538 return true;
539 #endif
540
541 case EXS_RLELossless:
542 target = DicomTransferSyntax_RLELossless;
543 return true;
544
545 default:
546 return false;
547 }
548 }
549 }