Mercurial > hg > orthanc
annotate Core/Enumerations.cpp @ 2144:a979ded1dbb1
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Nov 2016 16:57:19 +0100 |
parents | 15ae532af70e |
children | 9b373b7d6713 |
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 |
477 | 5 * |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
22 * | |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
824
a811bdf8b8eb
precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
800
diff
changeset
|
33 #include "PrecompiledHeaders.h" |
477 | 34 #include "Enumerations.h" |
35 | |
36 #include "OrthancException.h" | |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
37 #include "Toolbox.h" |
2006
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
38 #include "Logging.h" |
477 | 39 |
1495
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
40 #include <string.h> |
1993
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
41 #include <cassert> |
1495
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
42 |
477 | 43 namespace Orthanc |
44 { | |
1578 | 45 // This function is autogenerated by the script |
46 // "Resources/GenerateErrorCodes.py" | |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
47 const char* EnumerationToString(ErrorCode error) |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
48 { |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
49 switch (error) |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
50 { |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
51 case ErrorCode_InternalError: |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
52 return "Internal error"; |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
53 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
54 case ErrorCode_Success: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
55 return "Success"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
56 |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
57 case ErrorCode_Plugin: |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
58 return "Error encountered within the plugin engine"; |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
59 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
60 case ErrorCode_NotImplemented: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
61 return "Not implemented yet"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
62 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
63 case ErrorCode_ParameterOutOfRange: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
64 return "Parameter out of range"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
65 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
66 case ErrorCode_NotEnoughMemory: |
2133 | 67 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
|
68 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
69 case ErrorCode_BadParameterType: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
70 return "Bad type for a parameter"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
71 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
72 case ErrorCode_BadSequenceOfCalls: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
73 return "Bad sequence of calls"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
74 |
1577
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
75 case ErrorCode_InexistentItem: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
76 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
|
77 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
78 case ErrorCode_BadRequest: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
79 return "Bad request"; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
80 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
81 case ErrorCode_NetworkProtocol: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
82 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
|
83 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
84 case ErrorCode_SystemCommand: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
85 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
|
86 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
87 case ErrorCode_Database: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
88 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
|
89 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
90 case ErrorCode_UriSyntax: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
91 return "Badly formatted URI"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
92 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
93 case ErrorCode_InexistentFile: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
94 return "Inexistent file"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
95 |
1577
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
96 case ErrorCode_CannotWriteFile: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
97 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
|
98 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
99 case ErrorCode_BadFileFormat: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
100 return "Bad file format"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
101 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
102 case ErrorCode_Timeout: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
103 return "Timeout"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
104 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
105 case ErrorCode_UnknownResource: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
106 return "Unknown resource"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
107 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
108 case ErrorCode_IncompatibleDatabaseVersion: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
109 return "Incompatible version of the database"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
110 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
111 case ErrorCode_FullStorage: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
112 return "The file storage is full"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
113 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
114 case ErrorCode_CorruptedFile: |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
115 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
|
116 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
117 case ErrorCode_InexistentTag: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
118 return "Inexistent tag"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
119 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
120 case ErrorCode_ReadOnly: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
121 return "Cannot modify a read-only data structure"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
122 |
1577
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
123 case ErrorCode_IncompatibleImageFormat: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
124 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
|
125 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
126 case ErrorCode_IncompatibleImageSize: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
127 return "Incompatible size of the images"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
128 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
129 case ErrorCode_SharedLibrary: |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
130 return "Error while using a shared library (plugin)"; |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
131 |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
132 case ErrorCode_UnknownPluginService: |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
133 return "Plugin invoking an unknown service"; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
134 |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
135 case ErrorCode_UnknownDicomTag: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
136 return "Unknown DICOM tag"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
137 |
1596
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
138 case ErrorCode_BadJson: |
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
139 return "Cannot parse a JSON document"; |
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
140 |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
141 case ErrorCode_Unauthorized: |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
142 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
|
143 |
1610
2dff2bdffdb8
font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
144 case ErrorCode_BadFont: |
2dff2bdffdb8
font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
145 return "Badly formatted font file"; |
2dff2bdffdb8
font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
146 |
1643
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
147 case ErrorCode_DatabasePlugin: |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
148 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
|
149 |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
150 case ErrorCode_StorageAreaPlugin: |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
151 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
|
152 |
1746 | 153 case ErrorCode_EmptyRequest: |
154 return "The request is empty"; | |
155 | |
1781
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
156 case ErrorCode_NotAcceptable: |
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
157 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
|
158 |
2132
a43708636890
ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2089
diff
changeset
|
159 case ErrorCode_NullPointer: |
a43708636890
ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2089
diff
changeset
|
160 return "Cannot handle a NULL pointer"; |
a43708636890
ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2089
diff
changeset
|
161 |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
162 case ErrorCode_SQLiteNotOpened: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
163 return "SQLite: The database is not opened"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
164 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
165 case ErrorCode_SQLiteAlreadyOpened: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
166 return "SQLite: Connection is already open"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
167 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
168 case ErrorCode_SQLiteCannotOpen: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
169 return "SQLite: Unable to open the database"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
170 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
171 case ErrorCode_SQLiteStatementAlreadyUsed: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
172 return "SQLite: This cached statement is already being referred to"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
173 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
174 case ErrorCode_SQLiteExecute: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
175 return "SQLite: Cannot execute a command"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
176 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
177 case ErrorCode_SQLiteRollbackWithoutTransaction: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
178 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
|
179 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
180 case ErrorCode_SQLiteCommitWithoutTransaction: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
181 return "SQLite: Committing a nonexistent transaction"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
182 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
183 case ErrorCode_SQLiteRegisterFunction: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
184 return "SQLite: Unable to register a function"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
185 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
186 case ErrorCode_SQLiteFlush: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
187 return "SQLite: Unable to flush the database"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
188 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
189 case ErrorCode_SQLiteCannotRun: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
190 return "SQLite: Cannot run a cached statement"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
191 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
192 case ErrorCode_SQLiteCannotStep: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
193 return "SQLite: Cannot step over a cached statement"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
194 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
195 case ErrorCode_SQLiteBindOutOfRange: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
196 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
|
197 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
198 case ErrorCode_SQLitePrepareStatement: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
199 return "SQLite: Cannot prepare a cached statement"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
200 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
201 case ErrorCode_SQLiteTransactionAlreadyStarted: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
202 return "SQLite: Beginning the same transaction twice"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
203 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
204 case ErrorCode_SQLiteTransactionCommit: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
205 return "SQLite: Failure when committing the transaction"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
206 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
207 case ErrorCode_SQLiteTransactionBegin: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
208 return "SQLite: Cannot start a transaction"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
209 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
210 case ErrorCode_DirectoryOverFile: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
211 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
|
212 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
213 case ErrorCode_FileStorageCannotWrite: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
214 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
|
215 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
216 case ErrorCode_DirectoryExpected: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
217 return "The specified path does not point to a directory"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
218 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
219 case ErrorCode_HttpPortInUse: |
1949
d90f737f2dde
warn about the use of privileged ports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1926
diff
changeset
|
220 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
|
221 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
222 case ErrorCode_DicomPortInUse: |
1949
d90f737f2dde
warn about the use of privileged ports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1926
diff
changeset
|
223 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
|
224 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
225 case ErrorCode_BadHttpStatusInRest: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
226 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
|
227 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
228 case ErrorCode_RegularFileExpected: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
229 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
|
230 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
231 case ErrorCode_PathToExecutable: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
232 return "Unable to get the path to the executable"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
233 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
234 case ErrorCode_MakeDirectory: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
235 return "Cannot create a directory"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
236 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
237 case ErrorCode_BadApplicationEntityTitle: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
238 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
|
239 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
240 case ErrorCode_NoCFindHandler: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
241 return "No request handler factory for DICOM C-FIND SCP"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
242 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
243 case ErrorCode_NoCMoveHandler: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
244 return "No request handler factory for DICOM C-MOVE SCP"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
245 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
246 case ErrorCode_NoCStoreHandler: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
247 return "No request handler factory for DICOM C-STORE SCP"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
248 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
249 case ErrorCode_NoApplicationEntityFilter: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
250 return "No application entity filter"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
251 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
252 case ErrorCode_NoSopClassOrInstance: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
253 return "DicomUserConnection: Unable to find the SOP class and instance"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
254 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
255 case ErrorCode_NoPresentationContext: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
256 return "DicomUserConnection: No acceptable presentation context for modality"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
257 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
258 case ErrorCode_DicomFindUnavailable: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
259 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
|
260 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
261 case ErrorCode_DicomMoveUnavailable: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
262 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
|
263 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
264 case ErrorCode_CannotStoreInstance: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
265 return "Cannot store an instance"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
266 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
267 case ErrorCode_CreateDicomNotString: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
268 return "Only string values are supported when creating DICOM instances"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
269 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
270 case ErrorCode_CreateDicomOverrideTag: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
271 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
|
272 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
273 case ErrorCode_CreateDicomUseContent: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
274 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
|
275 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
276 case ErrorCode_CreateDicomNoPayload: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
277 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
|
278 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
279 case ErrorCode_CreateDicomUseDataUriScheme: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
280 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
|
281 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
282 case ErrorCode_CreateDicomBadParent: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
283 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
|
284 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
285 case ErrorCode_CreateDicomParentIsInstance: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
286 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
|
287 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
288 case ErrorCode_CreateDicomParentEncoding: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
289 return "Unable to get the encoding of the parent resource"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
290 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
291 case ErrorCode_UnknownModality: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
292 return "Unknown modality"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
293 |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
294 case ErrorCode_BadJobOrdering: |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
295 return "Bad ordering of filters in a job"; |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
296 |
1583
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
297 case ErrorCode_JsonToLuaTable: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
298 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
|
299 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
300 case ErrorCode_CannotCreateLua: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
301 return "Cannot create the Lua context"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
302 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
303 case ErrorCode_CannotExecuteLua: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
304 return "Cannot execute a Lua command"; |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
305 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
306 case ErrorCode_LuaAlreadyExecuted: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
307 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
|
308 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
309 case ErrorCode_LuaBadOutput: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
310 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
|
311 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
312 case ErrorCode_NotLuaPredicate: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
313 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
|
314 |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
315 case ErrorCode_LuaReturnsNoString: |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
316 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
|
317 |
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
|
318 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
|
319 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
|
320 |
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
|
321 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
|
322 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
|
323 |
1643
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
324 case ErrorCode_DatabaseNotInitialized: |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
325 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
|
326 |
1703
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
327 case ErrorCode_SslDisabled: |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
328 return "Orthanc has been built without SSL support"; |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
329 |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
330 case ErrorCode_CannotOrderSlices: |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
331 return "Unable to order the slices of the series"; |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
332 |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1781
diff
changeset
|
333 case ErrorCode_NoWorklistHandler: |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1781
diff
changeset
|
334 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
|
335 |
1980
ebce5f456b8e
new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1949
diff
changeset
|
336 case ErrorCode_AlreadyExistingTag: |
ebce5f456b8e
new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1949
diff
changeset
|
337 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
|
338 |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
339 default: |
1703
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
340 if (error >= ErrorCode_START_PLUGINS) |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
341 { |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
342 return "Error encountered within some plugin"; |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
343 } |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
344 else |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
345 { |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
346 return "Unknown error code"; |
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1651
diff
changeset
|
347 } |
1575
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
348 } |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
349 } |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
350 |
f8aae45011c9
exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1572
diff
changeset
|
351 |
477 | 352 const char* EnumerationToString(HttpMethod method) |
353 { | |
354 switch (method) | |
355 { | |
356 case HttpMethod_Get: | |
357 return "GET"; | |
358 | |
359 case HttpMethod_Post: | |
360 return "POST"; | |
361 | |
362 case HttpMethod_Delete: | |
363 return "DELETE"; | |
364 | |
365 case HttpMethod_Put: | |
366 return "PUT"; | |
367 | |
368 default: | |
369 return "?"; | |
370 } | |
371 } | |
372 | |
373 | |
374 const char* EnumerationToString(HttpStatus status) | |
375 { | |
376 switch (status) | |
377 { | |
378 case HttpStatus_100_Continue: | |
379 return "Continue"; | |
380 | |
381 case HttpStatus_101_SwitchingProtocols: | |
382 return "Switching Protocols"; | |
383 | |
384 case HttpStatus_102_Processing: | |
385 return "Processing"; | |
386 | |
387 case HttpStatus_200_Ok: | |
388 return "OK"; | |
389 | |
390 case HttpStatus_201_Created: | |
391 return "Created"; | |
392 | |
393 case HttpStatus_202_Accepted: | |
394 return "Accepted"; | |
395 | |
396 case HttpStatus_203_NonAuthoritativeInformation: | |
397 return "Non-Authoritative Information"; | |
398 | |
399 case HttpStatus_204_NoContent: | |
400 return "No Content"; | |
401 | |
402 case HttpStatus_205_ResetContent: | |
403 return "Reset Content"; | |
404 | |
405 case HttpStatus_206_PartialContent: | |
406 return "Partial Content"; | |
407 | |
408 case HttpStatus_207_MultiStatus: | |
409 return "Multi-Status"; | |
410 | |
411 case HttpStatus_208_AlreadyReported: | |
412 return "Already Reported"; | |
413 | |
414 case HttpStatus_226_IMUsed: | |
415 return "IM Used"; | |
416 | |
417 case HttpStatus_300_MultipleChoices: | |
418 return "Multiple Choices"; | |
419 | |
420 case HttpStatus_301_MovedPermanently: | |
421 return "Moved Permanently"; | |
422 | |
423 case HttpStatus_302_Found: | |
424 return "Found"; | |
425 | |
426 case HttpStatus_303_SeeOther: | |
427 return "See Other"; | |
428 | |
429 case HttpStatus_304_NotModified: | |
430 return "Not Modified"; | |
431 | |
432 case HttpStatus_305_UseProxy: | |
433 return "Use Proxy"; | |
434 | |
435 case HttpStatus_307_TemporaryRedirect: | |
436 return "Temporary Redirect"; | |
437 | |
438 case HttpStatus_400_BadRequest: | |
439 return "Bad Request"; | |
440 | |
441 case HttpStatus_401_Unauthorized: | |
442 return "Unauthorized"; | |
443 | |
444 case HttpStatus_402_PaymentRequired: | |
445 return "Payment Required"; | |
446 | |
447 case HttpStatus_403_Forbidden: | |
448 return "Forbidden"; | |
449 | |
450 case HttpStatus_404_NotFound: | |
451 return "Not Found"; | |
452 | |
453 case HttpStatus_405_MethodNotAllowed: | |
454 return "Method Not Allowed"; | |
455 | |
456 case HttpStatus_406_NotAcceptable: | |
457 return "Not Acceptable"; | |
458 | |
459 case HttpStatus_407_ProxyAuthenticationRequired: | |
460 return "Proxy Authentication Required"; | |
461 | |
462 case HttpStatus_408_RequestTimeout: | |
463 return "Request Timeout"; | |
464 | |
465 case HttpStatus_409_Conflict: | |
466 return "Conflict"; | |
467 | |
468 case HttpStatus_410_Gone: | |
469 return "Gone"; | |
470 | |
471 case HttpStatus_411_LengthRequired: | |
472 return "Length Required"; | |
473 | |
474 case HttpStatus_412_PreconditionFailed: | |
475 return "Precondition Failed"; | |
476 | |
477 case HttpStatus_413_RequestEntityTooLarge: | |
478 return "Request Entity Too Large"; | |
479 | |
480 case HttpStatus_414_RequestUriTooLong: | |
481 return "Request-URI Too Long"; | |
482 | |
483 case HttpStatus_415_UnsupportedMediaType: | |
484 return "Unsupported Media Type"; | |
485 | |
486 case HttpStatus_416_RequestedRangeNotSatisfiable: | |
487 return "Requested Range Not Satisfiable"; | |
488 | |
489 case HttpStatus_417_ExpectationFailed: | |
490 return "Expectation Failed"; | |
491 | |
492 case HttpStatus_422_UnprocessableEntity: | |
493 return "Unprocessable Entity"; | |
494 | |
495 case HttpStatus_423_Locked: | |
496 return "Locked"; | |
497 | |
498 case HttpStatus_424_FailedDependency: | |
499 return "Failed Dependency"; | |
500 | |
501 case HttpStatus_426_UpgradeRequired: | |
502 return "Upgrade Required"; | |
503 | |
504 case HttpStatus_500_InternalServerError: | |
505 return "Internal Server Error"; | |
506 | |
507 case HttpStatus_501_NotImplemented: | |
508 return "Not Implemented"; | |
509 | |
510 case HttpStatus_502_BadGateway: | |
511 return "Bad Gateway"; | |
512 | |
513 case HttpStatus_503_ServiceUnavailable: | |
514 return "Service Unavailable"; | |
515 | |
516 case HttpStatus_504_GatewayTimeout: | |
517 return "Gateway Timeout"; | |
518 | |
519 case HttpStatus_505_HttpVersionNotSupported: | |
520 return "HTTP Version Not Supported"; | |
521 | |
522 case HttpStatus_506_VariantAlsoNegotiates: | |
523 return "Variant Also Negotiates"; | |
524 | |
525 case HttpStatus_507_InsufficientStorage: | |
526 return "Insufficient Storage"; | |
527 | |
528 case HttpStatus_509_BandwidthLimitExceeded: | |
529 return "Bandwidth Limit Exceeded"; | |
530 | |
531 case HttpStatus_510_NotExtended: | |
532 return "Not Extended"; | |
533 | |
534 default: | |
535 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
536 } | |
537 } | |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
538 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
539 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
540 const char* EnumerationToString(ResourceType type) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
541 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
542 switch (type) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
543 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
544 case ResourceType_Patient: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
545 return "Patient"; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
546 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
547 case ResourceType_Study: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
548 return "Study"; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
549 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
550 case ResourceType_Series: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
551 return "Series"; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
552 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
553 case ResourceType_Instance: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
554 return "Instance"; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
555 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
556 default: |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
557 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
558 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
559 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
560 |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
561 |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
562 const char* EnumerationToString(ImageFormat format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
563 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
564 switch (format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
565 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
566 case ImageFormat_Png: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
567 return "Png"; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
568 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
569 default: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
570 throw OrthancException(ErrorCode_ParameterOutOfRange); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
571 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
572 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
573 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
574 |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
575 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
|
576 { |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
577 switch (encoding) |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
578 { |
1087 | 579 case Encoding_Ascii: |
580 return "Ascii"; | |
581 | |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
582 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
|
583 return "Utf8"; |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
584 |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
585 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
|
586 return "Latin1"; |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
587 |
1087 | 588 case Encoding_Latin2: |
589 return "Latin2"; | |
590 | |
591 case Encoding_Latin3: | |
592 return "Latin3"; | |
593 | |
594 case Encoding_Latin4: | |
595 return "Latin4"; | |
596 | |
597 case Encoding_Latin5: | |
598 return "Latin5"; | |
599 | |
600 case Encoding_Cyrillic: | |
601 return "Cyrillic"; | |
602 | |
1347 | 603 case Encoding_Windows1251: |
604 return "Windows1251"; | |
605 | |
1087 | 606 case Encoding_Arabic: |
607 return "Arabic"; | |
608 | |
609 case Encoding_Greek: | |
610 return "Greek"; | |
611 | |
612 case Encoding_Hebrew: | |
613 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
|
614 |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
615 case Encoding_Thai: |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
616 return "Thai"; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
617 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
618 case Encoding_Japanese: |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
619 return "Japanese"; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
620 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
621 case Encoding_Chinese: |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
622 return "Chinese"; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
623 |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
624 default: |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
625 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
|
626 } |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
627 } |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
628 |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
629 |
1206
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
630 const char* EnumerationToString(PhotometricInterpretation photometric) |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
631 { |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
632 switch (photometric) |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
633 { |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
634 case PhotometricInterpretation_RGB: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
635 return "RGB"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
636 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
637 case PhotometricInterpretation_Monochrome1: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
638 return "Monochrome1"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
639 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
640 case PhotometricInterpretation_Monochrome2: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
641 return "Monochrome2"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
642 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
643 case PhotometricInterpretation_ARGB: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
644 return "ARGB"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
645 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
646 case PhotometricInterpretation_CMYK: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
647 return "CMYK"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
648 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
649 case PhotometricInterpretation_HSV: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
650 return "HSV"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
651 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
652 case PhotometricInterpretation_Palette: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
653 return "Palette color"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
654 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
655 case PhotometricInterpretation_YBRFull: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
656 return "YBR full"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
657 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
658 case PhotometricInterpretation_YBRFull422: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
659 return "YBR full 422"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
660 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
661 case PhotometricInterpretation_YBRPartial420: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
662 return "YBR partial 420"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
663 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
664 case PhotometricInterpretation_YBRPartial422: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
665 return "YBR partial 422"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
666 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
667 case PhotometricInterpretation_YBR_ICT: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
668 return "YBR ICT"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
669 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
670 case PhotometricInterpretation_YBR_RCT: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
671 return "YBR RCT"; |
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 case PhotometricInterpretation_Unknown: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
674 return "Unknown"; |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
675 |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
676 default: |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
677 throw OrthancException(ErrorCode_ParameterOutOfRange); |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
678 } |
f5b0207967bc
Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1146
diff
changeset
|
679 } |
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 |
1571
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
682 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
|
683 { |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
684 switch (origin) |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
685 { |
1572
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
686 case RequestOrigin_Unknown: |
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
687 return "Unknown"; |
904096e7367e
More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
688 |
1571
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
689 case RequestOrigin_DicomProtocol: |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
690 return "DicomProtocol"; |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
691 |
1823
0ef4e6e66b56
"Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
692 case RequestOrigin_RestApi: |
0ef4e6e66b56
"Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
693 return "RestApi"; |
1571
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
694 |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
695 case RequestOrigin_Plugins: |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
696 return "Plugins"; |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
697 |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
698 case RequestOrigin_Lua: |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
699 return "Lua"; |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
700 |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
701 default: |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
702 throw OrthancException(ErrorCode_ParameterOutOfRange); |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
703 } |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
704 } |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
705 |
3232f1c995a5
provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1565
diff
changeset
|
706 |
1495
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
707 const char* EnumerationToString(LogLevel level) |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
708 { |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
709 switch (level) |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
710 { |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
711 case LogLevel_Error: |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
712 return "ERROR"; |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
713 |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
714 case LogLevel_Warning: |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
715 return "WARNING"; |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
716 |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
717 case LogLevel_Info: |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
718 return "INFO"; |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
719 |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
720 case LogLevel_Trace: |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
721 return "TRACE"; |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
722 |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
723 default: |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
724 throw OrthancException(ErrorCode_ParameterOutOfRange); |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
725 } |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
726 } |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
727 |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
728 |
1926
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
729 const char* EnumerationToString(PixelFormat format) |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
730 { |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
731 switch (format) |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
732 { |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
733 case PixelFormat_RGB24: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
734 return "RGB24"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
735 |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
736 case PixelFormat_RGBA32: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
737 return "RGBA32"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
738 |
2089
7a969f235adf
PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2007
diff
changeset
|
739 case PixelFormat_BGRA32: |
7a969f235adf
PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2007
diff
changeset
|
740 return "BGRA32"; |
7a969f235adf
PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2007
diff
changeset
|
741 |
1926
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
742 case PixelFormat_Grayscale8: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
743 return "Grayscale (unsigned 8bpp)"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
744 |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
745 case PixelFormat_Grayscale16: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
746 return "Grayscale (unsigned 16bpp)"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
747 |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
748 case PixelFormat_SignedGrayscale16: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
749 return "Grayscale (signed 16bpp)"; |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
750 |
1993
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
751 case PixelFormat_Float32: |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
752 return "Grayscale (float 32bpp)"; |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
753 |
1926
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
754 default: |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
755 throw OrthancException(ErrorCode_ParameterOutOfRange); |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
756 } |
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 |
2a129de4b5e2
EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1908
diff
changeset
|
759 |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
760 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
|
761 { |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
762 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
|
763 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
|
764 |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
765 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
|
766 { |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
767 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
|
768 } |
1087 | 769 |
770 if (s == "ASCII") | |
771 { | |
772 return Encoding_Ascii; | |
773 } | |
774 | |
775 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
|
776 { |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
777 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
|
778 } |
1087 | 779 |
780 if (s == "LATIN2") | |
781 { | |
782 return Encoding_Latin2; | |
783 } | |
784 | |
785 if (s == "LATIN3") | |
786 { | |
787 return Encoding_Latin3; | |
788 } | |
789 | |
790 if (s == "LATIN4") | |
791 { | |
792 return Encoding_Latin4; | |
793 } | |
794 | |
795 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
|
796 { |
1087 | 797 return Encoding_Latin5; |
798 } | |
799 | |
800 if (s == "CYRILLIC") | |
801 { | |
802 return Encoding_Cyrillic; | |
803 } | |
804 | |
1347 | 805 if (s == "WINDOWS1251") |
806 { | |
807 return Encoding_Windows1251; | |
808 } | |
809 | |
1087 | 810 if (s == "ARABIC") |
811 { | |
812 return Encoding_Arabic; | |
813 } | |
814 | |
815 if (s == "GREEK") | |
816 { | |
817 return Encoding_Greek; | |
818 } | |
819 | |
820 if (s == "HEBREW") | |
821 { | |
822 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
|
823 } |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
824 |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
825 if (s == "THAI") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
826 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
827 return Encoding_Thai; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
828 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
829 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
830 if (s == "JAPANESE") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
831 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
832 return Encoding_Japanese; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
833 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
834 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
835 if (s == "CHINESE") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
836 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
837 return Encoding_Chinese; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
838 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
839 |
1086
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
840 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
|
841 } |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
842 |
e56c3ed8d738
Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
843 |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
844 ResourceType StringToResourceType(const char* type) |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
845 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
846 std::string s(type); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
847 Toolbox::ToUpperCase(s); |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
848 |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
849 if (s == "PATIENT" || s == "PATIENTS") |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
850 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
851 return ResourceType_Patient; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
852 } |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
853 else if (s == "STUDY" || s == "STUDIES") |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
854 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
855 return ResourceType_Study; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
856 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
857 else if (s == "SERIES") |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
858 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
859 return ResourceType_Series; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
860 } |
697
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
861 else if (s == "INSTANCE" || s == "IMAGE" || |
dd1ce9a2844c
access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
862 s == "INSTANCES" || s == "IMAGES") |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
863 { |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
864 return ResourceType_Instance; |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
865 } |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
866 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
867 throw OrthancException(ErrorCode_ParameterOutOfRange); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
868 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
869 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
870 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
871 ImageFormat StringToImageFormat(const char* format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
872 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
873 std::string s(format); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
874 Toolbox::ToUpperCase(s); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
875 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
876 if (s == "PNG") |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
877 { |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
878 return ImageFormat_Png; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
879 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
880 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
881 throw OrthancException(ErrorCode_ParameterOutOfRange); |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
882 } |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
883 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
884 |
1495
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
885 LogLevel StringToLogLevel(const char *level) |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
886 { |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
887 if (strcmp(level, "ERROR") == 0) |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
888 { |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
889 return LogLevel_Error; |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
890 } |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
891 else if (strcmp(level, "WARNING") == 0) |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
892 { |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
893 return LogLevel_Warning; |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
894 } |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
895 else if (strcmp(level, "INFO") == 0) |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
896 { |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
897 return LogLevel_Info; |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
898 } |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
899 else if (strcmp(level, "TRACE") == 0) |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
900 { |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
901 return LogLevel_Trace; |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
902 } |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
903 else |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
904 { |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
905 throw OrthancException(ErrorCode_InternalError); |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
906 } |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
907 } |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
908 |
fbe40117eb21
improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1347
diff
changeset
|
909 |
2006
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
910 ValueRepresentation StringToValueRepresentation(const std::string& vr, |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
911 bool throwIfUnsupported) |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
912 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
913 if (vr == "AE") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
914 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
915 return ValueRepresentation_ApplicationEntity; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
916 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
917 else if (vr == "AS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
918 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
919 return ValueRepresentation_AgeString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
920 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
921 else if (vr == "AT") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
922 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
923 return ValueRepresentation_AttributeTag; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
924 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
925 else if (vr == "CS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
926 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
927 return ValueRepresentation_CodeString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
928 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
929 else if (vr == "DA") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
930 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
931 return ValueRepresentation_Date; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
932 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
933 else if (vr == "DS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
934 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
935 return ValueRepresentation_DecimalString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
936 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
937 else if (vr == "DT") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
938 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
939 return ValueRepresentation_DateTime; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
940 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
941 else if (vr == "FL") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
942 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
943 return ValueRepresentation_FloatingPointSingle; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
944 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
945 else if (vr == "FD") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
946 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
947 return ValueRepresentation_FloatingPointDouble; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
948 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
949 else if (vr == "IS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
950 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
951 return ValueRepresentation_IntegerString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
952 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
953 else if (vr == "LO") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
954 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
955 return ValueRepresentation_LongString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
956 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
957 else if (vr == "LT") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
958 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
959 return ValueRepresentation_LongText; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
960 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
961 else if (vr == "OB") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
962 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
963 return ValueRepresentation_OtherByte; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
964 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
965 else if (vr == "OD") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
966 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
967 return ValueRepresentation_OtherDouble; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
968 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
969 else if (vr == "OF") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
970 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
971 return ValueRepresentation_OtherFloat; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
972 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
973 else if (vr == "OL") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
974 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
975 return ValueRepresentation_OtherLong; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
976 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
977 else if (vr == "OW") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
978 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
979 return ValueRepresentation_OtherWord; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
980 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
981 else if (vr == "PN") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
982 { |
2007
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
983 return ValueRepresentation_PersonName; |
2006
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
984 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
985 else if (vr == "SH") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
986 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
987 return ValueRepresentation_ShortString; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
988 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
989 else if (vr == "SL") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
990 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
991 return ValueRepresentation_SignedLong; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
992 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
993 else if (vr == "SQ") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
994 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
995 return ValueRepresentation_Sequence; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
996 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
997 else if (vr == "SS") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
998 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
999 return ValueRepresentation_SignedShort; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1000 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1001 else if (vr == "ST") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1002 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1003 return ValueRepresentation_ShortText; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1004 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1005 else if (vr == "TM") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1006 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1007 return ValueRepresentation_Time; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1008 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1009 else if (vr == "UC") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1010 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1011 return ValueRepresentation_UnlimitedCharacters; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1012 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1013 else if (vr == "UI") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1014 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1015 return ValueRepresentation_UniqueIdentifier; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1016 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1017 else if (vr == "UL") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1018 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1019 return ValueRepresentation_UnsignedLong; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1020 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1021 else if (vr == "UN") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1022 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1023 return ValueRepresentation_Unknown; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1024 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1025 else if (vr == "UR") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1026 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1027 return ValueRepresentation_UniversalResource; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1028 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1029 else if (vr == "US") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1030 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1031 return ValueRepresentation_UnsignedShort; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1032 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1033 else if (vr == "UT") |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1034 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1035 return ValueRepresentation_UnlimitedText; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1036 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1037 else |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1038 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1039 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
|
1040 |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1041 if (throwIfUnsupported) |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1042 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1043 LOG(ERROR) << s; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1044 throw OrthancException(ErrorCode_ParameterOutOfRange); |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1045 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1046 else |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1047 { |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1048 LOG(INFO) << s; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1049 return ValueRepresentation_NotSupported; |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1050 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1051 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1052 } |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1053 |
6301bbcbcaed
more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1993
diff
changeset
|
1054 |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1055 unsigned int GetBytesPerPixel(PixelFormat format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1056 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1057 switch (format) |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1058 { |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1059 case PixelFormat_Grayscale8: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1060 return 1; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1061 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1062 case PixelFormat_Grayscale16: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1063 case PixelFormat_SignedGrayscale16: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1064 return 2; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1065 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1066 case PixelFormat_RGB24: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1067 return 3; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1068 |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1069 case PixelFormat_RGBA32: |
2089
7a969f235adf
PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2007
diff
changeset
|
1070 case PixelFormat_BGRA32: |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1071 return 4; |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1072 |
1993
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
1073 case PixelFormat_Float32: |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
1074 assert(sizeof(float) == 4); |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
1075 return 4; |
e2a3ff770b48
introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1980
diff
changeset
|
1076 |
800
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1077 default: |
ecedd89055db
generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
697
diff
changeset
|
1078 throw OrthancException(ErrorCode_ParameterOutOfRange); |
562
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1079 } |
f64e3838d6e1
refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
477
diff
changeset
|
1080 } |
1090
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1081 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1082 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1083 bool GetDicomEncoding(Encoding& encoding, |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1084 const char* specificCharacterSet) |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1085 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1086 std::string s = specificCharacterSet; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1087 Toolbox::ToUpperCase(s); |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1088 |
1908
5096681efce6
direct hyperlinks to the DICOM standard
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
1089 // 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
|
1090 // 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
|
1091 if (s == "ISO_IR 6" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1092 s == "ISO_IR 192" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1093 s == "ISO 2022 IR 6") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1094 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1095 encoding = Encoding_Utf8; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1096 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1097 else if (s == "ISO_IR 100" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1098 s == "ISO 2022 IR 100") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1099 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1100 encoding = Encoding_Latin1; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1101 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1102 else if (s == "ISO_IR 101" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1103 s == "ISO 2022 IR 101") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1104 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1105 encoding = Encoding_Latin2; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1106 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1107 else if (s == "ISO_IR 109" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1108 s == "ISO 2022 IR 109") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1109 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1110 encoding = Encoding_Latin3; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1111 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1112 else if (s == "ISO_IR 110" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1113 s == "ISO 2022 IR 110") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1114 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1115 encoding = Encoding_Latin4; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1116 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1117 else if (s == "ISO_IR 148" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1118 s == "ISO 2022 IR 148") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1119 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1120 encoding = Encoding_Latin5; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1121 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1122 else if (s == "ISO_IR 144" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1123 s == "ISO 2022 IR 144") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1124 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1125 encoding = Encoding_Cyrillic; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1126 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1127 else if (s == "ISO_IR 127" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1128 s == "ISO 2022 IR 127") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1129 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1130 encoding = Encoding_Arabic; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1131 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1132 else if (s == "ISO_IR 126" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1133 s == "ISO 2022 IR 126") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1134 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1135 encoding = Encoding_Greek; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1136 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1137 else if (s == "ISO_IR 138" || |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1138 s == "ISO 2022 IR 138") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1139 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1140 encoding = Encoding_Hebrew; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1141 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1142 else if (s == "ISO_IR 166" || s == "ISO 2022 IR 166") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1143 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1144 encoding = Encoding_Thai; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1145 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1146 else if (s == "ISO_IR 13" || s == "ISO 2022 IR 13") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1147 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1148 encoding = Encoding_Japanese; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1149 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1150 else if (s == "GB18030") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1151 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1152 encoding = Encoding_Chinese; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1153 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1154 /* |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1155 else if (s == "ISO 2022 IR 149") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1156 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1157 TODO |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1158 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1159 else if (s == "ISO 2022 IR 159") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1160 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1161 TODO |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1162 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1163 else if (s == "ISO 2022 IR 87") |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1164 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1165 TODO |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1166 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1167 */ |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1168 else |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1169 { |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1170 return false; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1171 } |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1172 |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1173 // The encoding was properly detected |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1174 return true; |
e494ceb8d763
support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1087
diff
changeset
|
1175 } |
1146
200fcac0deb4
optimization for access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1090
diff
changeset
|
1176 |
200fcac0deb4
optimization for access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1090
diff
changeset
|
1177 |
1555
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1178 ResourceType GetChildResourceType(ResourceType type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1179 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1180 switch (type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1181 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1182 case ResourceType_Patient: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1183 return ResourceType_Study; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1184 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1185 case ResourceType_Study: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1186 return ResourceType_Series; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1187 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1188 case ResourceType_Series: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1189 return ResourceType_Instance; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1190 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1191 default: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1192 throw OrthancException(ErrorCode_ParameterOutOfRange); |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1193 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1194 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1195 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1196 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1197 ResourceType GetParentResourceType(ResourceType type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1198 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1199 switch (type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1200 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1201 case ResourceType_Study: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1202 return ResourceType_Patient; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1203 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1204 case ResourceType_Series: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1205 return ResourceType_Study; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1206 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1207 case ResourceType_Instance: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1208 return ResourceType_Series; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1209 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1210 default: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1211 throw OrthancException(ErrorCode_ParameterOutOfRange); |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1212 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1213 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1214 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1215 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1216 DicomModule GetModule(ResourceType type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1217 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1218 switch (type) |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1219 { |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1220 case ResourceType_Patient: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1221 return DicomModule_Patient; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1222 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1223 case ResourceType_Study: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1224 return DicomModule_Study; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1225 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1226 case ResourceType_Series: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1227 return DicomModule_Series; |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1228 |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1229 default: |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1230 throw OrthancException(ErrorCode_ParameterOutOfRange); |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1231 } |
d6a93e12b1c1
Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
1232 } |
1565
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1233 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1234 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1235 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1236 const char* GetDicomSpecificCharacterSet(Encoding encoding) |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1237 { |
1908
5096681efce6
direct hyperlinks to the DICOM standard
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
1238 // 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
|
1239 switch (encoding) |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1240 { |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1241 case Encoding_Utf8: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1242 case Encoding_Ascii: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1243 return "ISO_IR 192"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1244 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1245 case Encoding_Latin1: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1246 return "ISO_IR 100"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1247 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1248 case Encoding_Latin2: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1249 return "ISO_IR 101"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1250 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1251 case Encoding_Latin3: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1252 return "ISO_IR 109"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1253 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1254 case Encoding_Latin4: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1255 return "ISO_IR 110"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1256 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1257 case Encoding_Latin5: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1258 return "ISO_IR 148"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1259 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1260 case Encoding_Cyrillic: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1261 return "ISO_IR 144"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1262 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1263 case Encoding_Arabic: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1264 return "ISO_IR 127"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1265 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1266 case Encoding_Greek: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1267 return "ISO_IR 126"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1268 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1269 case Encoding_Hebrew: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1270 return "ISO_IR 138"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1271 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1272 case Encoding_Japanese: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1273 return "ISO_IR 13"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1274 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1275 case Encoding_Chinese: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1276 return "GB18030"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1277 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1278 case Encoding_Thai: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1279 return "ISO_IR 166"; |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1280 |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1281 default: |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1282 throw OrthancException(ErrorCode_ParameterOutOfRange); |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1283 } |
4b23310eb7e8
add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
1284 } |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1285 |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1286 |
1578 | 1287 // This function is autogenerated by the script |
1288 // "Resources/GenerateErrorCodes.py" | |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1289 HttpStatus ConvertErrorCodeToHttpStatus(ErrorCode error) |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1290 { |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1291 switch (error) |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1292 { |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1293 case ErrorCode_Success: |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1294 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
|
1295 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1296 case ErrorCode_ParameterOutOfRange: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1297 return HttpStatus_400_BadRequest; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1298 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1299 case ErrorCode_BadParameterType: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1300 return HttpStatus_400_BadRequest; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1301 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1302 case ErrorCode_InexistentItem: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1303 return HttpStatus_404_NotFound; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1304 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1305 case ErrorCode_BadRequest: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1306 return HttpStatus_400_BadRequest; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1307 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1308 case ErrorCode_UriSyntax: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1309 return HttpStatus_400_BadRequest; |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1310 |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1311 case ErrorCode_InexistentFile: |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1312 return HttpStatus_404_NotFound; |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1313 |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1314 case ErrorCode_BadFileFormat: |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1315 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
|
1316 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1317 case ErrorCode_UnknownResource: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1318 return HttpStatus_404_NotFound; |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1319 |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1320 case ErrorCode_InexistentTag: |
7aac0cddd42e
generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1576
diff
changeset
|
1321 return HttpStatus_404_NotFound; |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1322 |
1596
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
1323 case ErrorCode_BadJson: |
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
1324 return HttpStatus_400_BadRequest; |
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
1325 |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
1326 case ErrorCode_Unauthorized: |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
1327 return HttpStatus_401_Unauthorized; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
1328 |
1781
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
1329 case ErrorCode_NotAcceptable: |
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
1330 return HttpStatus_406_NotAcceptable; |
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
1331 |
1576
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1332 default: |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1333 return HttpStatus_500_InternalServerError; |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1334 } |
de54c19fc44d
refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1575
diff
changeset
|
1335 } |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
1336 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
1337 |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
1338 bool IsUserContentType(FileContentType type) |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
1339 { |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
1340 return (type >= FileContentType_StartUser && |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
1341 type <= FileContentType_EndUser); |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1772
diff
changeset
|
1342 } |
2007
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1343 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1344 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1345 bool IsBinaryValueRepresentation(ValueRepresentation vr) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1346 { |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1347 // 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
|
1348 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1349 switch (vr) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1350 { |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1351 case ValueRepresentation_ApplicationEntity: // AE |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1352 case ValueRepresentation_AgeString: // AS |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1353 case ValueRepresentation_CodeString: // CS |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1354 case ValueRepresentation_Date: // DA |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1355 case ValueRepresentation_DecimalString: // DS |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1356 case ValueRepresentation_DateTime: // DT |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1357 case ValueRepresentation_IntegerString: // IS |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1358 case ValueRepresentation_LongString: // LO |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1359 case ValueRepresentation_LongText: // LT |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1360 case ValueRepresentation_PersonName: // PN |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1361 case ValueRepresentation_ShortString: // SH |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1362 case ValueRepresentation_ShortText: // ST |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1363 case ValueRepresentation_Time: // TM |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1364 case ValueRepresentation_UnlimitedCharacters: // UC |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1365 case ValueRepresentation_UniqueIdentifier: // UI (UID) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1366 case ValueRepresentation_UniversalResource: // UR (URI or URL) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1367 case ValueRepresentation_UnlimitedText: // UT |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1368 { |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1369 return false; |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1370 } |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1371 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1372 /** |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1373 * Below are all the VR whose character repertoire is tagged as |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1374 * "not applicable" |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1375 **/ |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1376 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1377 case ValueRepresentation_FloatingPointSingle: // FL (float) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1378 case ValueRepresentation_FloatingPointDouble: // FD (double) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1379 case ValueRepresentation_OtherByte: // OB |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1380 case ValueRepresentation_OtherDouble: // OD |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1381 case ValueRepresentation_OtherFloat: // OF |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1382 case ValueRepresentation_OtherLong: // OL |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1383 case ValueRepresentation_OtherWord: // OW |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1384 case ValueRepresentation_SignedLong: // SL (int32_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1385 case ValueRepresentation_Sequence: // SQ |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1386 case ValueRepresentation_SignedShort: // SS (int16_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1387 case ValueRepresentation_UnsignedLong: // UL (uint32_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1388 case ValueRepresentation_Unknown: // UN |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1389 case ValueRepresentation_UnsignedShort: // US (uint16_t) |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1390 { |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1391 return true; |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1392 } |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1393 |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1394 case ValueRepresentation_NotSupported: |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1395 default: |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1396 throw OrthancException(ErrorCode_ParameterOutOfRange); |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1397 } |
655489d9165d
DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2006
diff
changeset
|
1398 } |
477 | 1399 } |