Mercurial > hg > orthanc
comparison Core/Enumerations_TransferSyntaxes.impl.h @ 3730:ae31ba2b09a6
toolbox: LookupTransferSyntax()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Mar 2020 15:06:22 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3729:982c24a70dfd | 3730:ae31ba2b09a6 |
---|---|
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 const char* GetTransferSyntaxUid(DicomTransferSyntax syntax) | |
38 { | |
39 switch (syntax) | |
40 { | |
41 case DicomTransferSyntax_LittleEndianImplicit: | |
42 return "1.2.840.10008.1.2"; | |
43 | |
44 case DicomTransferSyntax_LittleEndianExplicit: | |
45 return "1.2.840.10008.1.2.1"; | |
46 | |
47 case DicomTransferSyntax_DeflatedLittleEndianExplicit: | |
48 return "1.2.840.10008.1.2.1.99"; | |
49 | |
50 case DicomTransferSyntax_BigEndianExplicit: | |
51 return "1.2.840.10008.1.2.2"; | |
52 | |
53 case DicomTransferSyntax_JPEGProcess1: | |
54 return "1.2.840.10008.1.2.4.50"; | |
55 | |
56 case DicomTransferSyntax_JPEGProcess2_4: | |
57 return "1.2.840.10008.1.2.4.51"; | |
58 | |
59 case DicomTransferSyntax_JPEGProcess3_5: | |
60 return "1.2.840.10008.1.2.4.52"; | |
61 | |
62 case DicomTransferSyntax_JPEGProcess6_8: | |
63 return "1.2.840.10008.1.2.4.53"; | |
64 | |
65 case DicomTransferSyntax_JPEGProcess7_9: | |
66 return "1.2.840.10008.1.2.4.54"; | |
67 | |
68 case DicomTransferSyntax_JPEGProcess10_12: | |
69 return "1.2.840.10008.1.2.4.55"; | |
70 | |
71 case DicomTransferSyntax_JPEGProcess11_13: | |
72 return "1.2.840.10008.1.2.4.56"; | |
73 | |
74 case DicomTransferSyntax_JPEGProcess14: | |
75 return "1.2.840.10008.1.2.4.57"; | |
76 | |
77 case DicomTransferSyntax_JPEGProcess15: | |
78 return "1.2.840.10008.1.2.4.58"; | |
79 | |
80 case DicomTransferSyntax_JPEGProcess16_18: | |
81 return "1.2.840.10008.1.2.4.59"; | |
82 | |
83 case DicomTransferSyntax_JPEGProcess17_19: | |
84 return "1.2.840.10008.1.2.4.60"; | |
85 | |
86 case DicomTransferSyntax_JPEGProcess20_22: | |
87 return "1.2.840.10008.1.2.4.61"; | |
88 | |
89 case DicomTransferSyntax_JPEGProcess21_23: | |
90 return "1.2.840.10008.1.2.4.62"; | |
91 | |
92 case DicomTransferSyntax_JPEGProcess24_26: | |
93 return "1.2.840.10008.1.2.4.63"; | |
94 | |
95 case DicomTransferSyntax_JPEGProcess25_27: | |
96 return "1.2.840.10008.1.2.4.64"; | |
97 | |
98 case DicomTransferSyntax_JPEGProcess28: | |
99 return "1.2.840.10008.1.2.4.65"; | |
100 | |
101 case DicomTransferSyntax_JPEGProcess29: | |
102 return "1.2.840.10008.1.2.4.66"; | |
103 | |
104 case DicomTransferSyntax_JPEGProcess14SV1: | |
105 return "1.2.840.10008.1.2.4.70"; | |
106 | |
107 case DicomTransferSyntax_JPEGLSLossless: | |
108 return "1.2.840.10008.1.2.4.80"; | |
109 | |
110 case DicomTransferSyntax_JPEGLSLossy: | |
111 return "1.2.840.10008.1.2.4.81"; | |
112 | |
113 case DicomTransferSyntax_JPEG2000LosslessOnly: | |
114 return "1.2.840.10008.1.2.4.90"; | |
115 | |
116 case DicomTransferSyntax_JPEG2000: | |
117 return "1.2.840.10008.1.2.4.91"; | |
118 | |
119 case DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly: | |
120 return "1.2.840.10008.1.2.4.92"; | |
121 | |
122 case DicomTransferSyntax_JPEG2000Multicomponent: | |
123 return "1.2.840.10008.1.2.4.93"; | |
124 | |
125 case DicomTransferSyntax_JPIPReferenced: | |
126 return "1.2.840.10008.1.2.4.94"; | |
127 | |
128 case DicomTransferSyntax_JPIPReferencedDeflate: | |
129 return "1.2.840.10008.1.2.4.95"; | |
130 | |
131 case DicomTransferSyntax_MPEG2MainProfileAtMainLevel: | |
132 return "1.2.840.10008.1.2.4.100"; | |
133 | |
134 case DicomTransferSyntax_MPEG2MainProfileAtHighLevel: | |
135 return "1.2.840.10008.1.2.4.101"; | |
136 | |
137 case DicomTransferSyntax_MPEG4HighProfileLevel4_1: | |
138 return "1.2.840.10008.1.2.4.102"; | |
139 | |
140 case DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1: | |
141 return "1.2.840.10008.1.2.4.103"; | |
142 | |
143 case DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo: | |
144 return "1.2.840.10008.1.2.4.104"; | |
145 | |
146 case DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo: | |
147 return "1.2.840.10008.1.2.4.105"; | |
148 | |
149 case DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2: | |
150 return "1.2.840.10008.1.2.4.106"; | |
151 | |
152 case DicomTransferSyntax_HEVCMainProfileLevel5_1: | |
153 return "1.2.840.10008.1.2.4.107"; | |
154 | |
155 case DicomTransferSyntax_HEVCMain10ProfileLevel5_1: | |
156 return "1.2.840.10008.1.2.4.108"; | |
157 | |
158 case DicomTransferSyntax_RLELossless: | |
159 return "1.2.840.10008.1.2.5"; | |
160 | |
161 case DicomTransferSyntax_RFC2557MimeEncapsulation: | |
162 return "1.2.840.10008.1.2.6.1"; | |
163 | |
164 case DicomTransferSyntax_XML: | |
165 return "1.2.840.10008.1.2.6.2"; | |
166 | |
167 default: | |
168 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
169 } | |
170 } | |
171 | |
172 | |
173 bool IsRetiredTransferSyntax(DicomTransferSyntax syntax) | |
174 { | |
175 switch (syntax) | |
176 { | |
177 case DicomTransferSyntax_LittleEndianImplicit: | |
178 return false; | |
179 | |
180 case DicomTransferSyntax_LittleEndianExplicit: | |
181 return false; | |
182 | |
183 case DicomTransferSyntax_DeflatedLittleEndianExplicit: | |
184 return false; | |
185 | |
186 case DicomTransferSyntax_BigEndianExplicit: | |
187 return false; | |
188 | |
189 case DicomTransferSyntax_JPEGProcess1: | |
190 return false; | |
191 | |
192 case DicomTransferSyntax_JPEGProcess2_4: | |
193 return false; | |
194 | |
195 case DicomTransferSyntax_JPEGProcess3_5: | |
196 return true; | |
197 | |
198 case DicomTransferSyntax_JPEGProcess6_8: | |
199 return true; | |
200 | |
201 case DicomTransferSyntax_JPEGProcess7_9: | |
202 return true; | |
203 | |
204 case DicomTransferSyntax_JPEGProcess10_12: | |
205 return true; | |
206 | |
207 case DicomTransferSyntax_JPEGProcess11_13: | |
208 return true; | |
209 | |
210 case DicomTransferSyntax_JPEGProcess14: | |
211 return false; | |
212 | |
213 case DicomTransferSyntax_JPEGProcess15: | |
214 return true; | |
215 | |
216 case DicomTransferSyntax_JPEGProcess16_18: | |
217 return true; | |
218 | |
219 case DicomTransferSyntax_JPEGProcess17_19: | |
220 return true; | |
221 | |
222 case DicomTransferSyntax_JPEGProcess20_22: | |
223 return true; | |
224 | |
225 case DicomTransferSyntax_JPEGProcess21_23: | |
226 return true; | |
227 | |
228 case DicomTransferSyntax_JPEGProcess24_26: | |
229 return true; | |
230 | |
231 case DicomTransferSyntax_JPEGProcess25_27: | |
232 return true; | |
233 | |
234 case DicomTransferSyntax_JPEGProcess28: | |
235 return true; | |
236 | |
237 case DicomTransferSyntax_JPEGProcess29: | |
238 return true; | |
239 | |
240 case DicomTransferSyntax_JPEGProcess14SV1: | |
241 return false; | |
242 | |
243 case DicomTransferSyntax_JPEGLSLossless: | |
244 return false; | |
245 | |
246 case DicomTransferSyntax_JPEGLSLossy: | |
247 return false; | |
248 | |
249 case DicomTransferSyntax_JPEG2000LosslessOnly: | |
250 return false; | |
251 | |
252 case DicomTransferSyntax_JPEG2000: | |
253 return false; | |
254 | |
255 case DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly: | |
256 return false; | |
257 | |
258 case DicomTransferSyntax_JPEG2000Multicomponent: | |
259 return false; | |
260 | |
261 case DicomTransferSyntax_JPIPReferenced: | |
262 return false; | |
263 | |
264 case DicomTransferSyntax_JPIPReferencedDeflate: | |
265 return false; | |
266 | |
267 case DicomTransferSyntax_MPEG2MainProfileAtMainLevel: | |
268 return false; | |
269 | |
270 case DicomTransferSyntax_MPEG2MainProfileAtHighLevel: | |
271 return false; | |
272 | |
273 case DicomTransferSyntax_MPEG4HighProfileLevel4_1: | |
274 return false; | |
275 | |
276 case DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1: | |
277 return false; | |
278 | |
279 case DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo: | |
280 return false; | |
281 | |
282 case DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo: | |
283 return false; | |
284 | |
285 case DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2: | |
286 return false; | |
287 | |
288 case DicomTransferSyntax_HEVCMainProfileLevel5_1: | |
289 return false; | |
290 | |
291 case DicomTransferSyntax_HEVCMain10ProfileLevel5_1: | |
292 return false; | |
293 | |
294 case DicomTransferSyntax_RLELossless: | |
295 return false; | |
296 | |
297 case DicomTransferSyntax_RFC2557MimeEncapsulation: | |
298 return true; | |
299 | |
300 case DicomTransferSyntax_XML: | |
301 return true; | |
302 | |
303 default: | |
304 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
305 } | |
306 } | |
307 | |
308 | |
309 bool LookupTransferSyntax(DicomTransferSyntax& target, | |
310 const std::string& uid) | |
311 { | |
312 if (uid == "1.2.840.10008.1.2") | |
313 { | |
314 target = DicomTransferSyntax_LittleEndianImplicit; | |
315 return true; | |
316 } | |
317 | |
318 if (uid == "1.2.840.10008.1.2.1") | |
319 { | |
320 target = DicomTransferSyntax_LittleEndianExplicit; | |
321 return true; | |
322 } | |
323 | |
324 if (uid == "1.2.840.10008.1.2.1.99") | |
325 { | |
326 target = DicomTransferSyntax_DeflatedLittleEndianExplicit; | |
327 return true; | |
328 } | |
329 | |
330 if (uid == "1.2.840.10008.1.2.2") | |
331 { | |
332 target = DicomTransferSyntax_BigEndianExplicit; | |
333 return true; | |
334 } | |
335 | |
336 if (uid == "1.2.840.10008.1.2.4.50") | |
337 { | |
338 target = DicomTransferSyntax_JPEGProcess1; | |
339 return true; | |
340 } | |
341 | |
342 if (uid == "1.2.840.10008.1.2.4.51") | |
343 { | |
344 target = DicomTransferSyntax_JPEGProcess2_4; | |
345 return true; | |
346 } | |
347 | |
348 if (uid == "1.2.840.10008.1.2.4.52") | |
349 { | |
350 target = DicomTransferSyntax_JPEGProcess3_5; | |
351 return true; | |
352 } | |
353 | |
354 if (uid == "1.2.840.10008.1.2.4.53") | |
355 { | |
356 target = DicomTransferSyntax_JPEGProcess6_8; | |
357 return true; | |
358 } | |
359 | |
360 if (uid == "1.2.840.10008.1.2.4.54") | |
361 { | |
362 target = DicomTransferSyntax_JPEGProcess7_9; | |
363 return true; | |
364 } | |
365 | |
366 if (uid == "1.2.840.10008.1.2.4.55") | |
367 { | |
368 target = DicomTransferSyntax_JPEGProcess10_12; | |
369 return true; | |
370 } | |
371 | |
372 if (uid == "1.2.840.10008.1.2.4.56") | |
373 { | |
374 target = DicomTransferSyntax_JPEGProcess11_13; | |
375 return true; | |
376 } | |
377 | |
378 if (uid == "1.2.840.10008.1.2.4.57") | |
379 { | |
380 target = DicomTransferSyntax_JPEGProcess14; | |
381 return true; | |
382 } | |
383 | |
384 if (uid == "1.2.840.10008.1.2.4.58") | |
385 { | |
386 target = DicomTransferSyntax_JPEGProcess15; | |
387 return true; | |
388 } | |
389 | |
390 if (uid == "1.2.840.10008.1.2.4.59") | |
391 { | |
392 target = DicomTransferSyntax_JPEGProcess16_18; | |
393 return true; | |
394 } | |
395 | |
396 if (uid == "1.2.840.10008.1.2.4.60") | |
397 { | |
398 target = DicomTransferSyntax_JPEGProcess17_19; | |
399 return true; | |
400 } | |
401 | |
402 if (uid == "1.2.840.10008.1.2.4.61") | |
403 { | |
404 target = DicomTransferSyntax_JPEGProcess20_22; | |
405 return true; | |
406 } | |
407 | |
408 if (uid == "1.2.840.10008.1.2.4.62") | |
409 { | |
410 target = DicomTransferSyntax_JPEGProcess21_23; | |
411 return true; | |
412 } | |
413 | |
414 if (uid == "1.2.840.10008.1.2.4.63") | |
415 { | |
416 target = DicomTransferSyntax_JPEGProcess24_26; | |
417 return true; | |
418 } | |
419 | |
420 if (uid == "1.2.840.10008.1.2.4.64") | |
421 { | |
422 target = DicomTransferSyntax_JPEGProcess25_27; | |
423 return true; | |
424 } | |
425 | |
426 if (uid == "1.2.840.10008.1.2.4.65") | |
427 { | |
428 target = DicomTransferSyntax_JPEGProcess28; | |
429 return true; | |
430 } | |
431 | |
432 if (uid == "1.2.840.10008.1.2.4.66") | |
433 { | |
434 target = DicomTransferSyntax_JPEGProcess29; | |
435 return true; | |
436 } | |
437 | |
438 if (uid == "1.2.840.10008.1.2.4.70") | |
439 { | |
440 target = DicomTransferSyntax_JPEGProcess14SV1; | |
441 return true; | |
442 } | |
443 | |
444 if (uid == "1.2.840.10008.1.2.4.80") | |
445 { | |
446 target = DicomTransferSyntax_JPEGLSLossless; | |
447 return true; | |
448 } | |
449 | |
450 if (uid == "1.2.840.10008.1.2.4.81") | |
451 { | |
452 target = DicomTransferSyntax_JPEGLSLossy; | |
453 return true; | |
454 } | |
455 | |
456 if (uid == "1.2.840.10008.1.2.4.90") | |
457 { | |
458 target = DicomTransferSyntax_JPEG2000LosslessOnly; | |
459 return true; | |
460 } | |
461 | |
462 if (uid == "1.2.840.10008.1.2.4.91") | |
463 { | |
464 target = DicomTransferSyntax_JPEG2000; | |
465 return true; | |
466 } | |
467 | |
468 if (uid == "1.2.840.10008.1.2.4.92") | |
469 { | |
470 target = DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly; | |
471 return true; | |
472 } | |
473 | |
474 if (uid == "1.2.840.10008.1.2.4.93") | |
475 { | |
476 target = DicomTransferSyntax_JPEG2000Multicomponent; | |
477 return true; | |
478 } | |
479 | |
480 if (uid == "1.2.840.10008.1.2.4.94") | |
481 { | |
482 target = DicomTransferSyntax_JPIPReferenced; | |
483 return true; | |
484 } | |
485 | |
486 if (uid == "1.2.840.10008.1.2.4.95") | |
487 { | |
488 target = DicomTransferSyntax_JPIPReferencedDeflate; | |
489 return true; | |
490 } | |
491 | |
492 if (uid == "1.2.840.10008.1.2.4.100") | |
493 { | |
494 target = DicomTransferSyntax_MPEG2MainProfileAtMainLevel; | |
495 return true; | |
496 } | |
497 | |
498 if (uid == "1.2.840.10008.1.2.4.101") | |
499 { | |
500 target = DicomTransferSyntax_MPEG2MainProfileAtHighLevel; | |
501 return true; | |
502 } | |
503 | |
504 if (uid == "1.2.840.10008.1.2.4.102") | |
505 { | |
506 target = DicomTransferSyntax_MPEG4HighProfileLevel4_1; | |
507 return true; | |
508 } | |
509 | |
510 if (uid == "1.2.840.10008.1.2.4.103") | |
511 { | |
512 target = DicomTransferSyntax_MPEG4BDcompatibleHighProfileLevel4_1; | |
513 return true; | |
514 } | |
515 | |
516 if (uid == "1.2.840.10008.1.2.4.104") | |
517 { | |
518 target = DicomTransferSyntax_MPEG4HighProfileLevel4_2_For2DVideo; | |
519 return true; | |
520 } | |
521 | |
522 if (uid == "1.2.840.10008.1.2.4.105") | |
523 { | |
524 target = DicomTransferSyntax_MPEG4HighProfileLevel4_2_For3DVideo; | |
525 return true; | |
526 } | |
527 | |
528 if (uid == "1.2.840.10008.1.2.4.106") | |
529 { | |
530 target = DicomTransferSyntax_MPEG4StereoHighProfileLevel4_2; | |
531 return true; | |
532 } | |
533 | |
534 if (uid == "1.2.840.10008.1.2.4.107") | |
535 { | |
536 target = DicomTransferSyntax_HEVCMainProfileLevel5_1; | |
537 return true; | |
538 } | |
539 | |
540 if (uid == "1.2.840.10008.1.2.4.108") | |
541 { | |
542 target = DicomTransferSyntax_HEVCMain10ProfileLevel5_1; | |
543 return true; | |
544 } | |
545 | |
546 if (uid == "1.2.840.10008.1.2.5") | |
547 { | |
548 target = DicomTransferSyntax_RLELossless; | |
549 return true; | |
550 } | |
551 | |
552 if (uid == "1.2.840.10008.1.2.6.1") | |
553 { | |
554 target = DicomTransferSyntax_RFC2557MimeEncapsulation; | |
555 return true; | |
556 } | |
557 | |
558 if (uid == "1.2.840.10008.1.2.6.2") | |
559 { | |
560 target = DicomTransferSyntax_XML; | |
561 return true; | |
562 } | |
563 | |
564 return false; | |
565 } | |
566 } |