annotate Core/Enumerations.cpp @ 3056:6c5d4281da4a db-changes

removal of SQLiteDatabaseWrapper::GetAllInternalIds
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Dec 2018 13:48:04 +0100
parents fd587cf51a89
children ce272138f15e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1823
diff changeset
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
2447
878b59270859 upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2423
diff changeset
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
824
a811bdf8b8eb precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 800
diff changeset
34 #include "PrecompiledHeaders.h"
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "Enumerations.h"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include "OrthancException.h"
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
38 #include "Toolbox.h"
2006
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
39 #include "Logging.h"
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
2407
5edec967055e fix sandboxed builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2401
diff changeset
41 #include <boost/thread/mutex.hpp>
1495
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
42 #include <string.h>
1993
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
43 #include <cassert>
1495
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
44
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 namespace Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 {
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
47 static const char* const MIME_CSS = "text/css";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
48 static const char* const MIME_DICOM = "application/dicom";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
49 static const char* const MIME_GIF = "image/gif";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
50 static const char* const MIME_GZIP = "application/gzip";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
51 static const char* const MIME_HTML = "text/html";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
52 static const char* const MIME_JAVASCRIPT = "application/javascript";
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
53 static const char* const MIME_JPEG2000 = "image/jp2";
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
54 static const char* const MIME_NACL = "application/x-nacl";
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
55 static const char* const MIME_PLAIN_TEXT = "text/plain";
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
56 static const char* const MIME_PNACL = "application/x-pnacl";
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
57 static const char* const MIME_SVG = "image/svg+xml";
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
58 static const char* const MIME_WEB_ASSEMBLY = "application/wasm";
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
59 static const char* const MIME_WOFF = "application/x-font-woff";
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
60 static const char* const MIME_XML_2 = "text/xml";
2976
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
61 static const char* const MIME_ZIP = "application/zip";
2924
22524fd06225 macros ORTHANC_OVERRIDE and ORTHANC_FINAL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2908
diff changeset
62
1578
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1577
diff changeset
63 // This function is autogenerated by the script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1577
diff changeset
64 // "Resources/GenerateErrorCodes.py"
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
65 const char* EnumerationToString(ErrorCode error)
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
66 {
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
67 switch (error)
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
68 {
1579
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
69 case ErrorCode_InternalError:
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
70 return "Internal error";
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
71
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
72 case ErrorCode_Success:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
73 return "Success";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
74
1579
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
75 case ErrorCode_Plugin:
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
76 return "Error encountered within the plugin engine";
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
77
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
78 case ErrorCode_NotImplemented:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
79 return "Not implemented yet";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
80
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
81 case ErrorCode_ParameterOutOfRange:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
82 return "Parameter out of range";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
83
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
84 case ErrorCode_NotEnoughMemory:
2133
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2132
diff changeset
85 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
86
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
87 case ErrorCode_BadParameterType:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
88 return "Bad type for a parameter";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
89
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
90 case ErrorCode_BadSequenceOfCalls:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
91 return "Bad sequence of calls";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
92
1577
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
93 case ErrorCode_InexistentItem:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
94 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
95
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
96 case ErrorCode_BadRequest:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
97 return "Bad request";
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
98
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
99 case ErrorCode_NetworkProtocol:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
100 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
101
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
102 case ErrorCode_SystemCommand:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
103 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
104
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
105 case ErrorCode_Database:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
106 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
107
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
108 case ErrorCode_UriSyntax:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
109 return "Badly formatted URI";
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_InexistentFile:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
112 return "Inexistent file";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
113
1577
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
114 case ErrorCode_CannotWriteFile:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
115 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
116
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
117 case ErrorCode_BadFileFormat:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
118 return "Bad file format";
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_Timeout:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
121 return "Timeout";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
122
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
123 case ErrorCode_UnknownResource:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
124 return "Unknown resource";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
125
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
126 case ErrorCode_IncompatibleDatabaseVersion:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
127 return "Incompatible version of the database";
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_FullStorage:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
130 return "The file storage is full";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
131
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
132 case ErrorCode_CorruptedFile:
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
133 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
134
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
135 case ErrorCode_InexistentTag:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
136 return "Inexistent tag";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
137
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
138 case ErrorCode_ReadOnly:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
139 return "Cannot modify a read-only data structure";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
140
1577
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
141 case ErrorCode_IncompatibleImageFormat:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
142 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
143
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
144 case ErrorCode_IncompatibleImageSize:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
145 return "Incompatible size of the images";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
146
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
147 case ErrorCode_SharedLibrary:
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
148 return "Error while using a shared library (plugin)";
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
149
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
150 case ErrorCode_UnknownPluginService:
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
151 return "Plugin invoking an unknown service";
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
152
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
153 case ErrorCode_UnknownDicomTag:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
154 return "Unknown DICOM tag";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
155
1596
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
156 case ErrorCode_BadJson:
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
157 return "Cannot parse a JSON document";
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
158
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
159 case ErrorCode_Unauthorized:
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
160 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
161
1610
2dff2bdffdb8 font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
162 case ErrorCode_BadFont:
2dff2bdffdb8 font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
163 return "Badly formatted font file";
2dff2bdffdb8 font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
164
1643
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
165 case ErrorCode_DatabasePlugin:
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
166 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
167
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
168 case ErrorCode_StorageAreaPlugin:
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
169 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
170
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
171 case ErrorCode_EmptyRequest:
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
172 return "The request is empty";
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
173
1781
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
174 case ErrorCode_NotAcceptable:
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
175 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
176
2132
a43708636890 ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2089
diff changeset
177 case ErrorCode_NullPointer:
a43708636890 ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2089
diff changeset
178 return "Cannot handle a NULL pointer";
a43708636890 ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2089
diff changeset
179
2486
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
180 case ErrorCode_DatabaseUnavailable:
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
181 return "The database is currently not available (probably a transient situation)";
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
182
2581
8da2cffc2378 JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2569
diff changeset
183 case ErrorCode_CanceledJob:
8da2cffc2378 JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2569
diff changeset
184 return "This job was canceled";
8da2cffc2378 JobsRegistry::Cancel()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2569
diff changeset
185
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
186 case ErrorCode_SQLiteNotOpened:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
187 return "SQLite: The database is not opened";
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_SQLiteAlreadyOpened:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
190 return "SQLite: Connection is already open";
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_SQLiteCannotOpen:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
193 return "SQLite: Unable to open the database";
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_SQLiteStatementAlreadyUsed:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
196 return "SQLite: This cached statement is already being referred to";
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_SQLiteExecute:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
199 return "SQLite: Cannot execute a command";
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_SQLiteRollbackWithoutTransaction:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
202 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
203
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
204 case ErrorCode_SQLiteCommitWithoutTransaction:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
205 return "SQLite: Committing a nonexistent 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_SQLiteRegisterFunction:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
208 return "SQLite: Unable to register a function";
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_SQLiteFlush:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
211 return "SQLite: Unable to flush the database";
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_SQLiteCannotRun:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
214 return "SQLite: Cannot run a cached statement";
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_SQLiteCannotStep:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
217 return "SQLite: Cannot step over a cached statement";
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_SQLiteBindOutOfRange:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
220 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
221
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
222 case ErrorCode_SQLitePrepareStatement:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
223 return "SQLite: Cannot prepare a cached statement";
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_SQLiteTransactionAlreadyStarted:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
226 return "SQLite: Beginning the same transaction twice";
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_SQLiteTransactionCommit:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
229 return "SQLite: Failure when committing the transaction";
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_SQLiteTransactionBegin:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
232 return "SQLite: Cannot start a transaction";
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_DirectoryOverFile:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
235 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
236
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
237 case ErrorCode_FileStorageCannotWrite:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
238 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
239
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
240 case ErrorCode_DirectoryExpected:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
241 return "The specified path does not point to a directory";
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_HttpPortInUse:
1949
d90f737f2dde warn about the use of privileged ports
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1926
diff changeset
244 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
245
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
246 case ErrorCode_DicomPortInUse:
1949
d90f737f2dde warn about the use of privileged ports
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1926
diff changeset
247 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
248
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
249 case ErrorCode_BadHttpStatusInRest:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
250 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
251
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
252 case ErrorCode_RegularFileExpected:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
253 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
254
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
255 case ErrorCode_PathToExecutable:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
256 return "Unable to get the path to the executable";
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_MakeDirectory:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
259 return "Cannot create a directory";
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_BadApplicationEntityTitle:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
262 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
263
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
264 case ErrorCode_NoCFindHandler:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
265 return "No request handler factory for DICOM C-FIND SCP";
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_NoCMoveHandler:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
268 return "No request handler factory for DICOM C-MOVE SCP";
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_NoCStoreHandler:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
271 return "No request handler factory for DICOM C-STORE SCP";
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_NoApplicationEntityFilter:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
274 return "No application entity filter";
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_NoSopClassOrInstance:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
277 return "DicomUserConnection: Unable to find the SOP class and instance";
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_NoPresentationContext:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
280 return "DicomUserConnection: No acceptable presentation context for modality";
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_DicomFindUnavailable:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
283 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
284
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
285 case ErrorCode_DicomMoveUnavailable:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
286 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
287
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
288 case ErrorCode_CannotStoreInstance:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
289 return "Cannot store an instance";
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_CreateDicomNotString:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
292 return "Only string values are supported when creating DICOM instances";
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_CreateDicomOverrideTag:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
295 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
296
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
297 case ErrorCode_CreateDicomUseContent:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
298 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
299
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
300 case ErrorCode_CreateDicomNoPayload:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
301 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
302
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
303 case ErrorCode_CreateDicomUseDataUriScheme:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
304 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
305
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
306 case ErrorCode_CreateDicomBadParent:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
307 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
308
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
309 case ErrorCode_CreateDicomParentIsInstance:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
310 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
311
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
312 case ErrorCode_CreateDicomParentEncoding:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
313 return "Unable to get the encoding of the parent resource";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
314
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
315 case ErrorCode_UnknownModality:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
316 return "Unknown modality";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
317
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
318 case ErrorCode_BadJobOrdering:
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
319 return "Bad ordering of filters in a job";
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
320
1583
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
321 case ErrorCode_JsonToLuaTable:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
322 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
323
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
324 case ErrorCode_CannotCreateLua:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
325 return "Cannot create the Lua context";
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
326
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
327 case ErrorCode_CannotExecuteLua:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
328 return "Cannot execute a Lua command";
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
329
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
330 case ErrorCode_LuaAlreadyExecuted:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
331 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
332
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
333 case ErrorCode_LuaBadOutput:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
334 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
335
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
336 case ErrorCode_NotLuaPredicate:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
337 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
338
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
339 case ErrorCode_LuaReturnsNoString:
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
340 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
341
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
342 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
343 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
344
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
345 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
346 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
347
1643
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
348 case ErrorCode_DatabaseNotInitialized:
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
349 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
350
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
351 case ErrorCode_SslDisabled:
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
352 return "Orthanc has been built without SSL support";
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
353
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
354 case ErrorCode_CannotOrderSlices:
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
355 return "Unable to order the slices of the series";
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
356
1786
164d78911382 primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1781
diff changeset
357 case ErrorCode_NoWorklistHandler:
164d78911382 primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1781
diff changeset
358 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
359
1980
ebce5f456b8e new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1949
diff changeset
360 case ErrorCode_AlreadyExistingTag:
ebce5f456b8e new error code: ErrorCode_AlreadyExistingTag
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1949
diff changeset
361 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
362
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
363 default:
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
364 if (error >= ErrorCode_START_PLUGINS)
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
365 {
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
366 return "Error encountered within some plugin";
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
367 }
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
368 else
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
369 {
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
370 return "Unknown error code";
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1651
diff changeset
371 }
1575
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
372 }
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
373 }
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
374
f8aae45011c9 exceptions now carry HTTP status
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1572
diff changeset
375
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 const char* EnumerationToString(HttpMethod method)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 switch (method)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 case HttpMethod_Get:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 return "GET";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 case HttpMethod_Post:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 return "POST";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 case HttpMethod_Delete:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 return "DELETE";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 case HttpMethod_Put:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 return "PUT";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 return "?";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 const char* EnumerationToString(HttpStatus status)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 switch (status)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 case HttpStatus_100_Continue:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 return "Continue";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 case HttpStatus_101_SwitchingProtocols:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 return "Switching Protocols";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 case HttpStatus_102_Processing:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 return "Processing";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 case HttpStatus_200_Ok:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 return "OK";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 case HttpStatus_201_Created:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 return "Created";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 case HttpStatus_202_Accepted:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 return "Accepted";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 case HttpStatus_203_NonAuthoritativeInformation:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 return "Non-Authoritative Information";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 case HttpStatus_204_NoContent:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 return "No Content";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 case HttpStatus_205_ResetContent:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 return "Reset Content";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 case HttpStatus_206_PartialContent:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 return "Partial Content";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 case HttpStatus_207_MultiStatus:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 return "Multi-Status";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 case HttpStatus_208_AlreadyReported:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 return "Already Reported";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 case HttpStatus_226_IMUsed:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 return "IM Used";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 case HttpStatus_300_MultipleChoices:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 return "Multiple Choices";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 case HttpStatus_301_MovedPermanently:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 return "Moved Permanently";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 case HttpStatus_302_Found:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 return "Found";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 case HttpStatus_303_SeeOther:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 return "See Other";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 case HttpStatus_304_NotModified:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 return "Not Modified";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 case HttpStatus_305_UseProxy:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 return "Use Proxy";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 case HttpStatus_307_TemporaryRedirect:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 return "Temporary Redirect";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 case HttpStatus_400_BadRequest:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 return "Bad Request";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 case HttpStatus_401_Unauthorized:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 return "Unauthorized";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 case HttpStatus_402_PaymentRequired:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 return "Payment Required";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 case HttpStatus_403_Forbidden:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 return "Forbidden";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 case HttpStatus_404_NotFound:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 return "Not Found";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 case HttpStatus_405_MethodNotAllowed:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 return "Method Not Allowed";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 case HttpStatus_406_NotAcceptable:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 return "Not Acceptable";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 case HttpStatus_407_ProxyAuthenticationRequired:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 return "Proxy Authentication Required";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 case HttpStatus_408_RequestTimeout:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 return "Request Timeout";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 case HttpStatus_409_Conflict:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 return "Conflict";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 case HttpStatus_410_Gone:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 return "Gone";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 case HttpStatus_411_LengthRequired:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 return "Length Required";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 case HttpStatus_412_PreconditionFailed:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 return "Precondition Failed";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 case HttpStatus_413_RequestEntityTooLarge:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 return "Request Entity Too Large";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504 case HttpStatus_414_RequestUriTooLong:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 return "Request-URI Too Long";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507 case HttpStatus_415_UnsupportedMediaType:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 return "Unsupported Media Type";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 case HttpStatus_416_RequestedRangeNotSatisfiable:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 return "Requested Range Not Satisfiable";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 case HttpStatus_417_ExpectationFailed:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 return "Expectation Failed";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 case HttpStatus_422_UnprocessableEntity:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 return "Unprocessable Entity";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 case HttpStatus_423_Locked:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 return "Locked";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522 case HttpStatus_424_FailedDependency:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 return "Failed Dependency";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525 case HttpStatus_426_UpgradeRequired:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 return "Upgrade Required";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 case HttpStatus_500_InternalServerError:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529 return "Internal Server Error";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 case HttpStatus_501_NotImplemented:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 return "Not Implemented";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 case HttpStatus_502_BadGateway:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 return "Bad Gateway";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 case HttpStatus_503_ServiceUnavailable:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 return "Service Unavailable";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 case HttpStatus_504_GatewayTimeout:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 return "Gateway Timeout";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543 case HttpStatus_505_HttpVersionNotSupported:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544 return "HTTP Version Not Supported";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 case HttpStatus_506_VariantAlsoNegotiates:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547 return "Variant Also Negotiates";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 case HttpStatus_507_InsufficientStorage:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 return "Insufficient Storage";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 case HttpStatus_509_BandwidthLimitExceeded:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553 return "Bandwidth Limit Exceeded";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 case HttpStatus_510_NotExtended:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 return "Not Extended";
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 throw OrthancException(ErrorCode_ParameterOutOfRange);
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 }
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
563
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
564 const char* EnumerationToString(ResourceType type)
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
565 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
566 switch (type)
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
567 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
568 case ResourceType_Patient:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
569 return "Patient";
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
570
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
571 case ResourceType_Study:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
572 return "Study";
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
573
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
574 case ResourceType_Series:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
575 return "Series";
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
576
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
577 case ResourceType_Instance:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
578 return "Instance";
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
579
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
580 default:
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
581 throw OrthancException(ErrorCode_ParameterOutOfRange);
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
582 }
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
583 }
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
584
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
585
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
586 const char* EnumerationToString(ImageFormat format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
587 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
588 switch (format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
589 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
590 case ImageFormat_Png:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
591 return "Png";
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
592
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
593 default:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
594 throw OrthancException(ErrorCode_ParameterOutOfRange);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
595 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
596 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
597
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
598
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
599 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
600 {
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
601 switch (encoding)
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
602 {
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
603 case Encoding_Ascii:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
604 return "Ascii";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
605
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
606 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
607 return "Utf8";
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
608
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
609 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
610 return "Latin1";
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
611
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
612 case Encoding_Latin2:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
613 return "Latin2";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
614
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
615 case Encoding_Latin3:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
616 return "Latin3";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
617
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
618 case Encoding_Latin4:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
619 return "Latin4";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
620
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
621 case Encoding_Latin5:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
622 return "Latin5";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
623
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
624 case Encoding_Cyrillic:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
625 return "Cyrillic";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
626
1347
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
627 case Encoding_Windows1251:
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
628 return "Windows1251";
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
629
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
630 case Encoding_Arabic:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
631 return "Arabic";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
632
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
633 case Encoding_Greek:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
634 return "Greek";
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
635
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
636 case Encoding_Hebrew:
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
637 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
638
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
639 case Encoding_Thai:
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
640 return "Thai";
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
641
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
642 case Encoding_Japanese:
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
643 return "Japanese";
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
644
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
645 case Encoding_Chinese:
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
646 return "Chinese";
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
647
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
648 default:
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
649 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
650 }
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
651 }
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
652
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
653
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
654 const char* EnumerationToString(PhotometricInterpretation photometric)
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
655 {
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
656 switch (photometric)
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_RGB:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
659 return "RGB";
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_Monochrome1:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
662 return "MONOCHROME1";
1206
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_Monochrome2:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
665 return "MONOCHROME2";
1206
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_ARGB:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
668 return "ARGB";
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_CMYK:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
671 return "CMYK";
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_HSV:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
674 return "HSV";
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 case PhotometricInterpretation_Palette:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
677 return "PALETTE COLOR";
1206
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 case PhotometricInterpretation_YBRFull:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
680 return "YBR_FULL";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
681
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
682 case PhotometricInterpretation_YBRFull422:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
683 return "YBR_FULL_422";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
684
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
685 case PhotometricInterpretation_YBRPartial420:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
686 return "YBR_PARTIAL_420";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
687
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
688 case PhotometricInterpretation_YBRPartial422:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
689 return "YBR_PARTIAL_422";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
690
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
691 case PhotometricInterpretation_YBR_ICT:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
692 return "YBR_ICT";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
693
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
694 case PhotometricInterpretation_YBR_RCT:
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
695 return "YBR_RCT";
1206
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
696
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
697 case PhotometricInterpretation_Unknown:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
698 return "Unknown";
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
699
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
700 default:
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
701 throw OrthancException(ErrorCode_ParameterOutOfRange);
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
702 }
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
703 }
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
704
f5b0207967bc Fix issue 19 (YBR_FULL are decoded incorrectly)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1146
diff changeset
705
1571
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
706 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
707 {
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
708 switch (origin)
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
709 {
1572
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
710 case RequestOrigin_Unknown:
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
711 return "Unknown";
904096e7367e More information about the origin request in OnStoredInstance() callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
712
1571
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
713 case RequestOrigin_DicomProtocol:
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
714 return "DicomProtocol";
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
715
1823
0ef4e6e66b56 "Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
716 case RequestOrigin_RestApi:
0ef4e6e66b56 "Origin" metadata for the instances
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
717 return "RestApi";
1571
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
718
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
719 case RequestOrigin_Plugins:
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
720 return "Plugins";
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
721
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
722 case RequestOrigin_Lua:
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
723 return "Lua";
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
724
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
725 default:
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
726 throw OrthancException(ErrorCode_ParameterOutOfRange);
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
727 }
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
728 }
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
729
3232f1c995a5 provide the origin of the requests to HTTP handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1565
diff changeset
730
1495
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
731 const char* EnumerationToString(LogLevel level)
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
732 {
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
733 switch (level)
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
734 {
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
735 case LogLevel_Error:
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
736 return "ERROR";
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
737
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
738 case LogLevel_Warning:
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
739 return "WARNING";
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
740
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
741 case LogLevel_Info:
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
742 return "INFO";
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
743
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
744 case LogLevel_Trace:
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
745 return "TRACE";
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
746
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
747 default:
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
748 throw OrthancException(ErrorCode_ParameterOutOfRange);
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
749 }
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
750 }
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
751
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
752
1926
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
753 const char* EnumerationToString(PixelFormat format)
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
754 {
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
755 switch (format)
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 case PixelFormat_RGB24:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
758 return "RGB24";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
759
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
760 case PixelFormat_RGBA32:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
761 return "RGBA32";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
762
2089
7a969f235adf PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2007
diff changeset
763 case PixelFormat_BGRA32:
7a969f235adf PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2007
diff changeset
764 return "BGRA32";
7a969f235adf PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2007
diff changeset
765
1926
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
766 case PixelFormat_Grayscale8:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
767 return "Grayscale (unsigned 8bpp)";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
768
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
769 case PixelFormat_Grayscale16:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
770 return "Grayscale (unsigned 16bpp)";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
771
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
772 case PixelFormat_SignedGrayscale16:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
773 return "Grayscale (signed 16bpp)";
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
774
1993
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
775 case PixelFormat_Float32:
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
776 return "Grayscale (float 32bpp)";
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
777
2415
7e217a1cc63f PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2407
diff changeset
778 case PixelFormat_Grayscale32:
7e217a1cc63f PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2407
diff changeset
779 return "Grayscale (unsigned 32bpp)";
7e217a1cc63f PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2407
diff changeset
780
2645
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
781 case PixelFormat_Grayscale64:
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
782 return "Grayscale (unsigned 64bpp)";
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
783
2423
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
784 case PixelFormat_RGB48:
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
785 return "RGB48";
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
786
1926
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
787 default:
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
788 throw OrthancException(ErrorCode_ParameterOutOfRange);
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
789 }
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
790 }
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
791
2a129de4b5e2 EnumerationToString for PixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1908
diff changeset
792
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
793 const char* EnumerationToString(ModalityManufacturer manufacturer)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
794 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
795 switch (manufacturer)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
796 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
797 case ModalityManufacturer_Generic:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
798 return "Generic";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
799
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
800 case ModalityManufacturer_GenericNoWildcardInDates:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
801 return "GenericNoWildcardInDates";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
802
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
803 case ModalityManufacturer_GenericNoUniversalWildcard:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
804 return "GenericNoUniversalWildcard";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
805
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
806 case ModalityManufacturer_StoreScp:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
807 return "StoreScp";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
808
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
809 case ModalityManufacturer_ClearCanvas:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
810 return "ClearCanvas";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
811
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
812 case ModalityManufacturer_Dcm4Chee:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
813 return "Dcm4Chee";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
814
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
815 case ModalityManufacturer_Vitrea:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
816 return "Vitrea";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
817
2888
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
818 case ModalityManufacturer_GE:
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
819 return "GE";
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
820
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
821 default:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
822 throw OrthancException(ErrorCode_ParameterOutOfRange);
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
823 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
824 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
825
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
826
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
827 const char* EnumerationToString(DicomRequestType type)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
828 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
829 switch (type)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
830 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
831 case DicomRequestType_Echo:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
832 return "Echo";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
833 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
834
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
835 case DicomRequestType_Find:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
836 return "Find";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
837 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
838
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
839 case DicomRequestType_Get:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
840 return "Get";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
841 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
842
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
843 case DicomRequestType_Move:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
844 return "Move";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
845 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
846
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
847 case DicomRequestType_Store:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
848 return "Store";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
849 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
850
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
851 default:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
852 throw OrthancException(ErrorCode_ParameterOutOfRange);
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
853 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
854 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
855
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
856
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
857 const char* EnumerationToString(TransferSyntax syntax)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
858 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
859 switch (syntax)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
860 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
861 case TransferSyntax_Deflated:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
862 return "Deflated";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
863
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
864 case TransferSyntax_Jpeg:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
865 return "JPEG";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
866
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
867 case TransferSyntax_Jpeg2000:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
868 return "JPEG2000";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
869
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
870 case TransferSyntax_JpegLossless:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
871 return "JPEG Lossless";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
872
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
873 case TransferSyntax_Jpip:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
874 return "JPIP";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
875
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
876 case TransferSyntax_Mpeg2:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
877 return "MPEG2";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
878
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
879 case TransferSyntax_Rle:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
880 return "RLE";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
881
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
882 default:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
883 throw OrthancException(ErrorCode_ParameterOutOfRange);
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
884 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
885 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
886
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
887
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
888 const char* EnumerationToString(DicomVersion version)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
889 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
890 switch (version)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
891 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
892 case DicomVersion_2008:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
893 return "2008";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
894 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
895
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
896 case DicomVersion_2017c:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
897 return "2017c";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
898 break;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
899
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
900 default:
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
901 throw OrthancException(ErrorCode_ParameterOutOfRange);
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
902 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
903 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
904
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
905
2499
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
906 const char* EnumerationToString(ValueRepresentation vr)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
907 {
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
908 switch (vr)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
909 {
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
910 case ValueRepresentation_ApplicationEntity: // AE
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
911 return "AE";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
912
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
913 case ValueRepresentation_AgeString: // AS
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
914 return "AS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
915
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
916 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
917 return "AT";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
918
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
919 case ValueRepresentation_CodeString: // CS
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
920 return "CS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
921
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
922 case ValueRepresentation_Date: // DA
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
923 return "DA";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
924
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
925 case ValueRepresentation_DecimalString: // DS
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
926 return "DS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
927
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
928 case ValueRepresentation_DateTime: // DT
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
929 return "DT";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
930
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
931 case ValueRepresentation_FloatingPointSingle: // FL (float)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
932 return "FL";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
933
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
934 case ValueRepresentation_FloatingPointDouble: // FD (double)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
935 return "FD";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
936
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
937 case ValueRepresentation_IntegerString: // IS
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
938 return "IS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
939
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
940 case ValueRepresentation_LongString: // LO
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
941 return "LO";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
942
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
943 case ValueRepresentation_LongText: // LT
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
944 return "LT";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
945
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
946 case ValueRepresentation_OtherByte: // OB
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
947 return "OB";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
948
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
949 case ValueRepresentation_OtherDouble: // OD
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
950 return "OD";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
951
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
952 case ValueRepresentation_OtherFloat: // OF
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
953 return "OF";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
954
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
955 case ValueRepresentation_OtherLong: // OL
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
956 return "OL";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
957
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
958 case ValueRepresentation_OtherWord: // OW
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
959 return "OW";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
960
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
961 case ValueRepresentation_PersonName: // PN
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
962 return "PN";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
963
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
964 case ValueRepresentation_ShortString: // SH
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
965 return "SH";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
966
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
967 case ValueRepresentation_SignedLong: // SL (int32_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
968 return "SL";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
969
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
970 case ValueRepresentation_Sequence: // SQ
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
971 return "SQ";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
972
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
973 case ValueRepresentation_SignedShort: // SS (int16_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
974 return "SS";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
975
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
976 case ValueRepresentation_ShortText: // ST
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
977 return "ST";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
978
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
979 case ValueRepresentation_Time: // TM
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
980 return "TM";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
981
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
982 case ValueRepresentation_UnlimitedCharacters: // UC
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
983 return "UC";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
984
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
985 case ValueRepresentation_UniqueIdentifier: // UI (UID)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
986 return "UI";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
987
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
988 case ValueRepresentation_UnsignedLong: // UL (uint32_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
989 return "UL";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
990
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
991 case ValueRepresentation_Unknown: // UN
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
992 return "UN";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
993
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
994 case ValueRepresentation_UniversalResource: // UR (URI or URL)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
995 return "UR";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
996
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
997 case ValueRepresentation_UnsignedShort: // US (uint16_t)
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
998 return "US";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
999
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1000 case ValueRepresentation_UnlimitedText: // UT
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1001 return "UT";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1002
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1003 case ValueRepresentation_NotSupported:
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1004 return "Not supported";
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1005
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1006 default:
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1007 throw OrthancException(ErrorCode_ParameterOutOfRange);
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1008 }
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1009 }
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1010
83b8b6743531 ITagVisitor - for anonymization relationships
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2486
diff changeset
1011
2569
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1012 const char* EnumerationToString(JobState state)
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1013 {
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1014 switch (state)
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1015 {
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1016 case JobState_Pending:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1017 return "Pending";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1018
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1019 case JobState_Running:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1020 return "Running";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1021
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1022 case JobState_Success:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1023 return "Success";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1024
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1025 case JobState_Failure:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1026 return "Failure";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1027
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1028 case JobState_Paused:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1029 return "Paused";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1030
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1031 case JobState_Retry:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1032 return "Retry";
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1033
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1034 default:
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1035 throw OrthancException(ErrorCode_ParameterOutOfRange);
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1036 }
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1037 }
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1038
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1039
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1040 const char* EnumerationToString(MimeType mime)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1041 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1042 switch (mime)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1043 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1044 case MimeType_Binary:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1045 return MIME_BINARY;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1046
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1047 case MimeType_Dicom:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1048 return MIME_DICOM;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1049
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1050 case MimeType_Jpeg:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1051 return MIME_JPEG;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1052
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1053 case MimeType_Jpeg2000:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1054 return MIME_JPEG2000;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1055
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1056 case MimeType_Json:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1057 return MIME_JSON;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1058
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1059 case MimeType_Pdf:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1060 return MIME_PDF;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1061
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1062 case MimeType_Png:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1063 return MIME_PNG;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1064
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1065 case MimeType_Xml:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1066 return MIME_XML;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1067
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1068 case MimeType_PlainText:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1069 return MIME_PLAIN_TEXT;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1070
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1071 case MimeType_Pam:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1072 return MIME_PAM;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1073
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1074 case MimeType_Html:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1075 return MIME_HTML;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1076
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1077 case MimeType_Gzip:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1078 return MIME_GZIP;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1079
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1080 case MimeType_JavaScript:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1081 return MIME_JAVASCRIPT;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1082
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1083 case MimeType_Css:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1084 return MIME_CSS;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1085
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1086 case MimeType_WebAssembly:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1087 return MIME_WEB_ASSEMBLY;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1088
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1089 case MimeType_Gif:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1090 return MIME_GIF;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1091
2976
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1092 case MimeType_Zip:
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1093 return MIME_ZIP;
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1094
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1095 case MimeType_NaCl:
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1096 return MIME_NACL;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1097
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1098 case MimeType_PNaCl:
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1099 return MIME_PNACL;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1100
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1101 case MimeType_Svg:
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1102 return MIME_SVG;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1103
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1104 case MimeType_Woff:
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1105 return MIME_WOFF;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1106
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1107 default:
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1108 throw OrthancException(ErrorCode_ParameterOutOfRange);
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1109 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1110 }
2569
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1111
2af17cd5eb1f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1112
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1113 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
1114 {
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1115 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
1116 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
1117
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1118 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
1119 {
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1120 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
1121 }
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1122
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1123 if (s == "ASCII")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1124 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1125 return Encoding_Ascii;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1126 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1127
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1128 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
1129 {
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1130 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
1131 }
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1132
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1133 if (s == "LATIN2")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1134 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1135 return Encoding_Latin2;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1136 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1137
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1138 if (s == "LATIN3")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1139 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1140 return Encoding_Latin3;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1141 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1142
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1143 if (s == "LATIN4")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1144 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1145 return Encoding_Latin4;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1146 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1147
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1148 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
1149 {
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1150 return Encoding_Latin5;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1151 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1152
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1153 if (s == "CYRILLIC")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1154 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1155 return Encoding_Cyrillic;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1156 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1157
1347
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1158 if (s == "WINDOWS1251")
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1159 {
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1160 return Encoding_Windows1251;
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1161 }
60cc0ee61edb fix issue 32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
1162
1087
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1163 if (s == "ARABIC")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1164 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1165 return Encoding_Arabic;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1166 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1167
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1168 if (s == "GREEK")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1169 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1170 return Encoding_Greek;
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1171 }
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1172
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1173 if (s == "HEBREW")
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1174 {
e07b90fb00eb more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1086
diff changeset
1175 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
1176 }
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1177
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1178 if (s == "THAI")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1179 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1180 return Encoding_Thai;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1181 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1182
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1183 if (s == "JAPANESE")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1184 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1185 return Encoding_Japanese;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1186 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1187
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1188 if (s == "CHINESE")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1189 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1190 return Encoding_Chinese;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1191 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1192
1086
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1193 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
1194 }
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1195
e56c3ed8d738 Parameter to set the default encoding for DICOM files without SpecificCharacterSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 824
diff changeset
1196
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1197 ResourceType StringToResourceType(const char* type)
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1198 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1199 std::string s(type);
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1200 Toolbox::ToUpperCase(s);
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1201
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
1202 if (s == "PATIENT" || s == "PATIENTS")
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1203 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1204 return ResourceType_Patient;
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1205 }
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
1206 else if (s == "STUDY" || s == "STUDIES")
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1207 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1208 return ResourceType_Study;
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1209 }
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1210 else if (s == "SERIES")
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1211 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1212 return ResourceType_Series;
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1213 }
697
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
1214 else if (s == "INSTANCE" || s == "IMAGE" ||
dd1ce9a2844c access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 689
diff changeset
1215 s == "INSTANCES" || s == "IMAGES")
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1216 {
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1217 return ResourceType_Instance;
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1218 }
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1219
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1220 throw OrthancException(ErrorCode_ParameterOutOfRange);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1221 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1222
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1223
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1224 ImageFormat StringToImageFormat(const char* format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1225 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1226 std::string s(format);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1227 Toolbox::ToUpperCase(s);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1228
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1229 if (s == "PNG")
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1230 {
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1231 return ImageFormat_Png;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1232 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1233
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1234 throw OrthancException(ErrorCode_ParameterOutOfRange);
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1235 }
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1236
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1237
1495
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1238 LogLevel StringToLogLevel(const char *level)
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1239 {
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1240 if (strcmp(level, "ERROR") == 0)
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1241 {
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1242 return LogLevel_Error;
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1243 }
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1244 else if (strcmp(level, "WARNING") == 0)
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1245 {
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1246 return LogLevel_Warning;
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1247 }
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1248 else if (strcmp(level, "INFO") == 0)
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1249 {
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1250 return LogLevel_Info;
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1251 }
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1252 else if (strcmp(level, "TRACE") == 0)
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1253 {
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1254 return LogLevel_Trace;
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1255 }
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1256 else
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1257 {
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1258 throw OrthancException(ErrorCode_InternalError);
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1259 }
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1260 }
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1261
fbe40117eb21 improve the performance of the internal logger
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1347
diff changeset
1262
2006
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1263 ValueRepresentation StringToValueRepresentation(const std::string& vr,
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1264 bool throwIfUnsupported)
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1265 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1266 if (vr == "AE")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1267 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1268 return ValueRepresentation_ApplicationEntity;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1269 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1270 else if (vr == "AS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1271 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1272 return ValueRepresentation_AgeString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1273 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1274 else if (vr == "AT")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1275 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1276 return ValueRepresentation_AttributeTag;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1277 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1278 else if (vr == "CS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1279 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1280 return ValueRepresentation_CodeString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1281 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1282 else if (vr == "DA")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1283 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1284 return ValueRepresentation_Date;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1285 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1286 else if (vr == "DS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1287 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1288 return ValueRepresentation_DecimalString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1289 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1290 else if (vr == "DT")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1291 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1292 return ValueRepresentation_DateTime;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1293 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1294 else if (vr == "FL")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1295 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1296 return ValueRepresentation_FloatingPointSingle;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1297 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1298 else if (vr == "FD")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1299 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1300 return ValueRepresentation_FloatingPointDouble;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1301 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1302 else if (vr == "IS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1303 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1304 return ValueRepresentation_IntegerString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1305 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1306 else if (vr == "LO")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1307 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1308 return ValueRepresentation_LongString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1309 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1310 else if (vr == "LT")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1311 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1312 return ValueRepresentation_LongText;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1313 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1314 else if (vr == "OB")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1315 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1316 return ValueRepresentation_OtherByte;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1317 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1318 else if (vr == "OD")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1319 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1320 return ValueRepresentation_OtherDouble;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1321 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1322 else if (vr == "OF")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1323 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1324 return ValueRepresentation_OtherFloat;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1325 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1326 else if (vr == "OL")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1327 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1328 return ValueRepresentation_OtherLong;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1329 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1330 else if (vr == "OW")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1331 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1332 return ValueRepresentation_OtherWord;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1333 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1334 else if (vr == "PN")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1335 {
2007
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
1336 return ValueRepresentation_PersonName;
2006
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1337 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1338 else if (vr == "SH")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1339 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1340 return ValueRepresentation_ShortString;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1341 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1342 else if (vr == "SL")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1343 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1344 return ValueRepresentation_SignedLong;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1345 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1346 else if (vr == "SQ")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1347 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1348 return ValueRepresentation_Sequence;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1349 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1350 else if (vr == "SS")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1351 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1352 return ValueRepresentation_SignedShort;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1353 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1354 else if (vr == "ST")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1355 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1356 return ValueRepresentation_ShortText;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1357 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1358 else if (vr == "TM")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1359 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1360 return ValueRepresentation_Time;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1361 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1362 else if (vr == "UC")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1363 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1364 return ValueRepresentation_UnlimitedCharacters;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1365 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1366 else if (vr == "UI")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1367 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1368 return ValueRepresentation_UniqueIdentifier;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1369 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1370 else if (vr == "UL")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1371 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1372 return ValueRepresentation_UnsignedLong;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1373 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1374 else if (vr == "UN")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1375 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1376 return ValueRepresentation_Unknown;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1377 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1378 else if (vr == "UR")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1379 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1380 return ValueRepresentation_UniversalResource;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1381 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1382 else if (vr == "US")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1383 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1384 return ValueRepresentation_UnsignedShort;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1385 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1386 else if (vr == "UT")
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1387 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1388 return ValueRepresentation_UnlimitedText;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1389 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1390 else
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1391 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1392 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
1393
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1394 if (throwIfUnsupported)
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1395 {
2954
d924f9bb61cc taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2953
diff changeset
1396 throw OrthancException(ErrorCode_ParameterOutOfRange, s);
2006
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1397 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1398 else
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1399 {
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1400 LOG(INFO) << s;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1401 return ValueRepresentation_NotSupported;
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1402 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1403 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1404 }
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1405
6301bbcbcaed more generic support of value representations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
1406
2281
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1407 PhotometricInterpretation StringToPhotometricInterpretation(const char* value)
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1408 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1409 // http://dicom.nema.org/medical/dicom/2017a/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1410 std::string s(value);
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1411
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1412 if (s == "MONOCHROME1")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1413 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1414 return PhotometricInterpretation_Monochrome1;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1415 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1416
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1417 if (s == "MONOCHROME2")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1418 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1419 return PhotometricInterpretation_Monochrome2;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1420 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1421
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1422 if (s == "PALETTE COLOR")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1423 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1424 return PhotometricInterpretation_Palette;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1425 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1426
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1427 if (s == "RGB")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1428 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1429 return PhotometricInterpretation_RGB;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1430 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1431
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1432 if (s == "HSV")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1433 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1434 return PhotometricInterpretation_HSV;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1435 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1436
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1437 if (s == "ARGB")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1438 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1439 return PhotometricInterpretation_ARGB;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1440 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1441
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1442 if (s == "CMYK")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1443 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1444 return PhotometricInterpretation_CMYK;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1445 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1446
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1447 if (s == "YBR_FULL")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1448 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1449 return PhotometricInterpretation_YBRFull;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1450 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1451
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1452 if (s == "YBR_FULL_422")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1453 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1454 return PhotometricInterpretation_YBRFull422;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1455 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1456
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1457 if (s == "YBR_PARTIAL_422")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1458 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1459 return PhotometricInterpretation_YBRPartial422;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1460 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1461
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1462 if (s == "YBR_PARTIAL_420")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1463 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1464 return PhotometricInterpretation_YBRPartial420;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1465 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1466
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1467 if (s == "YBR_ICT")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1468 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1469 return PhotometricInterpretation_YBR_ICT;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1470 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1471
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1472 if (s == "YBR_RCT")
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1473 {
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1474 return PhotometricInterpretation_YBR_RCT;
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1475 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1476
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1477 throw OrthancException(ErrorCode_ParameterOutOfRange);
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1478 }
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1479
e002430baa41 Fix issue #44 (Bad interpretation of photometric interpretation MONOCHROME1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2244
diff changeset
1480
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1481 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1482 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1483 ModalityManufacturer result;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1484 bool obsolete = false;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1485
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1486 if (manufacturer == "Generic")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1487 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1488 return ModalityManufacturer_Generic;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1489 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1490 else if (manufacturer == "GenericNoWildcardInDates")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1491 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1492 return ModalityManufacturer_GenericNoWildcardInDates;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1493 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1494 else if (manufacturer == "GenericNoUniversalWildcard")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1495 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1496 return ModalityManufacturer_GenericNoUniversalWildcard;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1497 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1498 else if (manufacturer == "ClearCanvas")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1499 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1500 return ModalityManufacturer_ClearCanvas;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1501 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1502 else if (manufacturer == "StoreScp")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1503 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1504 return ModalityManufacturer_StoreScp;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1505 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1506 else if (manufacturer == "Dcm4Chee")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1507 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1508 return ModalityManufacturer_Dcm4Chee;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1509 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1510 else if (manufacturer == "Vitrea")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1511 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1512 return ModalityManufacturer_Vitrea;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1513 }
2888
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
1514 else if (manufacturer == "GE")
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
1515 {
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
1516 return ModalityManufacturer_GE;
61a5667f37d9 New modality manufacturer: "GE" for GE Healthcare EA and AW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2871
diff changeset
1517 }
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1518 else if (manufacturer == "AgfaImpax" ||
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1519 manufacturer == "SyngoVia")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1520 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1521 result = ModalityManufacturer_GenericNoWildcardInDates;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1522 obsolete = true;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1523 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1524 else if (manufacturer == "EFilm2" ||
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1525 manufacturer == "MedInria")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1526 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1527 result = ModalityManufacturer_Generic;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1528 obsolete = true;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1529 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1530 else
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1531 {
2954
d924f9bb61cc taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2953
diff changeset
1532 throw OrthancException(ErrorCode_ParameterOutOfRange,
d924f9bb61cc taking advantage of details in OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2953
diff changeset
1533 "Unknown modality manufacturer: \"" + manufacturer + "\"");
2382
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1534 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1535
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1536 if (obsolete)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1537 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1538 LOG(WARNING) << "The \"" << manufacturer << "\" manufacturer is obsolete since "
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1539 << "Orthanc 1.3.0. To guarantee compatibility with future Orthanc "
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1540 << "releases, you should replace it by \""
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1541 << EnumerationToString(result)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1542 << "\" in your configuration file.";
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1543 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1544
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1545 return result;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1546 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1547
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1548
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1549 DicomVersion StringToDicomVersion(const std::string& version)
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1550 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1551 if (version == "2008")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1552 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1553 return DicomVersion_2008;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1554 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1555 else if (version == "2017c")
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1556 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1557 return DicomVersion_2017c;
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1558 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1559 else
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1560 {
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1561 throw OrthancException(ErrorCode_ParameterOutOfRange);
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1562 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1563 }
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1564
7284093111b0 big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2381
diff changeset
1565
2646
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1566 JobState StringToJobState(const std::string& state)
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1567 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1568 if (state == "Pending")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1569 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1570 return JobState_Pending;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1571 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1572 else if (state == "Running")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1573 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1574 return JobState_Running;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1575 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1576 else if (state == "Success")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1577 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1578 return JobState_Success;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1579 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1580 else if (state == "Failure")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1581 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1582 return JobState_Failure;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1583 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1584 else if (state == "Paused")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1585 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1586 return JobState_Paused;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1587 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1588 else if (state == "Retry")
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1589 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1590 return JobState_Retry;
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1591 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1592 else
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1593 {
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1594 throw OrthancException(ErrorCode_ParameterOutOfRange);
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1595 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1596 }
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1597
740983056f9e StringToJobState
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2581
diff changeset
1598
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1599 RequestOrigin StringToRequestOrigin(const std::string& origin)
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1600 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1601 if (origin == "Unknown")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1602 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1603 return RequestOrigin_Unknown;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1604 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1605 else if (origin == "DicomProtocol")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1606 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1607 return RequestOrigin_DicomProtocol;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1608 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1609 else if (origin == "RestApi")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1610 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1611 return RequestOrigin_RestApi;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1612 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1613 else if (origin == "Plugins")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1614 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1615 return RequestOrigin_Plugins;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1616 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1617 else if (origin == "Lua")
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1618 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1619 return RequestOrigin_Lua;
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1620 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1621 else
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1622 {
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1623 throw OrthancException(ErrorCode_ParameterOutOfRange);
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1624 }
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1625 }
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1626
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1627
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1628 MimeType StringToMimeType(const std::string& mime)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1629 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1630 if (mime == MIME_BINARY)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1631 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1632 return MimeType_Binary;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1633 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1634 else if (mime == MIME_DICOM)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1635 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1636 return MimeType_Dicom;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1637 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1638 else if (mime == MIME_JPEG)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1639 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1640 return MimeType_Jpeg;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1641 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1642 else if (mime == MIME_JPEG2000)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1643 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1644 return MimeType_Jpeg2000;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1645 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1646 else if (mime == MIME_JSON)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1647 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1648 return MimeType_Json;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1649 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1650 else if (mime == MIME_PDF)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1651 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1652 return MimeType_Pdf;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1653 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1654 else if (mime == MIME_PNG)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1655 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1656 return MimeType_Png;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1657 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1658 else if (mime == MIME_XML ||
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1659 mime == MIME_XML_2)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1660 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1661 return MimeType_Xml;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1662 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1663 else if (mime == MIME_PLAIN_TEXT)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1664 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1665 return MimeType_PlainText;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1666 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1667 else if (mime == MIME_PAM)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1668 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1669 return MimeType_Pam;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1670 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1671 else if (mime == MIME_HTML)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1672 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1673 return MimeType_Html;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1674 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1675 else if (mime == MIME_GZIP)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1676 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1677 return MimeType_Gzip;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1678 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1679 else if (mime == MIME_JAVASCRIPT)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1680 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1681 return MimeType_JavaScript;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1682 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1683 else if (mime == MIME_CSS)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1684 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1685 return MimeType_Css;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1686 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1687 else if (mime == MIME_WEB_ASSEMBLY)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1688 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1689 return MimeType_WebAssembly;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1690 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1691 else if (mime == MIME_GIF)
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1692 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1693 return MimeType_Gif;
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1694 }
2976
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1695 else if (mime == MIME_ZIP)
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1696 {
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1697 return MimeType_Zip;
cb5d75143da0 Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2954
diff changeset
1698 }
2984
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1699 else if (mime == MIME_NACL)
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1700 {
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1701 return MimeType_NaCl;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1702 }
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1703 else if (mime == MIME_PNACL)
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1704 {
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1705 return MimeType_PNaCl;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1706 }
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1707 else if (mime == MIME_SVG)
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1708 {
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1709 return MimeType_Svg;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1710 }
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1711 else if (mime == MIME_WOFF)
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1712 {
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1713 return MimeType_Woff;
db8f360fcb41 OrthancPluginAutodetectMimeType()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2976
diff changeset
1714 }
2908
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1715 else
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1716 {
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1717 throw OrthancException(ErrorCode_ParameterOutOfRange);
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1718 }
9d277f8ad698 new enumeration: MimeType
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2888
diff changeset
1719 }
2655
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1720
c196d76cb8fa serialization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2649
diff changeset
1721
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1722 unsigned int GetBytesPerPixel(PixelFormat format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1723 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1724 switch (format)
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1725 {
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1726 case PixelFormat_Grayscale8:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1727 return 1;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1728
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1729 case PixelFormat_Grayscale16:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1730 case PixelFormat_SignedGrayscale16:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1731 return 2;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1732
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1733 case PixelFormat_RGB24:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1734 return 3;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1735
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1736 case PixelFormat_RGBA32:
2089
7a969f235adf PixelFormat_BGRA32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2007
diff changeset
1737 case PixelFormat_BGRA32:
2415
7e217a1cc63f PixelFormat_Float32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2407
diff changeset
1738 case PixelFormat_Grayscale32:
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1739 return 4;
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1740
1993
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
1741 case PixelFormat_Float32:
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
1742 assert(sizeof(float) == 4);
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
1743 return 4;
e2a3ff770b48 introducing float32 images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1980
diff changeset
1744
2423
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
1745 case PixelFormat_RGB48:
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
1746 return 6;
5a7c5c541a1d Built-in decoding of palette images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2415
diff changeset
1747
2645
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1748 case PixelFormat_Grayscale64:
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1749 return 8;
89b789366596 Grayscale64 pixel format
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2499
diff changeset
1750
800
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1751 default:
ecedd89055db generation of DICOM images from PNG files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 697
diff changeset
1752 throw OrthancException(ErrorCode_ParameterOutOfRange);
562
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1753 }
f64e3838d6e1 refactoring enumerations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 477
diff changeset
1754 }
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1755
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1756
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1757 bool GetDicomEncoding(Encoding& encoding,
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1758 const char* specificCharacterSet)
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1759 {
2202
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1760 std::string s = Toolbox::StripSpaces(specificCharacterSet);
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1761 Toolbox::ToUpperCase(s);
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1762
1908
5096681efce6 direct hyperlinks to the DICOM standard
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
1763 // 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
1764 // 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
1765 if (s == "ISO_IR 6" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1766 s == "ISO 2022 IR 6")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1767 {
2202
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1768 encoding = Encoding_Ascii;
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1769 }
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1770 else if (s == "ISO_IR 192")
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1771 {
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1772 encoding = Encoding_Utf8;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1773 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1774 else if (s == "ISO_IR 100" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1775 s == "ISO 2022 IR 100")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1776 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1777 encoding = Encoding_Latin1;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1778 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1779 else if (s == "ISO_IR 101" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1780 s == "ISO 2022 IR 101")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1781 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1782 encoding = Encoding_Latin2;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1783 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1784 else if (s == "ISO_IR 109" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1785 s == "ISO 2022 IR 109")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1786 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1787 encoding = Encoding_Latin3;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1788 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1789 else if (s == "ISO_IR 110" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1790 s == "ISO 2022 IR 110")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1791 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1792 encoding = Encoding_Latin4;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1793 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1794 else if (s == "ISO_IR 148" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1795 s == "ISO 2022 IR 148")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1796 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1797 encoding = Encoding_Latin5;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1798 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1799 else if (s == "ISO_IR 144" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1800 s == "ISO 2022 IR 144")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1801 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1802 encoding = Encoding_Cyrillic;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1803 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1804 else if (s == "ISO_IR 127" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1805 s == "ISO 2022 IR 127")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1806 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1807 encoding = Encoding_Arabic;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1808 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1809 else if (s == "ISO_IR 126" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1810 s == "ISO 2022 IR 126")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1811 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1812 encoding = Encoding_Greek;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1813 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1814 else if (s == "ISO_IR 138" ||
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1815 s == "ISO 2022 IR 138")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1816 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1817 encoding = Encoding_Hebrew;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1818 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1819 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
1820 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1821 encoding = Encoding_Thai;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1822 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1823 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
1824 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1825 encoding = Encoding_Japanese;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1826 }
2401
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
1827 else if (s == "GB18030" || s == "GBK")
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1828 {
2401
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
1829 /**
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
1830 * According to tumashu@163.com, "In China, many dicom file's
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
1831 * 0008,0005 tag is set as "GBK", instead of "GB18030", GBK is a
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
1832 * subset of GB18030, and which is used frequently in China,
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
1833 * suggest support it."
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
1834 * https://groups.google.com/d/msg/orthanc-users/WMM8LMbjpUc/02-1f_yFCgAJ
a051aba0037c Use "GBK" (frequently used in China) as an alias for "GB18030"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2382
diff changeset
1835 **/
1090
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1836 encoding = Encoding_Chinese;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1837 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1838 /*
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1839 else if (s == "ISO 2022 IR 149")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1840 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1841 TODO
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1842 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1843 else if (s == "ISO 2022 IR 159")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1844 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1845 TODO
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1846 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1847 else if (s == "ISO 2022 IR 87")
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1848 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1849 TODO
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1850 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1851 */
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1852 else
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1853 {
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1854 return false;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1855 }
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1856
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1857 // The encoding was properly detected
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1858 return true;
e494ceb8d763 support more encodings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1087
diff changeset
1859 }
1146
200fcac0deb4 optimization for access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1090
diff changeset
1860
200fcac0deb4 optimization for access to attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1090
diff changeset
1861
1555
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1862 ResourceType GetChildResourceType(ResourceType type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1863 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1864 switch (type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1865 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1866 case ResourceType_Patient:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1867 return ResourceType_Study;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1868
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1869 case ResourceType_Study:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1870 return ResourceType_Series;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1871
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1872 case ResourceType_Series:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1873 return ResourceType_Instance;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1874
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1875 default:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1876 throw OrthancException(ErrorCode_ParameterOutOfRange);
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1877 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1878 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1879
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1880
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1881 ResourceType GetParentResourceType(ResourceType type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1882 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1883 switch (type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1884 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1885 case ResourceType_Study:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1886 return ResourceType_Patient;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1887
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1888 case ResourceType_Series:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1889 return ResourceType_Study;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1890
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1891 case ResourceType_Instance:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1892 return ResourceType_Series;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1893
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1894 default:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1895 throw OrthancException(ErrorCode_ParameterOutOfRange);
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1896 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1897 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1898
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1899
3027
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1900 bool IsResourceLevelAboveOrEqual(ResourceType level,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1901 ResourceType reference)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1902 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1903 switch (reference)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1904 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1905 case ResourceType_Patient:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1906 return (level == ResourceType_Patient);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1907
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1908 case ResourceType_Study:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1909 return (level == ResourceType_Patient ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1910 level == ResourceType_Study);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1911
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1912 case ResourceType_Series:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1913 return (level == ResourceType_Patient ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1914 level == ResourceType_Study ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1915 level == ResourceType_Series);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1916
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1917 case ResourceType_Instance:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1918 return (level == ResourceType_Patient ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1919 level == ResourceType_Study ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1920 level == ResourceType_Series ||
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1921 level == ResourceType_Instance);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1922
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1923 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1924 throw OrthancException(ErrorCode_ParameterOutOfRange);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1925 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1926 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1927
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2984
diff changeset
1928
1555
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1929 DicomModule GetModule(ResourceType type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1930 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1931 switch (type)
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1932 {
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1933 case ResourceType_Patient:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1934 return DicomModule_Patient;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1935
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1936 case ResourceType_Study:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1937 return DicomModule_Study;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1938
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1939 case ResourceType_Series:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1940 return DicomModule_Series;
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1941
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1942 default:
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1943 throw OrthancException(ErrorCode_ParameterOutOfRange);
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1944 }
d6a93e12b1c1 Creation of DICOM files with encapsulated PDF
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
1945 }
1565
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1946
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1947
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1948
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1949 const char* GetDicomSpecificCharacterSet(Encoding encoding)
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1950 {
1908
5096681efce6 direct hyperlinks to the DICOM standard
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
1951 // 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
1952 switch (encoding)
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1953 {
2202
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1954 case Encoding_Ascii:
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1955 return "ISO_IR 6";
9b373b7d6713 Fix handling of encodings in C-FIND requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2133
diff changeset
1956
1565
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1957 case Encoding_Utf8:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1958 return "ISO_IR 192";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1959
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1960 case Encoding_Latin1:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1961 return "ISO_IR 100";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1962
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1963 case Encoding_Latin2:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1964 return "ISO_IR 101";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1965
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1966 case Encoding_Latin3:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1967 return "ISO_IR 109";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1968
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1969 case Encoding_Latin4:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1970 return "ISO_IR 110";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1971
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1972 case Encoding_Latin5:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1973 return "ISO_IR 148";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1974
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1975 case Encoding_Cyrillic:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1976 return "ISO_IR 144";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1977
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1978 case Encoding_Arabic:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1979 return "ISO_IR 127";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1980
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1981 case Encoding_Greek:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1982 return "ISO_IR 126";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1983
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1984 case Encoding_Hebrew:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1985 return "ISO_IR 138";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1986
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1987 case Encoding_Japanese:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1988 return "ISO_IR 13";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1989
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1990 case Encoding_Chinese:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1991 return "GB18030";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1992
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1993 case Encoding_Thai:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1994 return "ISO_IR 166";
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1995
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1996 default:
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1997 throw OrthancException(ErrorCode_ParameterOutOfRange);
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1998 }
4b23310eb7e8 add tags per instances in a series
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1555
diff changeset
1999 }
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2000
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2001
1578
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1577
diff changeset
2002 // This function is autogenerated by the script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1577
diff changeset
2003 // "Resources/GenerateErrorCodes.py"
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2004 HttpStatus ConvertErrorCodeToHttpStatus(ErrorCode error)
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2005 {
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2006 switch (error)
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2007 {
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2008 case ErrorCode_Success:
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2009 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
2010
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2011 case ErrorCode_ParameterOutOfRange:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2012 return HttpStatus_400_BadRequest;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2013
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2014 case ErrorCode_BadParameterType:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2015 return HttpStatus_400_BadRequest;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2016
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2017 case ErrorCode_InexistentItem:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2018 return HttpStatus_404_NotFound;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2019
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2020 case ErrorCode_BadRequest:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2021 return HttpStatus_400_BadRequest;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2022
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2023 case ErrorCode_UriSyntax:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2024 return HttpStatus_400_BadRequest;
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2025
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2026 case ErrorCode_InexistentFile:
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2027 return HttpStatus_404_NotFound;
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2028
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2029 case ErrorCode_BadFileFormat:
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2030 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
2031
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2032 case ErrorCode_UnknownResource:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2033 return HttpStatus_404_NotFound;
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2034
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2035 case ErrorCode_InexistentTag:
7aac0cddd42e generation of the error codes from a Python script
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1576
diff changeset
2036 return HttpStatus_404_NotFound;
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2037
1596
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2038 case ErrorCode_BadJson:
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2039 return HttpStatus_400_BadRequest;
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2040
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2041 case ErrorCode_Unauthorized:
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2042 return HttpStatus_401_Unauthorized;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2043
1781
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
2044 case ErrorCode_NotAcceptable:
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
2045 return HttpStatus_406_NotAcceptable;
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
2046
2486
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
2047 case ErrorCode_DatabaseUnavailable:
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
2048 return HttpStatus_503_ServiceUnavailable;
ad8f30fc28d1 new error code: DatabaseUnavailable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
2049
2953
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2050 case ErrorCode_CreateDicomNotString:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2051 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2052
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2053 case ErrorCode_CreateDicomOverrideTag:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2054 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2055
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2056 case ErrorCode_CreateDicomUseContent:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2057 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2058
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2059 case ErrorCode_CreateDicomNoPayload:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2060 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2061
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2062 case ErrorCode_CreateDicomUseDataUriScheme:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2063 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2064
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2065 case ErrorCode_CreateDicomBadParent:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2066 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2067
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2068 case ErrorCode_CreateDicomParentIsInstance:
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2069 return HttpStatus_400_BadRequest;
210d5afd8f2b GenerateErrorCodes.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2924
diff changeset
2070
1576
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2071 default:
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2072 return HttpStatus_500_InternalServerError;
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2073 }
de54c19fc44d refactoring OrthancException
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1575
diff changeset
2074 }
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2075
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2076
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2077 bool IsUserContentType(FileContentType type)
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2078 {
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2079 return (type >= FileContentType_StartUser &&
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2080 type <= FileContentType_EndUser);
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1772
diff changeset
2081 }
2007
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2082
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2083
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2084 bool IsBinaryValueRepresentation(ValueRepresentation vr)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2085 {
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2086 // 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
2087
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2088 switch (vr)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2089 {
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2090 case ValueRepresentation_ApplicationEntity: // AE
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2091 case ValueRepresentation_AgeString: // AS
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2092 case ValueRepresentation_CodeString: // CS
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2093 case ValueRepresentation_Date: // DA
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2094 case ValueRepresentation_DecimalString: // DS
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2095 case ValueRepresentation_DateTime: // DT
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2096 case ValueRepresentation_IntegerString: // IS
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2097 case ValueRepresentation_LongString: // LO
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2098 case ValueRepresentation_LongText: // LT
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2099 case ValueRepresentation_PersonName: // PN
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2100 case ValueRepresentation_ShortString: // SH
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2101 case ValueRepresentation_ShortText: // ST
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2102 case ValueRepresentation_Time: // TM
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2103 case ValueRepresentation_UnlimitedCharacters: // UC
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2104 case ValueRepresentation_UniqueIdentifier: // UI (UID)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2105 case ValueRepresentation_UniversalResource: // UR (URI or URL)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2106 case ValueRepresentation_UnlimitedText: // UT
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2107 {
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2108 return false;
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2109 }
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2110
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2111 /**
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2112 * Below are all the VR whose character repertoire is tagged as
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2113 * "not applicable"
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2114 **/
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2115 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2116 case ValueRepresentation_FloatingPointSingle: // FL (float)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2117 case ValueRepresentation_FloatingPointDouble: // FD (double)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2118 case ValueRepresentation_OtherByte: // OB
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2119 case ValueRepresentation_OtherDouble: // OD
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2120 case ValueRepresentation_OtherFloat: // OF
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2121 case ValueRepresentation_OtherLong: // OL
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2122 case ValueRepresentation_OtherWord: // OW
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2123 case ValueRepresentation_SignedLong: // SL (int32_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2124 case ValueRepresentation_Sequence: // SQ
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2125 case ValueRepresentation_SignedShort: // SS (int16_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2126 case ValueRepresentation_UnsignedLong: // UL (uint32_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2127 case ValueRepresentation_Unknown: // UN
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2128 case ValueRepresentation_UnsignedShort: // US (uint16_t)
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2129 {
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2130 return true;
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2131 }
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2132
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2133 case ValueRepresentation_NotSupported:
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2134 default:
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2135 throw OrthancException(ErrorCode_ParameterOutOfRange);
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2136 }
2381
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2137 }
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2138
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2139
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2140 static boost::mutex defaultEncodingMutex_; // Should not be necessary
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2141 static Encoding defaultEncoding_ = ORTHANC_DEFAULT_DICOM_ENCODING;
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2142
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2143 Encoding GetDefaultDicomEncoding()
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2144 {
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2145 boost::mutex::scoped_lock lock(defaultEncodingMutex_);
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2146 return defaultEncoding_;
2007
655489d9165d DicomMap::ParseDicomMetaInformation()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2006
diff changeset
2147 }
2381
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2148
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2149 void SetDefaultDicomEncoding(Encoding encoding)
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2150 {
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2151 std::string name = EnumerationToString(encoding);
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2152
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2153 {
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2154 boost::mutex::scoped_lock lock(defaultEncodingMutex_);
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2155 defaultEncoding_ = encoding;
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2156 }
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2157
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2158 LOG(INFO) << "Default encoding for DICOM was changed to: " << name;
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2159 }
b8969010b534 uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2281
diff changeset
2160
477
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2161 }