Mercurial > hg > orthanc
annotate OrthancFramework/Sources/Enumerations.cpp @ 5426:c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 16 Nov 2023 16:09:04 +0100 |
parents | 3206537cbb56 |
children | 7a20ee948676 |
rev | line source |
---|---|
477 | 1 /** |
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:
1206
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
5185
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5113
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5113
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
477 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4074
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4074
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4074
diff
changeset
|
11 * the License, or (at your option) any later version. |
477 | 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 | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4074
diff
changeset
|
16 * Lesser General Public License for more details. |
477 | 17 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4074
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4074
diff
changeset
|
19 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4074
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
477 | 21 **/ |
22 | |
23 | |
824
a811bdf8b8eb
precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
800
diff
changeset
|
24 #include "PrecompiledHeaders.h" |
477 | 25 #include "Enumerations.h" |
26 | |
5398
08b5516c6e5e
compatibility of OrthancFramework with latest releases of Emscripten
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5383
diff
changeset
|
27 #include "Logging.h" |
08b5516c6e5e
compatibility of OrthancFramework with latest releases of Emscripten
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5383
diff
changeset
|
28 #include "MultiThreading/Mutex.h" |
477 | 29 #include "OrthancException.h" |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
30 #include "Toolbox.h" |
5398
08b5516c6e5e
compatibility of OrthancFramework with latest releases of Emscripten
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5383
diff
changeset
|
31 |
1495
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
32 #include <string.h> |
1993
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
33 #include <cassert> |
5291
800261398381
Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
34 #include <boost/algorithm/string/replace.hpp> |
1495
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
35 |
477 | 36 namespace Orthanc |
37 { | |
1578 | 38 // This function is autogenerated by the script |
4932
b7ce2bb6b881
refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents:
4912
diff
changeset
|
39 // "Resources/CodeGeneration/GenerateErrorCodes.py" |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
40 const char* EnumerationToString(ErrorCode error) |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
41 { |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
42 switch (error) |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
43 { |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
44 case ErrorCode_InternalError: |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
45 return "Internal error"; |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
46 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
47 case ErrorCode_Success: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
48 return "Success"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
49 |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
50 case ErrorCode_Plugin: |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
51 return "Error encountered within the plugin engine"; |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
52 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
53 case ErrorCode_NotImplemented: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
54 return "Not implemented yet"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
55 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
56 case ErrorCode_ParameterOutOfRange: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
57 return "Parameter out of range"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
58 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
59 case ErrorCode_NotEnoughMemory: |
2133 | 60 return "The server hosting Orthanc is running out of memory"; |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
61 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
62 case ErrorCode_BadParameterType: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
63 return "Bad type for a parameter"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
64 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
65 case ErrorCode_BadSequenceOfCalls: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
66 return "Bad sequence of calls"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
67 |
1577
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
68 case ErrorCode_InexistentItem: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
69 return "Accessing an inexistent item"; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
70 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
71 case ErrorCode_BadRequest: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
72 return "Bad request"; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
73 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
74 case ErrorCode_NetworkProtocol: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
75 return "Error in the network protocol"; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
76 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
77 case ErrorCode_SystemCommand: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
78 return "Error while calling a system command"; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
79 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
80 case ErrorCode_Database: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
81 return "Error with the database engine"; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
82 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
83 case ErrorCode_UriSyntax: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
84 return "Badly formatted URI"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
85 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
86 case ErrorCode_InexistentFile: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
87 return "Inexistent file"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
88 |
1577
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
89 case ErrorCode_CannotWriteFile: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
90 return "Cannot write to file"; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
91 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
92 case ErrorCode_BadFileFormat: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
93 return "Bad file format"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
94 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
95 case ErrorCode_Timeout: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
96 return "Timeout"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
97 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
98 case ErrorCode_UnknownResource: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
99 return "Unknown resource"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
100 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
101 case ErrorCode_IncompatibleDatabaseVersion: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
102 return "Incompatible version of the database"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
103 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
104 case ErrorCode_FullStorage: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
105 return "The file storage is full"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
106 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
107 case ErrorCode_CorruptedFile: |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
108 return "Corrupted file (e.g. inconsistent MD5 hash)"; |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
109 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
110 case ErrorCode_InexistentTag: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
111 return "Inexistent tag"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
112 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
113 case ErrorCode_ReadOnly: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
114 return "Cannot modify a read-only data structure"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
115 |
1577
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
116 case ErrorCode_IncompatibleImageFormat: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
117 return "Incompatible format of the images"; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
118 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
119 case ErrorCode_IncompatibleImageSize: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
120 return "Incompatible size of the images"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
121 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
122 case ErrorCode_SharedLibrary: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
123 return "Error while using a shared library (plugin)"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
124 |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
125 case ErrorCode_UnknownPluginService: |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
126 return "Plugin invoking an unknown service"; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
127 |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
128 case ErrorCode_UnknownDicomTag: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
129 return "Unknown DICOM tag"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
130 |
1596
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
131 case ErrorCode_BadJson: |
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
132 return "Cannot parse a JSON document"; |
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
133 |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
134 case ErrorCode_Unauthorized: |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
135 return "Bad credentials were provided to an HTTP request"; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
136 |
1610
2dff2bdffdb8
font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
137 case ErrorCode_BadFont: |
2dff2bdffdb8
font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
138 return "Badly formatted font file"; |
2dff2bdffdb8
font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
139 |
1643
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
140 case ErrorCode_DatabasePlugin: |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
141 return "The plugin implementing a custom database back-end does not fulfill the proper interface"; |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
142 |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
143 case ErrorCode_StorageAreaPlugin: |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
144 return "Error in the plugin implementing a custom storage area"; |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
145 |
1746 | 146 case ErrorCode_EmptyRequest: |
147 return "The request is empty"; | |
148 | |
1781
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
149 case ErrorCode_NotAcceptable: |
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
150 return "Cannot send a response which is acceptable according to the Accept HTTP header"; |
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
151 |
2132
a43708636890
ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2089
diff
changeset
|
152 case ErrorCode_NullPointer: |
a43708636890
ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2089
diff
changeset
|
153 return "Cannot handle a NULL pointer"; |
a43708636890
ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2089
diff
changeset
|
154 |
2486
ad8f30fc28d1
new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
155 case ErrorCode_DatabaseUnavailable: |
ad8f30fc28d1
new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
156 return "The database is currently not available (probably a transient situation)"; |
ad8f30fc28d1
new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
157 |
2581
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2569
diff
changeset
|
158 case ErrorCode_CanceledJob: |
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2569
diff
changeset
|
159 return "This job was canceled"; |
8da2cffc2378
JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2569
diff
changeset
|
160 |
3376
56ea9c476dba
new error code for Stone: BadGeometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3226
diff
changeset
|
161 case ErrorCode_BadGeometry: |
56ea9c476dba
new error code for Stone: BadGeometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3226
diff
changeset
|
162 return "Geometry error encountered in Stone"; |
56ea9c476dba
new error code for Stone: BadGeometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3226
diff
changeset
|
163 |
3801
9fe1d64a748c
upgrade to civetweb 1.12, error reporting if OpenSSL failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3737
diff
changeset
|
164 case ErrorCode_SslInitialization: |
9fe1d64a748c
upgrade to civetweb 1.12, error reporting if OpenSSL failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3737
diff
changeset
|
165 return "Cannot initialize SSL encryption, check out your certificates"; |
9fe1d64a748c
upgrade to civetweb 1.12, error reporting if OpenSSL failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3737
diff
changeset
|
166 |
4347
3dffe8f7af48
new error code: ErrorCode_DiscontinuedAbi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4245
diff
changeset
|
167 case ErrorCode_DiscontinuedAbi: |
3dffe8f7af48
new error code: ErrorCode_DiscontinuedAbi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4245
diff
changeset
|
168 return "Calling a function that has been removed from the Orthanc Framework"; |
3dffe8f7af48
new error code: ErrorCode_DiscontinuedAbi
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4245
diff
changeset
|
169 |
4442
f77ee6e6cf47
new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
170 case ErrorCode_BadRange: |
f77ee6e6cf47
new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
171 return "Incorrect range request"; |
f77ee6e6cf47
new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
172 |
4551
350a22c094f2
testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
173 case ErrorCode_DatabaseCannotSerialize: |
350a22c094f2
testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
174 return "Database could not serialize access due to concurrent update, the transaction should be retried"; |
350a22c094f2
testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
175 |
4608
de5e6b04442d
added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4551
diff
changeset
|
176 case ErrorCode_Revision: |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4608
diff
changeset
|
177 return "A bad revision number was provided, which might indicate conflict between multiple writers"; |
4608
de5e6b04442d
added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4551
diff
changeset
|
178 |
4932
b7ce2bb6b881
refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents:
4912
diff
changeset
|
179 case ErrorCode_MainDicomTagsMultiplyDefined: |
b7ce2bb6b881
refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents:
4912
diff
changeset
|
180 return "A main DICOM Tag has been defined multiple times for the same resource level"; |
b7ce2bb6b881
refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents:
4912
diff
changeset
|
181 |
5383 | 182 case ErrorCode_ForbiddenAccess: |
183 return "Access to a resource is forbidden"; | |
184 | |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
185 case ErrorCode_SQLiteNotOpened: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
186 return "SQLite: The database is not opened"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
187 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
188 case ErrorCode_SQLiteAlreadyOpened: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
189 return "SQLite: Connection is already open"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
190 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
191 case ErrorCode_SQLiteCannotOpen: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
192 return "SQLite: Unable to open the database"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
193 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
194 case ErrorCode_SQLiteStatementAlreadyUsed: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
195 return "SQLite: This cached statement is already being referred to"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
196 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
197 case ErrorCode_SQLiteExecute: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
198 return "SQLite: Cannot execute a command"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
199 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
200 case ErrorCode_SQLiteRollbackWithoutTransaction: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
201 return "SQLite: Rolling back a nonexistent transaction (have you called Begin()?)"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
202 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
203 case ErrorCode_SQLiteCommitWithoutTransaction: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
204 return "SQLite: Committing a nonexistent transaction"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
205 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
206 case ErrorCode_SQLiteRegisterFunction: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
207 return "SQLite: Unable to register a function"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
208 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
209 case ErrorCode_SQLiteFlush: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
210 return "SQLite: Unable to flush the database"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
211 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
212 case ErrorCode_SQLiteCannotRun: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
213 return "SQLite: Cannot run a cached statement"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
214 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
215 case ErrorCode_SQLiteCannotStep: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
216 return "SQLite: Cannot step over a cached statement"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
217 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
218 case ErrorCode_SQLiteBindOutOfRange: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
219 return "SQLite: Bing a value while out of range (serious error)"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
220 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
221 case ErrorCode_SQLitePrepareStatement: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
222 return "SQLite: Cannot prepare a cached statement"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
223 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
224 case ErrorCode_SQLiteTransactionAlreadyStarted: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
225 return "SQLite: Beginning the same transaction twice"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
226 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
227 case ErrorCode_SQLiteTransactionCommit: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
228 return "SQLite: Failure when committing the transaction"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
229 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
230 case ErrorCode_SQLiteTransactionBegin: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
231 return "SQLite: Cannot start a transaction"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
232 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
233 case ErrorCode_DirectoryOverFile: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
234 return "The directory to be created is already occupied by a regular file"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
235 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
236 case ErrorCode_FileStorageCannotWrite: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
237 return "Unable to create a subdirectory or a file in the file storage"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
238 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
239 case ErrorCode_DirectoryExpected: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
240 return "The specified path does not point to a directory"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
241 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
242 case ErrorCode_HttpPortInUse: |
1949
d90f737f2dde
warn about the use of privileged ports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1926
diff
changeset
|
243 return "The TCP port of the HTTP server is privileged or already in use"; |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
244 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
245 case ErrorCode_DicomPortInUse: |
1949
d90f737f2dde
warn about the use of privileged ports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1926
diff
changeset
|
246 return "The TCP port of the DICOM server is privileged or already in use"; |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
247 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
248 case ErrorCode_BadHttpStatusInRest: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
249 return "This HTTP status is not allowed in a REST API"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
250 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
251 case ErrorCode_RegularFileExpected: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
252 return "The specified path does not point to a regular file"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
253 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
254 case ErrorCode_PathToExecutable: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
255 return "Unable to get the path to the executable"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
256 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
257 case ErrorCode_MakeDirectory: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
258 return "Cannot create a directory"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
259 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
260 case ErrorCode_BadApplicationEntityTitle: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
261 return "An application entity title (AET) cannot be empty or be longer than 16 characters"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
262 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
263 case ErrorCode_NoCFindHandler: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
264 return "No request handler factory for DICOM C-FIND SCP"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
265 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
266 case ErrorCode_NoCMoveHandler: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
267 return "No request handler factory for DICOM C-MOVE SCP"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
268 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
269 case ErrorCode_NoCStoreHandler: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
270 return "No request handler factory for DICOM C-STORE SCP"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
271 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
272 case ErrorCode_NoApplicationEntityFilter: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
273 return "No application entity filter"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
274 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
275 case ErrorCode_NoSopClassOrInstance: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
276 return "DicomUserConnection: Unable to find the SOP class and instance"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
277 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
278 case ErrorCode_NoPresentationContext: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
279 return "DicomUserConnection: No acceptable presentation context for modality"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
280 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
281 case ErrorCode_DicomFindUnavailable: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
282 return "DicomUserConnection: The C-FIND command is not supported by the remote SCP"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
283 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
284 case ErrorCode_DicomMoveUnavailable: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
285 return "DicomUserConnection: The C-MOVE command is not supported by the remote SCP"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
286 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
287 case ErrorCode_CannotStoreInstance: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
288 return "Cannot store an instance"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
289 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
290 case ErrorCode_CreateDicomNotString: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
291 return "Only string values are supported when creating DICOM instances"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
292 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
293 case ErrorCode_CreateDicomOverrideTag: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
294 return "Trying to override a value inherited from a parent module"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
295 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
296 case ErrorCode_CreateDicomUseContent: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
297 return "Use \"Content\" to inject an image into a new DICOM instance"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
298 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
299 case ErrorCode_CreateDicomNoPayload: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
300 return "No payload is present for one instance in the series"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
301 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
302 case ErrorCode_CreateDicomUseDataUriScheme: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
303 return "The payload of the DICOM instance must be specified according to Data URI scheme"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
304 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
305 case ErrorCode_CreateDicomBadParent: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
306 return "Trying to attach a new DICOM instance to an inexistent resource"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
307 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
308 case ErrorCode_CreateDicomParentIsInstance: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
309 return "Trying to attach a new DICOM instance to an instance (must be a series, study or patient)"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
310 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
311 case ErrorCode_CreateDicomParentEncoding: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
312 return "Unable to get the encoding of the parent resource"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
313 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
314 case ErrorCode_UnknownModality: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
315 return "Unknown modality"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
316 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
317 case ErrorCode_BadJobOrdering: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
318 return "Bad ordering of filters in a job"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
319 |
1583
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
320 case ErrorCode_JsonToLuaTable: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
321 return "Cannot convert the given JSON object to a Lua table"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
322 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
323 case ErrorCode_CannotCreateLua: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
324 return "Cannot create the Lua context"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
325 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
326 case ErrorCode_CannotExecuteLua: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
327 return "Cannot execute a Lua command"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
328 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
329 case ErrorCode_LuaAlreadyExecuted: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
330 return "Arguments cannot be pushed after the Lua function is executed"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
331 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
332 case ErrorCode_LuaBadOutput: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
333 return "The Lua function does not give the expected number of outputs"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
334 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
335 case ErrorCode_NotLuaPredicate: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
336 return "The Lua function is not a predicate (only true/false outputs allowed)"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
337 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
338 case ErrorCode_LuaReturnsNoString: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
339 return "The Lua function does not return a string"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
340 |
1630
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
341 case ErrorCode_StorageAreaAlreadyRegistered: |
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
342 return "Another plugin has already registered a custom storage area"; |
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
343 |
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
344 case ErrorCode_DatabaseBackendAlreadyRegistered: |
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
345 return "Another plugin has already registered a custom database back-end"; |
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
346 |
1643
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
347 case ErrorCode_DatabaseNotInitialized: |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
348 return "Plugin trying to call the database during its initialization"; |
1630
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
349 |
1703
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
350 case ErrorCode_SslDisabled: |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
351 return "Orthanc has been built without SSL support"; |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
352 |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
353 case ErrorCode_CannotOrderSlices: |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
354 return "Unable to order the slices of the series"; |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
355 |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1781
diff
changeset
|
356 case ErrorCode_NoWorklistHandler: |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1781
diff
changeset
|
357 return "No request handler factory for DICOM C-Find Modality SCP"; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1781
diff
changeset
|
358 |
1980
ebce5f456b8e
new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1949
diff
changeset
|
359 case ErrorCode_AlreadyExistingTag: |
ebce5f456b8e
new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1949
diff
changeset
|
360 return "Cannot override the value of a tag that already exists"; |
ebce5f456b8e
new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1949
diff
changeset
|
361 |
4047
0327421506ad
fix paths in GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
362 case ErrorCode_NoStorageCommitmentHandler: |
0327421506ad
fix paths in GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
363 return "No request handler factory for DICOM N-ACTION SCP (storage commitment)"; |
0327421506ad
fix paths in GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
364 |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3801
diff
changeset
|
365 case ErrorCode_NoCGetHandler: |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3801
diff
changeset
|
366 return "No request handler factory for DICOM C-GET SCP"; |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3801
diff
changeset
|
367 |
3404
e280ced38a4c
ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3376
diff
changeset
|
368 case ErrorCode_UnsupportedMediaType: |
e280ced38a4c
ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3376
diff
changeset
|
369 return "Unsupported media type"; |
e280ced38a4c
ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3376
diff
changeset
|
370 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
371 default: |
1703
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
372 if (error >= ErrorCode_START_PLUGINS) |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
373 { |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
374 return "Error encountered within some plugin"; |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
375 } |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
376 else |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
377 { |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
378 return "Unknown error code"; |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
379 } |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
380 } |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
381 } |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
382 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
383 |
477 | 384 const char* EnumerationToString(HttpMethod method) |
385 { | |
386 switch (method) | |
387 { | |
388 case HttpMethod_Get: | |
389 return "GET"; | |
390 | |
391 case HttpMethod_Post: | |
392 return "POST"; | |
393 | |
394 case HttpMethod_Delete: | |
395 return "DELETE"; | |
396 | |
397 case HttpMethod_Put: | |
398 return "PUT"; | |
399 | |
400 default: | |
401 return "?"; | |
402 } | |
403 } | |
404 | |
405 | |
406 const char* EnumerationToString(HttpStatus status) | |
407 { | |
408 switch (status) | |
409 { | |
410 case HttpStatus_100_Continue: | |
411 return "Continue"; | |
412 | |
413 case HttpStatus_101_SwitchingProtocols: | |
414 return "Switching Protocols"; | |
415 | |
416 case HttpStatus_102_Processing: | |
417 return "Processing"; | |
418 | |
419 case HttpStatus_200_Ok: | |
420 return "OK"; | |
421 | |
422 case HttpStatus_201_Created: | |
423 return "Created"; | |
424 | |
425 case HttpStatus_202_Accepted: | |
426 return "Accepted"; | |
427 | |
428 case HttpStatus_203_NonAuthoritativeInformation: | |
429 return "Non-Authoritative Information"; | |
430 | |
431 case HttpStatus_204_NoContent: | |
432 return "No Content"; | |
433 | |
434 case HttpStatus_205_ResetContent: | |
435 return "Reset Content"; | |
436 | |
437 case HttpStatus_206_PartialContent: | |
438 return "Partial Content"; | |
439 | |
440 case HttpStatus_207_MultiStatus: | |
441 return "Multi-Status"; | |
442 | |
443 case HttpStatus_208_AlreadyReported: | |
444 return "Already Reported"; | |
445 | |
446 case HttpStatus_226_IMUsed: | |
447 return "IM Used"; | |
448 | |
449 case HttpStatus_300_MultipleChoices: | |
450 return "Multiple Choices"; | |
451 | |
452 case HttpStatus_301_MovedPermanently: | |
453 return "Moved Permanently"; | |
454 | |
455 case HttpStatus_302_Found: | |
456 return "Found"; | |
457 | |
458 case HttpStatus_303_SeeOther: | |
459 return "See Other"; | |
460 | |
461 case HttpStatus_304_NotModified: | |
462 return "Not Modified"; | |
463 | |
464 case HttpStatus_305_UseProxy: | |
465 return "Use Proxy"; | |
466 | |
467 case HttpStatus_307_TemporaryRedirect: | |
468 return "Temporary Redirect"; | |
469 | |
470 case HttpStatus_400_BadRequest: | |
471 return "Bad Request"; | |
472 | |
473 case HttpStatus_401_Unauthorized: | |
474 return "Unauthorized"; | |
475 | |
476 case HttpStatus_402_PaymentRequired: | |
477 return "Payment Required"; | |
478 | |
479 case HttpStatus_403_Forbidden: | |
480 return "Forbidden"; | |
481 | |
482 case HttpStatus_404_NotFound: | |
483 return "Not Found"; | |
484 | |
485 case HttpStatus_405_MethodNotAllowed: | |
486 return "Method Not Allowed"; | |
487 | |
488 case HttpStatus_406_NotAcceptable: | |
489 return "Not Acceptable"; | |
490 | |
491 case HttpStatus_407_ProxyAuthenticationRequired: | |
492 return "Proxy Authentication Required"; | |
493 | |
494 case HttpStatus_408_RequestTimeout: | |
495 return "Request Timeout"; | |
496 | |
497 case HttpStatus_409_Conflict: | |
498 return "Conflict"; | |
499 | |
500 case HttpStatus_410_Gone: | |
501 return "Gone"; | |
502 | |
503 case HttpStatus_411_LengthRequired: | |
504 return "Length Required"; | |
505 | |
506 case HttpStatus_412_PreconditionFailed: | |
507 return "Precondition Failed"; | |
508 | |
509 case HttpStatus_413_RequestEntityTooLarge: | |
510 return "Request Entity Too Large"; | |
511 | |
512 case HttpStatus_414_RequestUriTooLong: | |
513 return "Request-URI Too Long"; | |
514 | |
515 case HttpStatus_415_UnsupportedMediaType: | |
516 return "Unsupported Media Type"; | |
517 | |
518 case HttpStatus_416_RequestedRangeNotSatisfiable: | |
519 return "Requested Range Not Satisfiable"; | |
520 | |
521 case HttpStatus_417_ExpectationFailed: | |
522 return "Expectation Failed"; | |
523 | |
524 case HttpStatus_422_UnprocessableEntity: | |
525 return "Unprocessable Entity"; | |
526 | |
527 case HttpStatus_423_Locked: | |
528 return "Locked"; | |
529 | |
530 case HttpStatus_424_FailedDependency: | |
531 return "Failed Dependency"; | |
532 | |
533 case HttpStatus_426_UpgradeRequired: | |
534 return "Upgrade Required"; | |
535 | |
536 case HttpStatus_500_InternalServerError: | |
537 return "Internal Server Error"; | |
538 | |
539 case HttpStatus_501_NotImplemented: | |
540 return "Not Implemented"; | |
541 | |
542 case HttpStatus_502_BadGateway: | |
543 return "Bad Gateway"; | |
544 | |
545 case HttpStatus_503_ServiceUnavailable: | |
546 return "Service Unavailable"; | |
547 | |
548 case HttpStatus_504_GatewayTimeout: | |
549 return "Gateway Timeout"; | |
550 | |
551 case HttpStatus_505_HttpVersionNotSupported: | |
552 return "HTTP Version Not Supported"; | |
553 | |
554 case HttpStatus_506_VariantAlsoNegotiates: | |
555 return "Variant Also Negotiates"; | |
556 | |
557 case HttpStatus_507_InsufficientStorage: | |
558 return "Insufficient Storage"; | |
559 | |
560 case HttpStatus_509_BandwidthLimitExceeded: | |
561 return "Bandwidth Limit Exceeded"; | |
562 | |
563 case HttpStatus_510_NotExtended: | |
564 return "Not Extended"; | |
565 | |
566 default: | |
567 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
568 } | |
569 } | |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
570 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
571 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
572 const char* EnumerationToString(ResourceType type) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
573 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
574 switch (type) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
575 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
576 case ResourceType_Patient: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
577 return "Patient"; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
578 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
579 case ResourceType_Study: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
580 return "Study"; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
581 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
582 case ResourceType_Series: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
583 return "Series"; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
584 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
585 case ResourceType_Instance: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
586 return "Instance"; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
587 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
588 default: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
589 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
590 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
591 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
592 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
593 |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
594 const char* EnumerationToString(ImageFormat format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
595 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
596 switch (format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
597 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
598 case ImageFormat_Png: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
599 return "Png"; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
600 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
601 default: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
602 throw OrthancException(ErrorCode_ParameterOutOfRange); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
603 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
604 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
605 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
606 |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
607 const char* EnumerationToString(Encoding encoding) |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
608 { |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
609 switch (encoding) |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
610 { |
1087 | 611 case Encoding_Ascii: |
612 return "Ascii"; | |
613 | |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
614 case Encoding_Utf8: |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
615 return "Utf8"; |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
616 |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
617 case Encoding_Latin1: |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
618 return "Latin1"; |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
619 |
1087 | 620 case Encoding_Latin2: |
621 return "Latin2"; | |
622 | |
623 case Encoding_Latin3: | |
624 return "Latin3"; | |
625 | |
626 case Encoding_Latin4: | |
627 return "Latin4"; | |
628 | |
629 case Encoding_Latin5: | |
630 return "Latin5"; | |
631 | |
632 case Encoding_Cyrillic: | |
633 return "Cyrillic"; | |
634 | |
1347 | 635 case Encoding_Windows1251: |
636 return "Windows1251"; | |
637 | |
1087 | 638 case Encoding_Arabic: |
639 return "Arabic"; | |
640 | |
641 case Encoding_Greek: | |
642 return "Greek"; | |
643 | |
644 case Encoding_Hebrew: | |
645 return "Hebrew"; | |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
646 |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
647 case Encoding_Thai: |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
648 return "Thai"; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
649 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
650 case Encoding_Japanese: |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
651 return "Japanese"; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
652 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
653 case Encoding_Chinese: |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
654 return "Chinese"; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
655 |
3217
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
656 case Encoding_Korean: |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
657 return "Korean"; |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
658 |
3218 | 659 case Encoding_JapaneseKanji: |
660 return "JapaneseKanji"; | |
661 | |
3226
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
662 case Encoding_SimplifiedChinese: |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
663 return "SimplifiedChinese"; |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
664 |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
665 default: |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
666 throw OrthancException(ErrorCode_ParameterOutOfRange); |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
667 } |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
668 } |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
669 |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
670 |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
671 const char* EnumerationToString(PhotometricInterpretation photometric) |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
672 { |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
673 switch (photometric) |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
674 { |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
675 case PhotometricInterpretation_RGB: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
676 return "RGB"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
677 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
678 case PhotometricInterpretation_Monochrome1: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
679 return "MONOCHROME1"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
680 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
681 case PhotometricInterpretation_Monochrome2: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
682 return "MONOCHROME2"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
683 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
684 case PhotometricInterpretation_ARGB: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
685 return "ARGB"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
686 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
687 case PhotometricInterpretation_CMYK: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
688 return "CMYK"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
689 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
690 case PhotometricInterpretation_HSV: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
691 return "HSV"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
692 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
693 case PhotometricInterpretation_Palette: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
694 return "PALETTE COLOR"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
695 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
696 case PhotometricInterpretation_YBRFull: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
697 return "YBR_FULL"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
698 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
699 case PhotometricInterpretation_YBRFull422: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
700 return "YBR_FULL_422"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
701 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
702 case PhotometricInterpretation_YBRPartial420: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
703 return "YBR_PARTIAL_420"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
704 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
705 case PhotometricInterpretation_YBRPartial422: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
706 return "YBR_PARTIAL_422"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
707 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
708 case PhotometricInterpretation_YBR_ICT: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
709 return "YBR_ICT"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
710 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
711 case PhotometricInterpretation_YBR_RCT: |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
712 return "YBR_RCT"; |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
713 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
714 case PhotometricInterpretation_Unknown: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
715 return "Unknown"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
716 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
717 default: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
718 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
719 } |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
720 } |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
721 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
722 |
1571
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
723 const char* EnumerationToString(RequestOrigin origin) |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
724 { |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
725 switch (origin) |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
726 { |
1572
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
727 case RequestOrigin_Unknown: |
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
728 return "Unknown"; |
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
729 |
1571
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
730 case RequestOrigin_DicomProtocol: |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
731 return "DicomProtocol"; |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
732 |
1823
0ef4e6e66b56
"Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
733 case RequestOrigin_RestApi: |
0ef4e6e66b56
"Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
734 return "RestApi"; |
1571
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
735 |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
736 case RequestOrigin_Plugins: |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
737 return "Plugins"; |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
738 |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
739 case RequestOrigin_Lua: |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
740 return "Lua"; |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
741 |
4245
c70df925151e
RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4177
diff
changeset
|
742 case RequestOrigin_WebDav: |
c70df925151e
RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4177
diff
changeset
|
743 return "WebDav"; |
c70df925151e
RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4177
diff
changeset
|
744 |
1571
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
745 default: |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
746 throw OrthancException(ErrorCode_ParameterOutOfRange); |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
747 } |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
748 } |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
749 |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
750 |
1926
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
751 const char* EnumerationToString(PixelFormat format) |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
752 { |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
753 switch (format) |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
754 { |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
755 case PixelFormat_RGB24: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
756 return "RGB24"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
757 |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
758 case PixelFormat_RGBA32: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
759 return "RGBA32"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
760 |
2089
7a969f235adf
PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2007
diff
changeset
|
761 case PixelFormat_BGRA32: |
7a969f235adf
PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2007
diff
changeset
|
762 return "BGRA32"; |
7a969f235adf
PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2007
diff
changeset
|
763 |
1926
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
764 case PixelFormat_Grayscale8: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
765 return "Grayscale (unsigned 8bpp)"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
766 |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
767 case PixelFormat_Grayscale16: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
768 return "Grayscale (unsigned 16bpp)"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
769 |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
770 case PixelFormat_SignedGrayscale16: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
771 return "Grayscale (signed 16bpp)"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
772 |
1993
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
773 case PixelFormat_Float32: |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
774 return "Grayscale (float 32bpp)"; |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
775 |
2415
7e217a1cc63f
PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2407
diff
changeset
|
776 case PixelFormat_Grayscale32: |
7e217a1cc63f
PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2407
diff
changeset
|
777 return "Grayscale (unsigned 32bpp)"; |
7e217a1cc63f
PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2407
diff
changeset
|
778 |
2645
89b789366596
Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2499
diff
changeset
|
779 case PixelFormat_Grayscale64: |
89b789366596
Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2499
diff
changeset
|
780 return "Grayscale (unsigned 64bpp)"; |
89b789366596
Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2499
diff
changeset
|
781 |
2423
5a7c5c541a1d
Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2415
diff
changeset
|
782 case PixelFormat_RGB48: |
5a7c5c541a1d
Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2415
diff
changeset
|
783 return "RGB48"; |
5a7c5c541a1d
Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2415
diff
changeset
|
784 |
1926
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
785 default: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
786 throw OrthancException(ErrorCode_ParameterOutOfRange); |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
787 } |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
788 } |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
789 |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
790 |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
791 const char* EnumerationToString(ModalityManufacturer manufacturer) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
792 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
793 switch (manufacturer) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
794 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
795 case ModalityManufacturer_Generic: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
796 return "Generic"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
797 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
798 case ModalityManufacturer_GenericNoWildcardInDates: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
799 return "GenericNoWildcardInDates"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
800 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
801 case ModalityManufacturer_GenericNoUniversalWildcard: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
802 return "GenericNoUniversalWildcard"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
803 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
804 case ModalityManufacturer_Vitrea: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
805 return "Vitrea"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
806 |
2888
61a5667f37d9
New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2871
diff
changeset
|
807 case ModalityManufacturer_GE: |
61a5667f37d9
New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2871
diff
changeset
|
808 return "GE"; |
61a5667f37d9
New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2871
diff
changeset
|
809 |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
810 default: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
811 throw OrthancException(ErrorCode_ParameterOutOfRange); |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
812 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
813 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
814 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
815 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
816 const char* EnumerationToString(DicomRequestType type) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
817 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
818 switch (type) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
819 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
820 case DicomRequestType_Echo: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
821 return "Echo"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
822 break; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
823 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
824 case DicomRequestType_Find: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
825 return "Find"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
826 break; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
827 |
4888
8523078f3f4b
added new configuration to authorize C-Find for worklist independently from other C-Find
Alain Mazy <am@osimis.io>
parents:
4887
diff
changeset
|
828 case DicomRequestType_FindWorklist: |
4912
45d6ce72a84e
fix linking of Sanitizer sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4888
diff
changeset
|
829 return "FindWorklist"; |
4888
8523078f3f4b
added new configuration to authorize C-Find for worklist independently from other C-Find
Alain Mazy <am@osimis.io>
parents:
4887
diff
changeset
|
830 break; |
8523078f3f4b
added new configuration to authorize C-Find for worklist independently from other C-Find
Alain Mazy <am@osimis.io>
parents:
4887
diff
changeset
|
831 |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
832 case DicomRequestType_Get: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
833 return "Get"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
834 break; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
835 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
836 case DicomRequestType_Move: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
837 return "Move"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
838 break; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
839 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
840 case DicomRequestType_Store: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
841 return "Store"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
842 break; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
843 |
3602
085283445db0
AllowNAction in remote modality parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3561
diff
changeset
|
844 case DicomRequestType_NAction: |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3603
diff
changeset
|
845 return "N-ACTION"; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3603
diff
changeset
|
846 break; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3603
diff
changeset
|
847 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3603
diff
changeset
|
848 case DicomRequestType_NEventReport: |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3603
diff
changeset
|
849 return "N-EVENT-REPORT"; |
3602
085283445db0
AllowNAction in remote modality parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3561
diff
changeset
|
850 break; |
085283445db0
AllowNAction in remote modality parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3561
diff
changeset
|
851 |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
852 default: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
853 throw OrthancException(ErrorCode_ParameterOutOfRange); |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
854 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
855 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
856 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
857 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
858 const char* EnumerationToString(DicomVersion version) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
859 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
860 switch (version) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
861 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
862 case DicomVersion_2008: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
863 return "2008"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
864 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
865 case DicomVersion_2017c: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
866 return "2017c"; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
867 |
4677
521e39b3f2c0
Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
868 case DicomVersion_2021b: |
521e39b3f2c0
Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
869 return "2021b"; |
5334
5b2a5cc64cb1
upgraded anonymization to Basic Profile of PS 3.15-2023b Table E.1-1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5291
diff
changeset
|
870 |
5b2a5cc64cb1
upgraded anonymization to Basic Profile of PS 3.15-2023b Table E.1-1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5291
diff
changeset
|
871 case DicomVersion_2023b: |
5b2a5cc64cb1
upgraded anonymization to Basic Profile of PS 3.15-2023b Table E.1-1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5291
diff
changeset
|
872 return "2023b"; |
4677
521e39b3f2c0
Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
873 |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
874 default: |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
875 throw OrthancException(ErrorCode_ParameterOutOfRange); |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
876 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
877 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
878 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
879 |
2499
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
880 const char* EnumerationToString(ValueRepresentation vr) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
881 { |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
882 switch (vr) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
883 { |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
884 case ValueRepresentation_ApplicationEntity: // AE |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
885 return "AE"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
886 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
887 case ValueRepresentation_AgeString: // AS |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
888 return "AS"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
889 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
890 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
891 return "AT"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
892 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
893 case ValueRepresentation_CodeString: // CS |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
894 return "CS"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
895 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
896 case ValueRepresentation_Date: // DA |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
897 return "DA"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
898 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
899 case ValueRepresentation_DecimalString: // DS |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
900 return "DS"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
901 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
902 case ValueRepresentation_DateTime: // DT |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
903 return "DT"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
904 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
905 case ValueRepresentation_FloatingPointSingle: // FL (float) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
906 return "FL"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
907 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
908 case ValueRepresentation_FloatingPointDouble: // FD (double) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
909 return "FD"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
910 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
911 case ValueRepresentation_IntegerString: // IS |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
912 return "IS"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
913 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
914 case ValueRepresentation_LongString: // LO |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
915 return "LO"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
916 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
917 case ValueRepresentation_LongText: // LT |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
918 return "LT"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
919 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
920 case ValueRepresentation_OtherByte: // OB |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
921 return "OB"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
922 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
923 case ValueRepresentation_OtherDouble: // OD |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
924 return "OD"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
925 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
926 case ValueRepresentation_OtherFloat: // OF |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
927 return "OF"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
928 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
929 case ValueRepresentation_OtherLong: // OL |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
930 return "OL"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
931 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
932 case ValueRepresentation_OtherWord: // OW |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
933 return "OW"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
934 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
935 case ValueRepresentation_PersonName: // PN |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
936 return "PN"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
937 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
938 case ValueRepresentation_ShortString: // SH |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
939 return "SH"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
940 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
941 case ValueRepresentation_SignedLong: // SL (int32_t) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
942 return "SL"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
943 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
944 case ValueRepresentation_Sequence: // SQ |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
945 return "SQ"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
946 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
947 case ValueRepresentation_SignedShort: // SS (int16_t) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
948 return "SS"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
949 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
950 case ValueRepresentation_ShortText: // ST |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
951 return "ST"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
952 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
953 case ValueRepresentation_Time: // TM |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
954 return "TM"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
955 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
956 case ValueRepresentation_UnlimitedCharacters: // UC |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
957 return "UC"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
958 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
959 case ValueRepresentation_UniqueIdentifier: // UI (UID) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
960 return "UI"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
961 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
962 case ValueRepresentation_UnsignedLong: // UL (uint32_t) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
963 return "UL"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
964 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
965 case ValueRepresentation_Unknown: // UN |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
966 return "UN"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
967 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
968 case ValueRepresentation_UniversalResource: // UR (URI or URL) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
969 return "UR"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
970 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
971 case ValueRepresentation_UnsignedShort: // US (uint16_t) |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
972 return "US"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
973 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
974 case ValueRepresentation_UnlimitedText: // UT |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
975 return "UT"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
976 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
977 case ValueRepresentation_NotSupported: |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
978 return "Not supported"; |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
979 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
980 default: |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
981 throw OrthancException(ErrorCode_ParameterOutOfRange); |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
982 } |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
983 } |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
984 |
83b8b6743531
ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2486
diff
changeset
|
985 |
2569 | 986 const char* EnumerationToString(JobState state) |
987 { | |
988 switch (state) | |
989 { | |
990 case JobState_Pending: | |
991 return "Pending"; | |
992 | |
993 case JobState_Running: | |
994 return "Running"; | |
995 | |
996 case JobState_Success: | |
997 return "Success"; | |
998 | |
999 case JobState_Failure: | |
1000 return "Failure"; | |
1001 | |
1002 case JobState_Paused: | |
1003 return "Paused"; | |
1004 | |
1005 case JobState_Retry: | |
1006 return "Retry"; | |
1007 | |
1008 default: | |
1009 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
1010 } | |
1011 } | |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1012 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1013 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1014 const char* EnumerationToString(MimeType mime) |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1015 { |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1016 switch (mime) |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1017 { |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1018 case MimeType_Binary: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1019 return MIME_BINARY; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1020 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1021 case MimeType_Dicom: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1022 return MIME_DICOM; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1023 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1024 case MimeType_Jpeg: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1025 return MIME_JPEG; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1026 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1027 case MimeType_Jpeg2000: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1028 return MIME_JPEG2000; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1029 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1030 case MimeType_Json: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1031 return MIME_JSON; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1032 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1033 case MimeType_Pdf: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1034 return MIME_PDF; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1035 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1036 case MimeType_Png: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1037 return MIME_PNG; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1038 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1039 case MimeType_Xml: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1040 return MIME_XML; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1041 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1042 case MimeType_PlainText: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1043 return MIME_PLAIN_TEXT; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1044 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1045 case MimeType_Pam: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1046 return MIME_PAM; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1047 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1048 case MimeType_Html: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1049 return MIME_HTML; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1050 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1051 case MimeType_Gzip: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1052 return MIME_GZIP; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1053 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1054 case MimeType_JavaScript: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1055 return MIME_JAVASCRIPT; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1056 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1057 case MimeType_Css: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1058 return MIME_CSS; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1059 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1060 case MimeType_WebAssembly: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1061 return MIME_WEB_ASSEMBLY; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1062 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1063 case MimeType_Gif: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1064 return MIME_GIF; |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1065 |
2976
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2954
diff
changeset
|
1066 case MimeType_Zip: |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2954
diff
changeset
|
1067 return MIME_ZIP; |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2954
diff
changeset
|
1068 |
2984
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1069 case MimeType_NaCl: |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1070 return MIME_NACL; |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1071 |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1072 case MimeType_PNaCl: |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1073 return MIME_PNACL; |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1074 |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1075 case MimeType_Svg: |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1076 return MIME_SVG; |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1077 |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1078 case MimeType_Woff: |
db8f360fcb41
OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2976
diff
changeset
|
1079 return MIME_WOFF; |
3174
8ea7c4546c3a
primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3061
diff
changeset
|
1080 |
3435
c08bb6ac3b7f
new mime type: font/woff2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3404
diff
changeset
|
1081 case MimeType_Woff2: |
c08bb6ac3b7f
new mime type: font/woff2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3404
diff
changeset
|
1082 return MIME_WOFF2; |
c08bb6ac3b7f
new mime type: font/woff2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3404
diff
changeset
|
1083 |
3174
8ea7c4546c3a
primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3061
diff
changeset
|
1084 case MimeType_PrometheusText: |
8ea7c4546c3a
primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3061
diff
changeset
|
1085 // https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format |
8ea7c4546c3a
primitives to collect metrics in Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3061
diff
changeset
|
1086 return "text/plain; version=0.0.4"; |
3203
810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3174
diff
changeset
|
1087 |
810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3174
diff
changeset
|
1088 case MimeType_DicomWebJson: |
810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3174
diff
changeset
|
1089 return MIME_DICOM_WEB_JSON; |
810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3174
diff
changeset
|
1090 |
810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3174
diff
changeset
|
1091 case MimeType_DicomWebXml: |
810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3174
diff
changeset
|
1092 return MIME_DICOM_WEB_XML; |
4887 | 1093 |
1094 case MimeType_Ico: | |
1095 return MIME_ICO; | |
1096 | |
5348
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1097 case MimeType_Obj: |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1098 return MIME_OBJ; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1099 |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1100 case MimeType_Mtl: |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1101 return MIME_MTL; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1102 |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1103 case MimeType_Stl: |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1104 return MIME_STL; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1105 |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1106 default: |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1107 throw OrthancException(ErrorCode_ParameterOutOfRange); |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1108 } |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1109 } |
2569 | 1110 |
1111 | |
3530
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1112 const char* EnumerationToString(Endianness endianness) |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1113 { |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1114 switch (endianness) |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1115 { |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1116 case Endianness_Little: |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1117 return "Little-endian"; |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1118 |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1119 case Endianness_Big: |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1120 return "Big-endian"; |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1121 |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1122 case Endianness_Unknown: |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1123 return "Unknown endianness"; |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1124 |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1125 default: |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1126 throw OrthancException(ErrorCode_ParameterOutOfRange); |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1127 } |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1128 } |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1129 |
b26b6ea27648
endianness to string
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3435
diff
changeset
|
1130 |
3737
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1131 const char* EnumerationToString(StorageCommitmentFailureReason reason) |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1132 { |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1133 switch (reason) |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1134 { |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1135 case StorageCommitmentFailureReason_Success: |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1136 return "Success"; |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1137 |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1138 case StorageCommitmentFailureReason_ProcessingFailure: |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1139 return "A general failure in processing the operation was encountered"; |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1140 |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1141 case StorageCommitmentFailureReason_NoSuchObjectInstance: |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1142 return "One or more of the elements in the Referenced SOP " |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1143 "Instance Sequence was not available"; |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1144 |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1145 case StorageCommitmentFailureReason_ResourceLimitation: |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1146 return "The SCP does not currently have enough resources to " |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1147 "store the requested SOP Instance(s)"; |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1148 |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1149 case StorageCommitmentFailureReason_ReferencedSOPClassNotSupported: |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1150 return "Storage Commitment has been requested for a SOP Instance " |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1151 "with a SOP Class that is not supported by the SCP"; |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1152 |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1153 case StorageCommitmentFailureReason_ClassInstanceConflict: |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1154 return "The SOP Class of an element in the Referenced SOP Instance Sequence " |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1155 "did not correspond to the SOP class registered for this SOP Instance at the SCP"; |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1156 |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1157 case StorageCommitmentFailureReason_DuplicateTransactionUID: |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1158 return "The Transaction UID of the Storage Commitment Request is already in use"; |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1159 |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1160 default: |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1161 return "Unknown failure reason"; |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1162 } |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1163 } |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1164 |
f29843323daf
accessing storage commitment reports from REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
1165 |
4730
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1166 const char* EnumerationToString(DicomToJsonFormat format) |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1167 { |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1168 switch (format) |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1169 { |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1170 case DicomToJsonFormat_Full: |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1171 return "Full"; |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1172 |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1173 case DicomToJsonFormat_Human: |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1174 return "Simplify"; |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1175 |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1176 case DicomToJsonFormat_Short: |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1177 return "Short"; |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1178 |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1179 default: |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1180 throw OrthancException(ErrorCode_ParameterOutOfRange); |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1181 } |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1182 } |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1183 |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1184 |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1185 Encoding StringToEncoding(const char* encoding) |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1186 { |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1187 std::string s(encoding); |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1188 Toolbox::ToUpperCase(s); |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1189 |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1190 if (s == "UTF8") |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1191 { |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1192 return Encoding_Utf8; |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1193 } |
1087 | 1194 |
1195 if (s == "ASCII") | |
1196 { | |
1197 return Encoding_Ascii; | |
1198 } | |
1199 | |
1200 if (s == "LATIN1") | |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1201 { |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1202 return Encoding_Latin1; |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1203 } |
1087 | 1204 |
1205 if (s == "LATIN2") | |
1206 { | |
1207 return Encoding_Latin2; | |
1208 } | |
1209 | |
1210 if (s == "LATIN3") | |
1211 { | |
1212 return Encoding_Latin3; | |
1213 } | |
1214 | |
1215 if (s == "LATIN4") | |
1216 { | |
1217 return Encoding_Latin4; | |
1218 } | |
1219 | |
1220 if (s == "LATIN5") | |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1221 { |
1087 | 1222 return Encoding_Latin5; |
1223 } | |
1224 | |
1225 if (s == "CYRILLIC") | |
1226 { | |
1227 return Encoding_Cyrillic; | |
1228 } | |
1229 | |
1347 | 1230 if (s == "WINDOWS1251") |
1231 { | |
1232 return Encoding_Windows1251; | |
1233 } | |
1234 | |
1087 | 1235 if (s == "ARABIC") |
1236 { | |
1237 return Encoding_Arabic; | |
1238 } | |
1239 | |
1240 if (s == "GREEK") | |
1241 { | |
1242 return Encoding_Greek; | |
1243 } | |
1244 | |
1245 if (s == "HEBREW") | |
1246 { | |
1247 return Encoding_Hebrew; | |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1248 } |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1249 |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1250 if (s == "THAI") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1251 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1252 return Encoding_Thai; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1253 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1254 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1255 if (s == "JAPANESE") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1256 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1257 return Encoding_Japanese; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1258 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1259 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1260 if (s == "CHINESE") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1261 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1262 return Encoding_Chinese; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1263 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1264 |
3217
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
1265 if (s == "KOREAN") |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
1266 { |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
1267 return Encoding_Korean; |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
1268 } |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
1269 |
3219 | 1270 if (s == "JAPANESEKANJI") |
3218 | 1271 { |
1272 return Encoding_JapaneseKanji; | |
1273 } | |
1274 | |
3226
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
1275 if (s == "SIMPLIFIEDCHINESE") |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
1276 { |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
1277 return Encoding_SimplifiedChinese; |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
1278 } |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
1279 |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1280 throw OrthancException(ErrorCode_ParameterOutOfRange); |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1281 } |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1282 |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
1283 |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1284 ResourceType StringToResourceType(const char* type) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1285 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1286 std::string s(type); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1287 Toolbox::ToUpperCase(s); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1288 |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
1289 if (s == "PATIENT" || s == "PATIENTS") |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1290 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1291 return ResourceType_Patient; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1292 } |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
1293 else if (s == "STUDY" || s == "STUDIES") |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1294 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1295 return ResourceType_Study; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1296 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1297 else if (s == "SERIES") |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1298 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1299 return ResourceType_Series; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1300 } |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
1301 else if (s == "INSTANCE" || s == "IMAGE" || |
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
1302 s == "INSTANCES" || s == "IMAGES") |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1303 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1304 return ResourceType_Instance; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1305 } |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1306 |
5037 | 1307 throw OrthancException(ErrorCode_ParameterOutOfRange, std::string("Invalid resource type '") + type + "'"); |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1308 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1309 |
5025
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1310 const char* ResourceTypeToDicomQueryRetrieveLevel(ResourceType type) |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1311 { |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1312 if (type == ResourceType_Patient) |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1313 { |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1314 return "PATIENT"; |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1315 } |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1316 else if (type == ResourceType_Study) |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1317 { |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1318 return "STUDY"; |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1319 } |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1320 else if (type == ResourceType_Series) |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1321 { |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1322 return "SERIES"; |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1323 } |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1324 else if (type == ResourceType_Instance) |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1325 { |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1326 return "IMAGE"; |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1327 } |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1328 |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1329 throw OrthancException(ErrorCode_ParameterOutOfRange); |
afa427f65444
Added an Asynchronous mode to /modalities/../move
Alain Mazy <am@osimis.io>
parents:
4932
diff
changeset
|
1330 } |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1331 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1332 ImageFormat StringToImageFormat(const char* format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1333 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1334 std::string s(format); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1335 Toolbox::ToUpperCase(s); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1336 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1337 if (s == "PNG") |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1338 { |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1339 return ImageFormat_Png; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1340 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1341 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1342 throw OrthancException(ErrorCode_ParameterOutOfRange); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1343 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1344 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1345 |
2006
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1346 ValueRepresentation StringToValueRepresentation(const std::string& vr, |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1347 bool throwIfUnsupported) |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1348 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1349 if (vr == "AE") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1350 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1351 return ValueRepresentation_ApplicationEntity; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1352 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1353 else if (vr == "AS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1354 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1355 return ValueRepresentation_AgeString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1356 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1357 else if (vr == "AT") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1358 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1359 return ValueRepresentation_AttributeTag; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1360 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1361 else if (vr == "CS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1362 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1363 return ValueRepresentation_CodeString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1364 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1365 else if (vr == "DA") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1366 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1367 return ValueRepresentation_Date; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1368 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1369 else if (vr == "DS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1370 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1371 return ValueRepresentation_DecimalString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1372 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1373 else if (vr == "DT") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1374 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1375 return ValueRepresentation_DateTime; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1376 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1377 else if (vr == "FL") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1378 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1379 return ValueRepresentation_FloatingPointSingle; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1380 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1381 else if (vr == "FD") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1382 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1383 return ValueRepresentation_FloatingPointDouble; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1384 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1385 else if (vr == "IS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1386 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1387 return ValueRepresentation_IntegerString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1388 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1389 else if (vr == "LO") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1390 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1391 return ValueRepresentation_LongString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1392 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1393 else if (vr == "LT") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1394 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1395 return ValueRepresentation_LongText; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1396 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1397 else if (vr == "OB") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1398 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1399 return ValueRepresentation_OtherByte; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1400 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1401 else if (vr == "OD") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1402 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1403 return ValueRepresentation_OtherDouble; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1404 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1405 else if (vr == "OF") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1406 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1407 return ValueRepresentation_OtherFloat; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1408 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1409 else if (vr == "OL") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1410 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1411 return ValueRepresentation_OtherLong; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1412 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1413 else if (vr == "OW") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1414 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1415 return ValueRepresentation_OtherWord; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1416 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1417 else if (vr == "PN") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1418 { |
2007
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1419 return ValueRepresentation_PersonName; |
2006
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1420 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1421 else if (vr == "SH") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1422 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1423 return ValueRepresentation_ShortString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1424 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1425 else if (vr == "SL") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1426 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1427 return ValueRepresentation_SignedLong; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1428 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1429 else if (vr == "SQ") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1430 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1431 return ValueRepresentation_Sequence; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1432 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1433 else if (vr == "SS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1434 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1435 return ValueRepresentation_SignedShort; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1436 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1437 else if (vr == "ST") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1438 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1439 return ValueRepresentation_ShortText; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1440 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1441 else if (vr == "TM") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1442 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1443 return ValueRepresentation_Time; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1444 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1445 else if (vr == "UC") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1446 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1447 return ValueRepresentation_UnlimitedCharacters; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1448 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1449 else if (vr == "UI") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1450 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1451 return ValueRepresentation_UniqueIdentifier; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1452 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1453 else if (vr == "UL") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1454 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1455 return ValueRepresentation_UnsignedLong; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1456 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1457 else if (vr == "UN") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1458 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1459 return ValueRepresentation_Unknown; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1460 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1461 else if (vr == "UR") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1462 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1463 return ValueRepresentation_UniversalResource; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1464 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1465 else if (vr == "US") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1466 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1467 return ValueRepresentation_UnsignedShort; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1468 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1469 else if (vr == "UT") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1470 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1471 return ValueRepresentation_UnlimitedText; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1472 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1473 else |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1474 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1475 std::string s = "Unsupported value representation encountered: " + vr; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1476 |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1477 if (throwIfUnsupported) |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1478 { |
2954
d924f9bb61cc
taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2953
diff
changeset
|
1479 throw OrthancException(ErrorCode_ParameterOutOfRange, s); |
2006
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1480 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1481 else |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1482 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1483 LOG(INFO) << s; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1484 return ValueRepresentation_NotSupported; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1485 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1486 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1487 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1488 |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1489 |
2281
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1490 PhotometricInterpretation StringToPhotometricInterpretation(const char* value) |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1491 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1492 // http://dicom.nema.org/medical/dicom/2017a/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1493 std::string s(value); |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1494 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1495 if (s == "MONOCHROME1") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1496 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1497 return PhotometricInterpretation_Monochrome1; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1498 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1499 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1500 if (s == "MONOCHROME2") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1501 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1502 return PhotometricInterpretation_Monochrome2; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1503 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1504 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1505 if (s == "PALETTE COLOR") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1506 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1507 return PhotometricInterpretation_Palette; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1508 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1509 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1510 if (s == "RGB") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1511 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1512 return PhotometricInterpretation_RGB; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1513 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1514 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1515 if (s == "HSV") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1516 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1517 return PhotometricInterpretation_HSV; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1518 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1519 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1520 if (s == "ARGB") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1521 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1522 return PhotometricInterpretation_ARGB; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1523 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1524 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1525 if (s == "CMYK") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1526 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1527 return PhotometricInterpretation_CMYK; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1528 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1529 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1530 if (s == "YBR_FULL") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1531 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1532 return PhotometricInterpretation_YBRFull; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1533 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1534 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1535 if (s == "YBR_FULL_422") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1536 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1537 return PhotometricInterpretation_YBRFull422; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1538 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1539 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1540 if (s == "YBR_PARTIAL_422") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1541 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1542 return PhotometricInterpretation_YBRPartial422; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1543 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1544 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1545 if (s == "YBR_PARTIAL_420") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1546 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1547 return PhotometricInterpretation_YBRPartial420; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1548 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1549 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1550 if (s == "YBR_ICT") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1551 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1552 return PhotometricInterpretation_YBR_ICT; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1553 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1554 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1555 if (s == "YBR_RCT") |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1556 { |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1557 return PhotometricInterpretation_YBR_RCT; |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1558 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1559 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1560 throw OrthancException(ErrorCode_ParameterOutOfRange); |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1561 } |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1562 |
e002430baa41
Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
1563 |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1564 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1565 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1566 ModalityManufacturer result; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1567 bool obsolete = false; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1568 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1569 if (manufacturer == "Generic") |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1570 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1571 return ModalityManufacturer_Generic; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1572 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1573 else if (manufacturer == "GenericNoWildcardInDates") |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1574 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1575 return ModalityManufacturer_GenericNoWildcardInDates; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1576 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1577 else if (manufacturer == "GenericNoUniversalWildcard") |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1578 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1579 return ModalityManufacturer_GenericNoUniversalWildcard; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1580 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1581 else if (manufacturer == "Vitrea") |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1582 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1583 return ModalityManufacturer_Vitrea; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1584 } |
2888
61a5667f37d9
New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2871
diff
changeset
|
1585 else if (manufacturer == "GE") |
61a5667f37d9
New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2871
diff
changeset
|
1586 { |
61a5667f37d9
New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2871
diff
changeset
|
1587 return ModalityManufacturer_GE; |
61a5667f37d9
New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2871
diff
changeset
|
1588 } |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1589 else if (manufacturer == "AgfaImpax" || |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1590 manufacturer == "SyngoVia") |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1591 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1592 result = ModalityManufacturer_GenericNoWildcardInDates; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1593 obsolete = true; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1594 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1595 else if (manufacturer == "EFilm2" || |
3561
bdafff1ce443
C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents:
3530
diff
changeset
|
1596 manufacturer == "MedInria" || |
bdafff1ce443
C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents:
3530
diff
changeset
|
1597 manufacturer == "ClearCanvas" || |
bdafff1ce443
C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents:
3530
diff
changeset
|
1598 manufacturer == "Dcm4Chee" |
bdafff1ce443
C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents:
3530
diff
changeset
|
1599 ) |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1600 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1601 result = ModalityManufacturer_Generic; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1602 obsolete = true; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1603 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1604 else |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1605 { |
2954
d924f9bb61cc
taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2953
diff
changeset
|
1606 throw OrthancException(ErrorCode_ParameterOutOfRange, |
d924f9bb61cc
taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2953
diff
changeset
|
1607 "Unknown modality manufacturer: \"" + manufacturer + "\""); |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1608 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1609 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1610 if (obsolete) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1611 { |
3561
bdafff1ce443
C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents:
3530
diff
changeset
|
1612 LOG(WARNING) << "The \"" << manufacturer << "\" manufacturer is now obsolete. " |
bdafff1ce443
C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE). Source: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/orthanc-users/FYxHXzlaQ0M/rn6d0SowAAAJ
Alain Mazy <alain@mazy.be>
parents:
3530
diff
changeset
|
1613 << "To guarantee compatibility with future Orthanc " |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1614 << "releases, you should replace it by \"" |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1615 << EnumerationToString(result) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1616 << "\" in your configuration file."; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1617 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1618 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1619 return result; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1620 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1621 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1622 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1623 DicomVersion StringToDicomVersion(const std::string& version) |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1624 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1625 if (version == "2008") |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1626 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1627 return DicomVersion_2008; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1628 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1629 else if (version == "2017c") |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1630 { |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1631 return DicomVersion_2017c; |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1632 } |
4677
521e39b3f2c0
Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
1633 else if (version == "2021b") |
521e39b3f2c0
Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
1634 { |
521e39b3f2c0
Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
1635 return DicomVersion_2021b; |
521e39b3f2c0
Fix issue #146 (Update Anonyization to 2019c) - was actually updated to 2021b
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
1636 } |
5334
5b2a5cc64cb1
upgraded anonymization to Basic Profile of PS 3.15-2023b Table E.1-1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5291
diff
changeset
|
1637 else if (version == "2023b") |
5b2a5cc64cb1
upgraded anonymization to Basic Profile of PS 3.15-2023b Table E.1-1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5291
diff
changeset
|
1638 { |
5b2a5cc64cb1
upgraded anonymization to Basic Profile of PS 3.15-2023b Table E.1-1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5291
diff
changeset
|
1639 return DicomVersion_2023b; |
5b2a5cc64cb1
upgraded anonymization to Basic Profile of PS 3.15-2023b Table E.1-1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5291
diff
changeset
|
1640 } |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1641 else |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1642 { |
4376
b002f9abe802
review of changeset 4375:208029732d51
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4347
diff
changeset
|
1643 throw OrthancException(ErrorCode_ParameterOutOfRange, |
b002f9abe802
review of changeset 4375:208029732d51
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4347
diff
changeset
|
1644 "Unknown specific version of the DICOM standard: " + version); |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1645 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1646 } |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1647 |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
1648 |
2646 | 1649 JobState StringToJobState(const std::string& state) |
1650 { | |
1651 if (state == "Pending") | |
1652 { | |
1653 return JobState_Pending; | |
1654 } | |
1655 else if (state == "Running") | |
1656 { | |
1657 return JobState_Running; | |
1658 } | |
1659 else if (state == "Success") | |
1660 { | |
1661 return JobState_Success; | |
1662 } | |
1663 else if (state == "Failure") | |
1664 { | |
1665 return JobState_Failure; | |
1666 } | |
1667 else if (state == "Paused") | |
1668 { | |
1669 return JobState_Paused; | |
1670 } | |
1671 else if (state == "Retry") | |
1672 { | |
1673 return JobState_Retry; | |
1674 } | |
1675 else | |
1676 { | |
1677 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
1678 } | |
1679 } | |
1680 | |
1681 | |
2655 | 1682 RequestOrigin StringToRequestOrigin(const std::string& origin) |
1683 { | |
1684 if (origin == "Unknown") | |
1685 { | |
1686 return RequestOrigin_Unknown; | |
1687 } | |
1688 else if (origin == "DicomProtocol") | |
1689 { | |
1690 return RequestOrigin_DicomProtocol; | |
1691 } | |
1692 else if (origin == "RestApi") | |
1693 { | |
1694 return RequestOrigin_RestApi; | |
1695 } | |
1696 else if (origin == "Plugins") | |
1697 { | |
1698 return RequestOrigin_Plugins; | |
1699 } | |
1700 else if (origin == "Lua") | |
1701 { | |
1702 return RequestOrigin_Lua; | |
1703 } | |
4245
c70df925151e
RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4177
diff
changeset
|
1704 else if (origin == "WebDav") |
c70df925151e
RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4177
diff
changeset
|
1705 { |
c70df925151e
RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4177
diff
changeset
|
1706 return RequestOrigin_WebDav; |
c70df925151e
RequestOrigin_WebDav
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4177
diff
changeset
|
1707 } |
2655 | 1708 else |
1709 { | |
1710 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
1711 } | |
1712 } | |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1713 |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1714 |
4073 | 1715 bool LookupMimeType(MimeType& target, |
1716 const std::string& source) | |
1717 { | |
1718 if (source == MIME_BINARY) | |
1719 { | |
1720 target = MimeType_Binary; | |
1721 return true; | |
1722 } | |
1723 else if (source == MIME_DICOM) | |
1724 { | |
1725 target = MimeType_Dicom; | |
1726 return true; | |
1727 } | |
5113
a3c3f13368ea
clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5112
diff
changeset
|
1728 else if (source == MIME_JPEG || |
a3c3f13368ea
clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5112
diff
changeset
|
1729 source == "image/jpg") |
4073 | 1730 { |
5113
a3c3f13368ea
clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5112
diff
changeset
|
1731 // Note the tolerance for "image/jpg", which is *not* a standard MIME type |
a3c3f13368ea
clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5112
diff
changeset
|
1732 // https://groups.google.com/g/orthanc-users/c/Y5x37UFKiDg/m/1zI260KTAwAJ |
a3c3f13368ea
clarification that "image/jpg" is not a correct MIME type
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5112
diff
changeset
|
1733 // https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types |
4073 | 1734 target = MimeType_Jpeg; |
1735 return true; | |
1736 } | |
1737 else if (source == MIME_JPEG2000) | |
1738 { | |
1739 target = MimeType_Jpeg2000; | |
1740 return true; | |
1741 } | |
1742 else if (source == MIME_JSON) | |
1743 { | |
1744 target = MimeType_Json; | |
1745 return true; | |
1746 } | |
1747 else if (source == MIME_PDF) | |
1748 { | |
1749 target = MimeType_Pdf; | |
1750 return true; | |
1751 } | |
1752 else if (source == MIME_PNG) | |
1753 { | |
1754 target = MimeType_Png; | |
1755 return true; | |
1756 } | |
1757 else if (source == MIME_XML || | |
1758 source == MIME_XML_2) | |
1759 { | |
1760 target = MimeType_Xml; | |
1761 return true; | |
1762 } | |
1763 else if (source == MIME_PLAIN_TEXT) | |
1764 { | |
1765 target = MimeType_PlainText; | |
1766 return true; | |
1767 } | |
1768 else if (source == MIME_PAM) | |
1769 { | |
1770 target = MimeType_Pam; | |
1771 return true; | |
1772 } | |
1773 else if (source == MIME_HTML) | |
1774 { | |
1775 target = MimeType_Html; | |
1776 return true; | |
1777 } | |
1778 else if (source == MIME_GZIP) | |
1779 { | |
1780 target = MimeType_Gzip; | |
1781 return true; | |
1782 } | |
1783 else if (source == MIME_JAVASCRIPT) | |
1784 { | |
1785 target = MimeType_JavaScript; | |
1786 return true; | |
1787 } | |
1788 else if (source == MIME_CSS) | |
1789 { | |
1790 target = MimeType_Css; | |
1791 return true; | |
1792 } | |
1793 else if (source == MIME_WEB_ASSEMBLY) | |
1794 { | |
1795 target = MimeType_WebAssembly; | |
1796 return true; | |
1797 } | |
1798 else if (source == MIME_GIF) | |
1799 { | |
1800 target = MimeType_Gif; | |
1801 return true; | |
1802 } | |
1803 else if (source == MIME_ZIP) | |
1804 { | |
1805 target = MimeType_Zip; | |
1806 return true; | |
1807 } | |
1808 else if (source == MIME_NACL) | |
1809 { | |
1810 target = MimeType_NaCl; | |
1811 return true; | |
1812 } | |
1813 else if (source == MIME_PNACL) | |
1814 { | |
1815 target = MimeType_PNaCl; | |
1816 return true; | |
1817 } | |
1818 else if (source == MIME_SVG) | |
1819 { | |
1820 target = MimeType_Svg; | |
1821 return true; | |
1822 } | |
1823 else if (source == MIME_WOFF) | |
1824 { | |
1825 target = MimeType_Woff; | |
1826 return true; | |
1827 } | |
1828 else if (source == MIME_WOFF2) | |
1829 { | |
1830 target = MimeType_Woff2; | |
1831 return true; | |
1832 } | |
1833 else if (source == MIME_DICOM_WEB_JSON) | |
1834 { | |
1835 target = MimeType_DicomWebJson; | |
1836 return true; | |
1837 } | |
1838 else if (source == MIME_DICOM_WEB_XML) | |
1839 { | |
1840 target = MimeType_DicomWebXml; | |
1841 return true; | |
1842 } | |
4887 | 1843 else if (source == MIME_ICO) |
1844 { | |
1845 target = MimeType_Ico; | |
1846 return true; | |
1847 } | |
5348
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1848 else if (source == MIME_OBJ) |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1849 { |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1850 target = MimeType_Obj; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1851 return true; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1852 } |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1853 else if (source == MIME_MTL) |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1854 { |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1855 target = MimeType_Mtl; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1856 return true; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1857 } |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1858 else if (source == MIME_STL) |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1859 { |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1860 target = MimeType_Stl; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1861 return true; |
303e930fff0f
"/tools/create-dicom" can now be used to create Encapsulated 3D Manufacturing Model IODs (MTL, OBJ, or STL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5334
diff
changeset
|
1862 } |
4073 | 1863 else |
1864 { | |
1865 return false; | |
1866 } | |
1867 } | |
1868 | |
1869 | |
1870 | |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1871 MimeType StringToMimeType(const std::string& mime) |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1872 { |
4073 | 1873 MimeType result; |
1874 if (LookupMimeType(result, mime)) | |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1875 { |
4073 | 1876 return result; |
3203
810772486249
URI "/instances/.../file" can return DICOMweb JSON or XML, depending on Accept header
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3174
diff
changeset
|
1877 } |
2908
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1878 else |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1879 { |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1880 throw OrthancException(ErrorCode_ParameterOutOfRange); |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1881 } |
9d277f8ad698
new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2888
diff
changeset
|
1882 } |
2655 | 1883 |
1884 | |
4730
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1885 DicomToJsonFormat StringToDicomToJsonFormat(const std::string& format) |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1886 { |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1887 if (format == "Full") |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1888 { |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1889 return DicomToJsonFormat_Full; |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1890 } |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1891 else if (format == "Short") |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1892 { |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1893 return DicomToJsonFormat_Short; |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1894 } |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1895 else if (format == "Simplify") |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1896 { |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1897 return DicomToJsonFormat_Human; |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1898 } |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1899 else |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1900 { |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1901 throw OrthancException(ErrorCode_ParameterOutOfRange); |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1902 } |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1903 } |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1904 |
7826ac059c31
Added Short/Simplify/Full options to format "/modalities/{id}/find-worklist" and "/queries/{id}/retrieve"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4677
diff
changeset
|
1905 |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1906 unsigned int GetBytesPerPixel(PixelFormat format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1907 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1908 switch (format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1909 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1910 case PixelFormat_Grayscale8: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1911 return 1; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1912 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1913 case PixelFormat_Grayscale16: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1914 case PixelFormat_SignedGrayscale16: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1915 return 2; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1916 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1917 case PixelFormat_RGB24: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1918 return 3; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1919 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1920 case PixelFormat_RGBA32: |
2089
7a969f235adf
PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2007
diff
changeset
|
1921 case PixelFormat_BGRA32: |
2415
7e217a1cc63f
PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2407
diff
changeset
|
1922 case PixelFormat_Grayscale32: |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1923 return 4; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1924 |
1993
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
1925 case PixelFormat_Float32: |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
1926 assert(sizeof(float) == 4); |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
1927 return 4; |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
1928 |
2423
5a7c5c541a1d
Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2415
diff
changeset
|
1929 case PixelFormat_RGB48: |
5a7c5c541a1d
Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2415
diff
changeset
|
1930 return 6; |
5a7c5c541a1d
Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2415
diff
changeset
|
1931 |
2645
89b789366596
Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2499
diff
changeset
|
1932 case PixelFormat_Grayscale64: |
5054
255b02c68908
Added support for RGBA64 images in tools/create-dicom and /preview (Contribution from James Manners - Pliny)
Alain Mazy <am@osimis.io>
parents:
5037
diff
changeset
|
1933 case PixelFormat_RGBA64: |
2645
89b789366596
Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2499
diff
changeset
|
1934 return 8; |
89b789366596
Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2499
diff
changeset
|
1935 |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1936 default: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1937 throw OrthancException(ErrorCode_ParameterOutOfRange); |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1938 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1939 } |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1940 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1941 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1942 bool GetDicomEncoding(Encoding& encoding, |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1943 const char* specificCharacterSet) |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1944 { |
2202
9b373b7d6713
Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2133
diff
changeset
|
1945 std::string s = Toolbox::StripSpaces(specificCharacterSet); |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1946 Toolbox::ToUpperCase(s); |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1947 |
5291
800261398381
Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
1948 // handle common spelling mistakes |
800261398381
Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
1949 boost::replace_all(s, "ISO_IR_", "ISO_IR "); |
800261398381
Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
1950 boost::replace_all(s, "ISO_2022_IR_", "ISO 2022 IR "); |
800261398381
Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
1951 |
800261398381
Made Orthanc more resilient to common spelling errors in SpecificCharacterSet
Alain Mazy <am@osimis.io>
parents:
5185
diff
changeset
|
1952 |
1908
5096681efce6
direct hyperlinks to the DICOM standard
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
1953 // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1954 // https://github.com/dcm4che/dcm4che/blob/master/dcm4che-core/src/main/java/org/dcm4che3/data/SpecificCharacterSet.java |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1955 if (s == "ISO_IR 6" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1956 s == "ISO 2022 IR 6") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1957 { |
2202
9b373b7d6713
Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2133
diff
changeset
|
1958 encoding = Encoding_Ascii; |
9b373b7d6713
Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2133
diff
changeset
|
1959 } |
9b373b7d6713
Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2133
diff
changeset
|
1960 else if (s == "ISO_IR 192") |
9b373b7d6713
Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2133
diff
changeset
|
1961 { |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1962 encoding = Encoding_Utf8; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1963 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1964 else if (s == "ISO_IR 100" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1965 s == "ISO 2022 IR 100") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1966 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1967 encoding = Encoding_Latin1; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1968 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1969 else if (s == "ISO_IR 101" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1970 s == "ISO 2022 IR 101") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1971 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1972 encoding = Encoding_Latin2; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1973 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1974 else if (s == "ISO_IR 109" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1975 s == "ISO 2022 IR 109") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1976 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1977 encoding = Encoding_Latin3; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1978 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1979 else if (s == "ISO_IR 110" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1980 s == "ISO 2022 IR 110") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1981 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1982 encoding = Encoding_Latin4; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1983 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1984 else if (s == "ISO_IR 148" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1985 s == "ISO 2022 IR 148") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1986 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1987 encoding = Encoding_Latin5; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1988 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1989 else if (s == "ISO_IR 144" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1990 s == "ISO 2022 IR 144") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1991 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1992 encoding = Encoding_Cyrillic; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1993 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1994 else if (s == "ISO_IR 127" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1995 s == "ISO 2022 IR 127") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1996 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1997 encoding = Encoding_Arabic; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1998 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1999 else if (s == "ISO_IR 126" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2000 s == "ISO 2022 IR 126") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2001 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2002 encoding = Encoding_Greek; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2003 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2004 else if (s == "ISO_IR 138" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2005 s == "ISO 2022 IR 138") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2006 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2007 encoding = Encoding_Hebrew; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2008 } |
3217
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2009 else if (s == "ISO_IR 166" || |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2010 s == "ISO 2022 IR 166") |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2011 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2012 encoding = Encoding_Thai; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2013 } |
3217
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2014 else if (s == "ISO_IR 13" || |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2015 s == "ISO 2022 IR 13") |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2016 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2017 encoding = Encoding_Japanese; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2018 } |
2401
a051aba0037c
Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
2019 else if (s == "GB18030" || s == "GBK") |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2020 { |
2401
a051aba0037c
Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
2021 /** |
a051aba0037c
Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
2022 * According to tumashu@163.com, "In China, many dicom file's |
a051aba0037c
Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
2023 * 0008,0005 tag is set as "GBK", instead of "GB18030", GBK is a |
a051aba0037c
Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
2024 * subset of GB18030, and which is used frequently in China, |
a051aba0037c
Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
2025 * suggest support it." |
a051aba0037c
Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
2026 * https://groups.google.com/d/msg/orthanc-users/WMM8LMbjpUc/02-1f_yFCgAJ |
a051aba0037c
Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
2027 **/ |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2028 encoding = Encoding_Chinese; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2029 } |
3217
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2030 else if (s == "ISO 2022 IR 149") |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2031 { |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2032 encoding = Encoding_Korean; |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2033 } |
3218 | 2034 else if (s == "ISO 2022 IR 87") |
2035 { | |
2036 encoding = Encoding_JapaneseKanji; | |
2037 } | |
3226
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
2038 else if (s == "ISO 2022 IR 58") |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
2039 { |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
2040 encoding = Encoding_SimplifiedChinese; |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
2041 } |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2042 /* |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2043 else if (s == "ISO 2022 IR 159") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2044 { |
3218 | 2045 TODO - Supplementary Kanji set |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2046 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2047 */ |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2048 else |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2049 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2050 return false; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2051 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2052 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2053 // The encoding was properly detected |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2054 return true; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
2055 } |
1146
200fcac0deb4
optimization for access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1090
diff
changeset
|
2056 |
200fcac0deb4
optimization for access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1090
diff
changeset
|
2057 |
1555
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2058 ResourceType GetChildResourceType(ResourceType type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2059 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2060 switch (type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2061 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2062 case ResourceType_Patient: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2063 return ResourceType_Study; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2064 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2065 case ResourceType_Study: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2066 return ResourceType_Series; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2067 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2068 case ResourceType_Series: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2069 return ResourceType_Instance; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2070 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2071 default: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2072 throw OrthancException(ErrorCode_ParameterOutOfRange); |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2073 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2074 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2075 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2076 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2077 ResourceType GetParentResourceType(ResourceType type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2078 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2079 switch (type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2080 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2081 case ResourceType_Study: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2082 return ResourceType_Patient; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2083 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2084 case ResourceType_Series: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2085 return ResourceType_Study; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2086 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2087 case ResourceType_Instance: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2088 return ResourceType_Series; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2089 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2090 default: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2091 throw OrthancException(ErrorCode_ParameterOutOfRange); |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2092 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2093 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2094 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2095 |
3027 | 2096 bool IsResourceLevelAboveOrEqual(ResourceType level, |
2097 ResourceType reference) | |
2098 { | |
2099 switch (reference) | |
2100 { | |
2101 case ResourceType_Patient: | |
2102 return (level == ResourceType_Patient); | |
2103 | |
2104 case ResourceType_Study: | |
2105 return (level == ResourceType_Patient || | |
2106 level == ResourceType_Study); | |
2107 | |
2108 case ResourceType_Series: | |
2109 return (level == ResourceType_Patient || | |
2110 level == ResourceType_Study || | |
2111 level == ResourceType_Series); | |
2112 | |
2113 case ResourceType_Instance: | |
2114 return (level == ResourceType_Patient || | |
2115 level == ResourceType_Study || | |
2116 level == ResourceType_Series || | |
2117 level == ResourceType_Instance); | |
2118 | |
2119 default: | |
2120 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
2121 } | |
2122 } | |
2123 | |
2124 | |
1555
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2125 DicomModule GetModule(ResourceType type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2126 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2127 switch (type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2128 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2129 case ResourceType_Patient: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2130 return DicomModule_Patient; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2131 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2132 case ResourceType_Study: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2133 return DicomModule_Study; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2134 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2135 case ResourceType_Series: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2136 return DicomModule_Series; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2137 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2138 default: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2139 throw OrthancException(ErrorCode_ParameterOutOfRange); |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2140 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
2141 } |
1565
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2142 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2143 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2144 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2145 const char* GetDicomSpecificCharacterSet(Encoding encoding) |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2146 { |
1908
5096681efce6
direct hyperlinks to the DICOM standard
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
2147 // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 |
1565
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2148 switch (encoding) |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2149 { |
2202
9b373b7d6713
Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2133
diff
changeset
|
2150 case Encoding_Ascii: |
9b373b7d6713
Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2133
diff
changeset
|
2151 return "ISO_IR 6"; |
9b373b7d6713
Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2133
diff
changeset
|
2152 |
1565
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2153 case Encoding_Utf8: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2154 return "ISO_IR 192"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2155 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2156 case Encoding_Latin1: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2157 return "ISO_IR 100"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2158 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2159 case Encoding_Latin2: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2160 return "ISO_IR 101"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2161 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2162 case Encoding_Latin3: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2163 return "ISO_IR 109"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2164 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2165 case Encoding_Latin4: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2166 return "ISO_IR 110"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2167 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2168 case Encoding_Latin5: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2169 return "ISO_IR 148"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2170 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2171 case Encoding_Cyrillic: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2172 return "ISO_IR 144"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2173 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2174 case Encoding_Arabic: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2175 return "ISO_IR 127"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2176 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2177 case Encoding_Greek: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2178 return "ISO_IR 126"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2179 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2180 case Encoding_Hebrew: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2181 return "ISO_IR 138"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2182 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2183 case Encoding_Japanese: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2184 return "ISO_IR 13"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2185 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2186 case Encoding_Chinese: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2187 return "GB18030"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2188 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2189 case Encoding_Thai: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2190 return "ISO_IR 166"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2191 |
3217
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2192 case Encoding_Korean: |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2193 return "ISO 2022 IR 149"; |
cf8cbeb35f33
preliminary support of Korean character set
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3203
diff
changeset
|
2194 |
3218 | 2195 case Encoding_JapaneseKanji: |
2196 return "ISO 2022 IR 87"; | |
2197 | |
3226
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
2198 case Encoding_SimplifiedChinese: |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
2199 return "ISO 2022 IR 58"; |
45e1631febbb
support of simplified chinese
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3219
diff
changeset
|
2200 |
1565
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2201 default: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2202 throw OrthancException(ErrorCode_ParameterOutOfRange); |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2203 } |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
2204 } |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2205 |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2206 |
1578 | 2207 // This function is autogenerated by the script |
4932
b7ce2bb6b881
refactored the list of MainDicomTags to be able to change it dynamicaly. Unit tests and Integration tests ok
Alain Mazy <am@osimis.io>
parents:
4912
diff
changeset
|
2208 // "Resources/CodeGeneration/GenerateErrorCodes.py" |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2209 HttpStatus ConvertErrorCodeToHttpStatus(ErrorCode error) |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2210 { |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2211 switch (error) |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2212 { |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2213 case ErrorCode_Success: |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2214 return HttpStatus_200_Ok; |
1577
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2215 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2216 case ErrorCode_ParameterOutOfRange: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2217 return HttpStatus_400_BadRequest; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2218 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2219 case ErrorCode_BadParameterType: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2220 return HttpStatus_400_BadRequest; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2221 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2222 case ErrorCode_InexistentItem: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2223 return HttpStatus_404_NotFound; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2224 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2225 case ErrorCode_BadRequest: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2226 return HttpStatus_400_BadRequest; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2227 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2228 case ErrorCode_UriSyntax: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2229 return HttpStatus_400_BadRequest; |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2230 |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2231 case ErrorCode_InexistentFile: |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2232 return HttpStatus_404_NotFound; |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2233 |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2234 case ErrorCode_BadFileFormat: |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2235 return HttpStatus_400_BadRequest; |
1577
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2236 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2237 case ErrorCode_UnknownResource: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2238 return HttpStatus_404_NotFound; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2239 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2240 case ErrorCode_InexistentTag: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
2241 return HttpStatus_404_NotFound; |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2242 |
1596
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2243 case ErrorCode_BadJson: |
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2244 return HttpStatus_400_BadRequest; |
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2245 |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2246 case ErrorCode_Unauthorized: |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2247 return HttpStatus_401_Unauthorized; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2248 |
1781
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
2249 case ErrorCode_NotAcceptable: |
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
2250 return HttpStatus_406_NotAcceptable; |
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
2251 |
2486
ad8f30fc28d1
new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
2252 case ErrorCode_DatabaseUnavailable: |
ad8f30fc28d1
new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
2253 return HttpStatus_503_ServiceUnavailable; |
ad8f30fc28d1
new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
2254 |
4442
f77ee6e6cf47
new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
2255 case ErrorCode_BadRange: |
f77ee6e6cf47
new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
2256 return HttpStatus_416_RequestedRangeNotSatisfiable; |
f77ee6e6cf47
new error code: ErrorCode_BadRange
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
2257 |
4551
350a22c094f2
testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
2258 case ErrorCode_DatabaseCannotSerialize: |
350a22c094f2
testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
2259 return HttpStatus_503_ServiceUnavailable; |
350a22c094f2
testing replay of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4469
diff
changeset
|
2260 |
4608
de5e6b04442d
added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4551
diff
changeset
|
2261 case ErrorCode_Revision: |
de5e6b04442d
added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4551
diff
changeset
|
2262 return HttpStatus_409_Conflict; |
de5e6b04442d
added ErrorCode_Revision
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4551
diff
changeset
|
2263 |
5383 | 2264 case ErrorCode_ForbiddenAccess: |
2265 return HttpStatus_403_Forbidden; | |
2266 | |
2953
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2267 case ErrorCode_CreateDicomNotString: |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2268 return HttpStatus_400_BadRequest; |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2269 |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2270 case ErrorCode_CreateDicomOverrideTag: |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2271 return HttpStatus_400_BadRequest; |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2272 |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2273 case ErrorCode_CreateDicomUseContent: |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2274 return HttpStatus_400_BadRequest; |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2275 |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2276 case ErrorCode_CreateDicomNoPayload: |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2277 return HttpStatus_400_BadRequest; |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2278 |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2279 case ErrorCode_CreateDicomUseDataUriScheme: |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2280 return HttpStatus_400_BadRequest; |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2281 |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2282 case ErrorCode_CreateDicomBadParent: |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2283 return HttpStatus_400_BadRequest; |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2284 |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2285 case ErrorCode_CreateDicomParentIsInstance: |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2286 return HttpStatus_400_BadRequest; |
210d5afd8f2b
GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2924
diff
changeset
|
2287 |
3404
e280ced38a4c
ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3376
diff
changeset
|
2288 case ErrorCode_UnsupportedMediaType: |
e280ced38a4c
ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3376
diff
changeset
|
2289 return HttpStatus_415_UnsupportedMediaType; |
e280ced38a4c
ErrorCode_UnsupportedMediaType
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3376
diff
changeset
|
2290 |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2291 default: |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2292 return HttpStatus_500_InternalServerError; |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2293 } |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
2294 } |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
2295 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
2296 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
2297 bool IsUserContentType(FileContentType type) |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
2298 { |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
2299 return (type >= FileContentType_StartUser && |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
2300 type <= FileContentType_EndUser); |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
2301 } |
2007
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2302 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2303 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2304 bool IsBinaryValueRepresentation(ValueRepresentation vr) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2305 { |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2306 // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2307 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2308 switch (vr) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2309 { |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2310 case ValueRepresentation_ApplicationEntity: // AE |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2311 case ValueRepresentation_AgeString: // AS |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2312 case ValueRepresentation_CodeString: // CS |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2313 case ValueRepresentation_Date: // DA |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2314 case ValueRepresentation_DecimalString: // DS |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2315 case ValueRepresentation_DateTime: // DT |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2316 case ValueRepresentation_IntegerString: // IS |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2317 case ValueRepresentation_LongString: // LO |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2318 case ValueRepresentation_LongText: // LT |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2319 case ValueRepresentation_PersonName: // PN |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2320 case ValueRepresentation_ShortString: // SH |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2321 case ValueRepresentation_ShortText: // ST |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2322 case ValueRepresentation_Time: // TM |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2323 case ValueRepresentation_UnlimitedCharacters: // UC |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2324 case ValueRepresentation_UniqueIdentifier: // UI (UID) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2325 case ValueRepresentation_UniversalResource: // UR (URI or URL) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2326 case ValueRepresentation_UnlimitedText: // UT |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2327 { |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2328 return false; |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2329 } |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2330 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2331 /** |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2332 * Below are all the VR whose character repertoire is tagged as |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2333 * "not applicable" |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2334 **/ |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2335 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2336 case ValueRepresentation_FloatingPointSingle: // FL (float) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2337 case ValueRepresentation_FloatingPointDouble: // FD (double) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2338 case ValueRepresentation_OtherByte: // OB |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2339 case ValueRepresentation_OtherDouble: // OD |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2340 case ValueRepresentation_OtherFloat: // OF |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2341 case ValueRepresentation_OtherLong: // OL |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2342 case ValueRepresentation_OtherWord: // OW |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2343 case ValueRepresentation_SignedLong: // SL (int32_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2344 case ValueRepresentation_Sequence: // SQ |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2345 case ValueRepresentation_SignedShort: // SS (int16_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2346 case ValueRepresentation_UnsignedLong: // UL (uint32_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2347 case ValueRepresentation_Unknown: // UN |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2348 case ValueRepresentation_UnsignedShort: // US (uint16_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2349 { |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2350 return true; |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2351 } |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2352 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2353 case ValueRepresentation_NotSupported: |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2354 default: |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2355 throw OrthancException(ErrorCode_ParameterOutOfRange); |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2356 } |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2357 } |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2358 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2359 |
5398
08b5516c6e5e
compatibility of OrthancFramework with latest releases of Emscripten
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5383
diff
changeset
|
2360 static Mutex defaultEncodingMutex_; // Should not be necessary |
08b5516c6e5e
compatibility of OrthancFramework with latest releases of Emscripten
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5383
diff
changeset
|
2361 static Encoding defaultEncoding_ = ORTHANC_DEFAULT_DICOM_ENCODING; |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2362 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2363 Encoding GetDefaultDicomEncoding() |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2364 { |
5398
08b5516c6e5e
compatibility of OrthancFramework with latest releases of Emscripten
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5383
diff
changeset
|
2365 Mutex::ScopedLock lock(defaultEncodingMutex_); |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2366 return defaultEncoding_; |
2007
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
2367 } |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2368 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2369 void SetDefaultDicomEncoding(Encoding encoding) |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2370 { |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2371 std::string name = EnumerationToString(encoding); |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2372 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2373 { |
5398
08b5516c6e5e
compatibility of OrthancFramework with latest releases of Emscripten
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5383
diff
changeset
|
2374 Mutex::ScopedLock lock(defaultEncodingMutex_); |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2375 defaultEncoding_ = encoding; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2376 } |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2377 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2378 LOG(INFO) << "Default encoding for DICOM was changed to: " << name; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2379 } |
4399
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2380 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2381 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2382 const char* GetResourceTypeText(ResourceType type, |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2383 bool isPlural, |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2384 bool isUpperCase) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2385 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2386 if (isPlural && !isUpperCase) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2387 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2388 switch (type) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2389 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2390 case ResourceType_Patient: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2391 return "patients"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2392 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2393 case ResourceType_Study: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2394 return "studies"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2395 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2396 case ResourceType_Series: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2397 return "series"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2398 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2399 case ResourceType_Instance: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2400 return "instances"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2401 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2402 default: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2403 throw OrthancException(ErrorCode_ParameterOutOfRange); |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2404 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2405 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2406 else if (isPlural && isUpperCase) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2407 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2408 switch (type) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2409 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2410 case ResourceType_Patient: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2411 return "Patients"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2412 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2413 case ResourceType_Study: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2414 return "Studies"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2415 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2416 case ResourceType_Series: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2417 return "Series"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2418 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2419 case ResourceType_Instance: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2420 return "Instances"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2421 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2422 default: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2423 throw OrthancException(ErrorCode_ParameterOutOfRange); |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2424 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2425 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2426 else if (!isPlural && !isUpperCase) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2427 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2428 switch (type) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2429 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2430 case ResourceType_Patient: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2431 return "patient"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2432 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2433 case ResourceType_Study: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2434 return "study"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2435 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2436 case ResourceType_Series: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2437 return "series"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2438 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2439 case ResourceType_Instance: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2440 return "instance"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2441 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2442 default: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2443 throw OrthancException(ErrorCode_ParameterOutOfRange); |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2444 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2445 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2446 else if (!isPlural && isUpperCase) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2447 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2448 switch (type) |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2449 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2450 case ResourceType_Patient: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2451 return "Patient"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2452 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2453 case ResourceType_Study: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2454 return "Study"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2455 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2456 case ResourceType_Series: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2457 return "Series"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2458 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2459 case ResourceType_Instance: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2460 return "Instance"; |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2461 |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2462 default: |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2463 throw OrthancException(ErrorCode_ParameterOutOfRange); |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2464 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2465 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2466 else |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2467 { |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2468 throw OrthancException(ErrorCode_InternalError); |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2469 } |
80fd140b12ba
New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4376
diff
changeset
|
2470 } |
5426
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2471 |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2472 DicomTransferSyntax GetTransferSyntax(const std::string& value) |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2473 { |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2474 DicomTransferSyntax syntax; |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2475 if (LookupTransferSyntax(syntax, value)) |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2476 { |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2477 return syntax; |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2478 } |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2479 else |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2480 { |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2481 throw OrthancException(ErrorCode_ParameterOutOfRange, |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2482 "Unknown transfer syntax: " + value); |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2483 } |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2484 } |
c65e036d649b
StorageCache is now storing transcoded instances + added ?transcode=... option to the /file route.
Alain Mazy <am@osimis.io>
parents:
5407
diff
changeset
|
2485 |
3730
ae31ba2b09a6
toolbox: LookupTransferSyntax()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3727
diff
changeset
|
2486 } |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2281
diff
changeset
|
2487 |
3727
090022f1b5e1
auto-generation of primitives to handle transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3643
diff
changeset
|
2488 |
3730
ae31ba2b09a6
toolbox: LookupTransferSyntax()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3727
diff
changeset
|
2489 #include "./Enumerations_TransferSyntaxes.impl.h" |