Mercurial > hg > orthanc-stone
annotate Resources/Orthanc/Core/Enumerations.h @ 47:28956ed68280
agpl license
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 27 Apr 2017 11:00:15 +0200 |
parents | 7207a407bcd8 |
children |
rev | line source |
---|---|
1 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
40
7207a407bcd8
shared copyright with osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
16
diff
changeset
|
5 * Copyright (C) 2017 Osimis, Belgium |
1 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
11 * | |
12 * In addition, as a special exception, the copyright holders of this | |
13 * program give permission to link the code of its release with the | |
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
15 * that use the same license as the "OpenSSL" library), and distribute | |
16 * the linked executables. You must obey the GNU General Public License | |
17 * in all respects for all of the code used other than "OpenSSL". If you | |
18 * modify file(s) with this exception, you may extend this exception to | |
19 * your version of the file(s), but you are not obligated to do so. If | |
20 * you do not wish to do so, delete this exception statement from your | |
21 * version. If you delete this exception statement from all source files | |
22 * in the program, then also delete it here. | |
23 * | |
24 * This program is distributed in the hope that it will be useful, but | |
25 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
27 * General Public License for more details. | |
28 * | |
29 * You should have received a copy of the GNU General Public License | |
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 **/ | |
32 | |
33 | |
34 #pragma once | |
35 | |
36 #include <string> | |
37 | |
38 namespace Orthanc | |
39 { | |
40 enum Endianness | |
41 { | |
42 Endianness_Unknown, | |
43 Endianness_Big, | |
44 Endianness_Little | |
45 }; | |
46 | |
47 // This enumeration is autogenerated by the script | |
48 // "Resources/GenerateErrorCodes.py" | |
49 enum ErrorCode | |
50 { | |
51 ErrorCode_InternalError = -1 /*!< Internal error */, | |
52 ErrorCode_Success = 0 /*!< Success */, | |
53 ErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */, | |
54 ErrorCode_NotImplemented = 2 /*!< Not implemented yet */, | |
55 ErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */, | |
12 | 56 ErrorCode_NotEnoughMemory = 4 /*!< The server hosting Orthanc is running out of memory */, |
1 | 57 ErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */, |
58 ErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */, | |
59 ErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */, | |
60 ErrorCode_BadRequest = 8 /*!< Bad request */, | |
61 ErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */, | |
62 ErrorCode_SystemCommand = 10 /*!< Error while calling a system command */, | |
63 ErrorCode_Database = 11 /*!< Error with the database engine */, | |
64 ErrorCode_UriSyntax = 12 /*!< Badly formatted URI */, | |
65 ErrorCode_InexistentFile = 13 /*!< Inexistent file */, | |
66 ErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */, | |
67 ErrorCode_BadFileFormat = 15 /*!< Bad file format */, | |
68 ErrorCode_Timeout = 16 /*!< Timeout */, | |
69 ErrorCode_UnknownResource = 17 /*!< Unknown resource */, | |
70 ErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */, | |
71 ErrorCode_FullStorage = 19 /*!< The file storage is full */, | |
72 ErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */, | |
73 ErrorCode_InexistentTag = 21 /*!< Inexistent tag */, | |
74 ErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */, | |
75 ErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */, | |
76 ErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */, | |
77 ErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */, | |
78 ErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */, | |
79 ErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */, | |
80 ErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */, | |
81 ErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */, | |
82 ErrorCode_BadFont = 30 /*!< Badly formatted font file */, | |
83 ErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */, | |
84 ErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */, | |
85 ErrorCode_EmptyRequest = 33 /*!< The request is empty */, | |
86 ErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */, | |
12 | 87 ErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */, |
1 | 88 ErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */, |
89 ErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */, | |
90 ErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */, | |
91 ErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */, | |
92 ErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */, | |
93 ErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */, | |
94 ErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */, | |
95 ErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */, | |
96 ErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */, | |
97 ErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */, | |
98 ErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */, | |
99 ErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */, | |
100 ErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */, | |
101 ErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */, | |
102 ErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */, | |
103 ErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */, | |
104 ErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */, | |
105 ErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */, | |
106 ErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */, | |
107 ErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is privileged or already in use */, | |
108 ErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is privileged or already in use */, | |
109 ErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */, | |
110 ErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */, | |
111 ErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */, | |
112 ErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */, | |
113 ErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */, | |
114 ErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */, | |
115 ErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */, | |
116 ErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */, | |
117 ErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */, | |
118 ErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */, | |
119 ErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */, | |
120 ErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */, | |
121 ErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */, | |
122 ErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */, | |
123 ErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */, | |
124 ErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */, | |
125 ErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */, | |
126 ErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */, | |
127 ErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */, | |
128 ErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */, | |
129 ErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */, | |
130 ErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */, | |
131 ErrorCode_UnknownModality = 2027 /*!< Unknown modality */, | |
132 ErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */, | |
133 ErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */, | |
134 ErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */, | |
135 ErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */, | |
136 ErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */, | |
137 ErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */, | |
138 ErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */, | |
139 ErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */, | |
140 ErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */, | |
141 ErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */, | |
142 ErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */, | |
143 ErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */, | |
144 ErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */, | |
145 ErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */, | |
146 ErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */, | |
147 ErrorCode_START_PLUGINS = 1000000 | |
148 }; | |
149 | |
150 enum LogLevel | |
151 { | |
152 LogLevel_Error, | |
153 LogLevel_Warning, | |
154 LogLevel_Info, | |
155 LogLevel_Trace | |
156 }; | |
157 | |
158 | |
159 /** | |
160 * {summary}{The memory layout of the pixels (resp. voxels) of a 2D (resp. 3D) image.} | |
161 **/ | |
162 enum PixelFormat | |
163 { | |
164 /** | |
165 * {summary}{Color image in RGB24 format.} | |
166 * {description}{This format describes a color image. The pixels are stored in 3 | |
167 * consecutive bytes. The memory layout is RGB.} | |
168 **/ | |
169 PixelFormat_RGB24 = 1, | |
170 | |
171 /** | |
172 * {summary}{Color image in RGBA32 format.} | |
173 * {description}{This format describes a color image. The pixels are stored in 4 | |
174 * consecutive bytes. The memory layout is RGBA.} | |
175 **/ | |
176 PixelFormat_RGBA32 = 2, | |
177 | |
178 /** | |
179 * {summary}{Graylevel 8bpp image.} | |
180 * {description}{The image is graylevel. Each pixel is unsigned and stored in one byte.} | |
181 **/ | |
182 PixelFormat_Grayscale8 = 3, | |
183 | |
184 /** | |
185 * {summary}{Graylevel, unsigned 16bpp image.} | |
186 * {description}{The image is graylevel. Each pixel is unsigned and stored in two bytes.} | |
187 **/ | |
188 PixelFormat_Grayscale16 = 4, | |
189 | |
190 /** | |
191 * {summary}{Graylevel, signed 16bpp image.} | |
192 * {description}{The image is graylevel. Each pixel is signed and stored in two bytes.} | |
193 **/ | |
194 PixelFormat_SignedGrayscale16 = 5, | |
195 | |
196 /** | |
197 * {summary}{Graylevel, floating-point image.} | |
198 * {description}{The image is graylevel. Each pixel is floating-point and stored in 4 bytes.} | |
199 **/ | |
200 PixelFormat_Float32 = 6, | |
201 | |
202 // This is the memory layout for Cairo | |
203 PixelFormat_BGRA32 = 7 | |
204 }; | |
205 | |
206 | |
207 /** | |
208 * {summary}{The extraction mode specifies the way the values of the pixels are scaled when downloading a 2D image.} | |
209 **/ | |
210 enum ImageExtractionMode | |
211 { | |
212 /** | |
213 * {summary}{Rescaled to 8bpp.} | |
214 * {description}{The minimum value of the image is set to 0, and its maximum value is set to 255.} | |
215 **/ | |
216 ImageExtractionMode_Preview = 1, | |
217 | |
218 /** | |
219 * {summary}{Truncation to the [0, 255] range.} | |
220 **/ | |
221 ImageExtractionMode_UInt8 = 2, | |
222 | |
223 /** | |
224 * {summary}{Truncation to the [0, 65535] range.} | |
225 **/ | |
226 ImageExtractionMode_UInt16 = 3, | |
227 | |
228 /** | |
229 * {summary}{Truncation to the [-32768, 32767] range.} | |
230 **/ | |
231 ImageExtractionMode_Int16 = 4 | |
232 }; | |
233 | |
234 | |
235 /** | |
236 * Most common, non-joke and non-experimental HTTP status codes | |
237 * http://en.wikipedia.org/wiki/List_of_HTTP_status_codes | |
238 **/ | |
239 enum HttpStatus | |
240 { | |
241 HttpStatus_None = -1, | |
242 | |
243 // 1xx Informational | |
244 HttpStatus_100_Continue = 100, | |
245 HttpStatus_101_SwitchingProtocols = 101, | |
246 HttpStatus_102_Processing = 102, | |
247 | |
248 // 2xx Success | |
249 HttpStatus_200_Ok = 200, | |
250 HttpStatus_201_Created = 201, | |
251 HttpStatus_202_Accepted = 202, | |
252 HttpStatus_203_NonAuthoritativeInformation = 203, | |
253 HttpStatus_204_NoContent = 204, | |
254 HttpStatus_205_ResetContent = 205, | |
255 HttpStatus_206_PartialContent = 206, | |
256 HttpStatus_207_MultiStatus = 207, | |
257 HttpStatus_208_AlreadyReported = 208, | |
258 HttpStatus_226_IMUsed = 226, | |
259 | |
260 // 3xx Redirection | |
261 HttpStatus_300_MultipleChoices = 300, | |
262 HttpStatus_301_MovedPermanently = 301, | |
263 HttpStatus_302_Found = 302, | |
264 HttpStatus_303_SeeOther = 303, | |
265 HttpStatus_304_NotModified = 304, | |
266 HttpStatus_305_UseProxy = 305, | |
267 HttpStatus_307_TemporaryRedirect = 307, | |
268 | |
269 // 4xx Client Error | |
270 HttpStatus_400_BadRequest = 400, | |
271 HttpStatus_401_Unauthorized = 401, | |
272 HttpStatus_402_PaymentRequired = 402, | |
273 HttpStatus_403_Forbidden = 403, | |
274 HttpStatus_404_NotFound = 404, | |
275 HttpStatus_405_MethodNotAllowed = 405, | |
276 HttpStatus_406_NotAcceptable = 406, | |
277 HttpStatus_407_ProxyAuthenticationRequired = 407, | |
278 HttpStatus_408_RequestTimeout = 408, | |
279 HttpStatus_409_Conflict = 409, | |
280 HttpStatus_410_Gone = 410, | |
281 HttpStatus_411_LengthRequired = 411, | |
282 HttpStatus_412_PreconditionFailed = 412, | |
283 HttpStatus_413_RequestEntityTooLarge = 413, | |
284 HttpStatus_414_RequestUriTooLong = 414, | |
285 HttpStatus_415_UnsupportedMediaType = 415, | |
286 HttpStatus_416_RequestedRangeNotSatisfiable = 416, | |
287 HttpStatus_417_ExpectationFailed = 417, | |
288 HttpStatus_422_UnprocessableEntity = 422, | |
289 HttpStatus_423_Locked = 423, | |
290 HttpStatus_424_FailedDependency = 424, | |
291 HttpStatus_426_UpgradeRequired = 426, | |
292 | |
293 // 5xx Server Error | |
294 HttpStatus_500_InternalServerError = 500, | |
295 HttpStatus_501_NotImplemented = 501, | |
296 HttpStatus_502_BadGateway = 502, | |
297 HttpStatus_503_ServiceUnavailable = 503, | |
298 HttpStatus_504_GatewayTimeout = 504, | |
299 HttpStatus_505_HttpVersionNotSupported = 505, | |
300 HttpStatus_506_VariantAlsoNegotiates = 506, | |
301 HttpStatus_507_InsufficientStorage = 507, | |
302 HttpStatus_509_BandwidthLimitExceeded = 509, | |
303 HttpStatus_510_NotExtended = 510 | |
304 }; | |
305 | |
306 | |
307 enum HttpMethod | |
308 { | |
309 HttpMethod_Get = 0, | |
310 HttpMethod_Post = 1, | |
311 HttpMethod_Delete = 2, | |
312 HttpMethod_Put = 3 | |
313 }; | |
314 | |
315 | |
316 enum ImageFormat | |
317 { | |
318 ImageFormat_Png = 1 | |
319 }; | |
320 | |
321 | |
322 // https://en.wikipedia.org/wiki/HTTP_compression | |
323 enum HttpCompression | |
324 { | |
325 HttpCompression_None, | |
326 HttpCompression_Deflate, | |
327 HttpCompression_Gzip | |
328 }; | |
329 | |
330 | |
331 // Specific Character Sets | |
332 // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 | |
333 enum Encoding | |
334 { | |
335 Encoding_Ascii, | |
336 Encoding_Utf8, | |
337 Encoding_Latin1, | |
338 Encoding_Latin2, | |
339 Encoding_Latin3, | |
340 Encoding_Latin4, | |
341 Encoding_Latin5, // Turkish | |
342 Encoding_Cyrillic, | |
343 Encoding_Windows1251, // Windows-1251 (commonly used for Cyrillic) | |
344 Encoding_Arabic, | |
345 Encoding_Greek, | |
346 Encoding_Hebrew, | |
347 Encoding_Thai, // TIS 620-2533 | |
348 Encoding_Japanese, // JIS X 0201 (Shift JIS): Katakana | |
349 Encoding_Chinese // GB18030 - Chinese simplified | |
350 //Encoding_JapaneseKanji, // Multibyte - JIS X 0208: Kanji | |
351 //Encoding_JapaneseSupplementaryKanji, // Multibyte - JIS X 0212: Supplementary Kanji set | |
352 //Encoding_Korean, // Multibyte - KS X 1001: Hangul and Hanja | |
353 }; | |
354 | |
355 | |
356 // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.7.6.3.1.2 | |
357 enum PhotometricInterpretation | |
358 { | |
359 PhotometricInterpretation_ARGB, // Retired | |
360 PhotometricInterpretation_CMYK, // Retired | |
361 PhotometricInterpretation_HSV, // Retired | |
362 PhotometricInterpretation_Monochrome1, | |
363 PhotometricInterpretation_Monochrome2, | |
364 PhotometricInterpretation_Palette, | |
365 PhotometricInterpretation_RGB, | |
366 PhotometricInterpretation_YBRFull, | |
367 PhotometricInterpretation_YBRFull422, | |
368 PhotometricInterpretation_YBRPartial420, | |
369 PhotometricInterpretation_YBRPartial422, | |
370 PhotometricInterpretation_YBR_ICT, | |
371 PhotometricInterpretation_YBR_RCT, | |
372 PhotometricInterpretation_Unknown | |
373 }; | |
374 | |
375 enum DicomModule | |
376 { | |
377 DicomModule_Patient, | |
378 DicomModule_Study, | |
379 DicomModule_Series, | |
380 DicomModule_Instance, | |
381 DicomModule_Image | |
382 }; | |
383 | |
384 enum RequestOrigin | |
385 { | |
386 RequestOrigin_Unknown, | |
387 RequestOrigin_DicomProtocol, | |
388 RequestOrigin_RestApi, | |
389 RequestOrigin_Plugins, | |
390 RequestOrigin_Lua | |
391 }; | |
392 | |
393 enum ServerBarrierEvent | |
394 { | |
395 ServerBarrierEvent_Stop, | |
396 ServerBarrierEvent_Reload // SIGHUP signal: reload configuration file | |
397 }; | |
398 | |
399 enum FileMode | |
400 { | |
401 FileMode_ReadBinary, | |
402 FileMode_WriteBinary | |
403 }; | |
404 | |
405 /** | |
406 * The value representations Orthanc knows about. They correspond to | |
407 * the DICOM 2016b version of the standard. | |
408 * http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html | |
409 **/ | |
410 enum ValueRepresentation | |
411 { | |
412 ValueRepresentation_ApplicationEntity = 1, // AE | |
413 ValueRepresentation_AgeString = 2, // AS | |
414 ValueRepresentation_AttributeTag = 3, // AT (2 x uint16_t) | |
415 ValueRepresentation_CodeString = 4, // CS | |
416 ValueRepresentation_Date = 5, // DA | |
417 ValueRepresentation_DecimalString = 6, // DS | |
418 ValueRepresentation_DateTime = 7, // DT | |
419 ValueRepresentation_FloatingPointSingle = 8, // FL (float) | |
420 ValueRepresentation_FloatingPointDouble = 9, // FD (double) | |
421 ValueRepresentation_IntegerString = 10, // IS | |
422 ValueRepresentation_LongString = 11, // LO | |
423 ValueRepresentation_LongText = 12, // LT | |
424 ValueRepresentation_OtherByte = 13, // OB | |
425 ValueRepresentation_OtherDouble = 14, // OD | |
426 ValueRepresentation_OtherFloat = 15, // OF | |
427 ValueRepresentation_OtherLong = 16, // OL | |
428 ValueRepresentation_OtherWord = 17, // OW | |
429 ValueRepresentation_PersonName = 18, // PN | |
430 ValueRepresentation_ShortString = 19, // SH | |
431 ValueRepresentation_SignedLong = 20, // SL (int32_t) | |
432 ValueRepresentation_Sequence = 21, // SQ | |
433 ValueRepresentation_SignedShort = 22, // SS (int16_t) | |
434 ValueRepresentation_ShortText = 23, // ST | |
435 ValueRepresentation_Time = 24, // TM | |
436 ValueRepresentation_UnlimitedCharacters = 25, // UC | |
437 ValueRepresentation_UniqueIdentifier = 26, // UI (UID) | |
438 ValueRepresentation_UnsignedLong = 27, // UL (uint32_t) | |
439 ValueRepresentation_Unknown = 28, // UN | |
440 ValueRepresentation_UniversalResource = 29, // UR (URI or URL) | |
441 ValueRepresentation_UnsignedShort = 30, // US (uint16_t) | |
442 ValueRepresentation_UnlimitedText = 31, // UT | |
443 ValueRepresentation_NotSupported // Not supported by Orthanc, or tag not in dictionary | |
444 }; | |
445 | |
446 | |
447 /** | |
448 * WARNING: Do not change the explicit values in the enumerations | |
449 * below this point. This would result in incompatible databases | |
450 * between versions of Orthanc! | |
451 **/ | |
452 | |
453 enum CompressionType | |
454 { | |
455 /** | |
456 * Buffer/file that is stored as-is, in a raw fashion, without | |
457 * compression. | |
458 **/ | |
459 CompressionType_None = 1, | |
460 | |
461 /** | |
462 * Buffer that is compressed using the "deflate" algorithm (RFC | |
463 * 1951), wrapped inside the zlib data format (RFC 1950), prefixed | |
464 * with a "uint64_t" (8 bytes) that encodes the size of the | |
465 * uncompressed buffer. If the compressed buffer is empty, its | |
466 * represents an empty uncompressed buffer. This format is | |
467 * internal to Orthanc. If the 8 first bytes are skipped AND the | |
468 * buffer is non-empty, the buffer is compatible with the | |
469 * "deflate" HTTP compression. | |
470 **/ | |
471 CompressionType_ZlibWithSize = 2 | |
472 }; | |
473 | |
474 enum FileContentType | |
475 { | |
476 // If you add a value below, insert it in "PluginStorageArea" in | |
477 // the file "Plugins/Engine/OrthancPlugins.cpp" | |
478 FileContentType_Unknown = 0, | |
479 FileContentType_Dicom = 1, | |
480 FileContentType_DicomAsJson = 2, | |
481 | |
482 // Make sure that the value "65535" can be stored into this enumeration | |
483 FileContentType_StartUser = 1024, | |
484 FileContentType_EndUser = 65535 | |
485 }; | |
486 | |
487 enum ResourceType | |
488 { | |
489 ResourceType_Patient = 1, | |
490 ResourceType_Study = 2, | |
491 ResourceType_Series = 3, | |
492 ResourceType_Instance = 4 | |
493 }; | |
494 | |
495 | |
496 const char* EnumerationToString(ErrorCode code); | |
497 | |
498 const char* EnumerationToString(HttpMethod method); | |
499 | |
500 const char* EnumerationToString(HttpStatus status); | |
501 | |
502 const char* EnumerationToString(ResourceType type); | |
503 | |
504 const char* EnumerationToString(ImageFormat format); | |
505 | |
506 const char* EnumerationToString(Encoding encoding); | |
507 | |
508 const char* EnumerationToString(PhotometricInterpretation photometric); | |
509 | |
510 const char* EnumerationToString(LogLevel level); | |
511 | |
512 const char* EnumerationToString(RequestOrigin origin); | |
513 | |
514 const char* EnumerationToString(PixelFormat format); | |
515 | |
516 Encoding StringToEncoding(const char* encoding); | |
517 | |
518 ResourceType StringToResourceType(const char* type); | |
519 | |
520 ImageFormat StringToImageFormat(const char* format); | |
521 | |
522 LogLevel StringToLogLevel(const char* level); | |
523 | |
524 ValueRepresentation StringToValueRepresentation(const std::string& vr, | |
525 bool throwIfUnsupported); | |
526 | |
527 unsigned int GetBytesPerPixel(PixelFormat format); | |
528 | |
529 bool GetDicomEncoding(Encoding& encoding, | |
530 const char* specificCharacterSet); | |
531 | |
532 ResourceType GetChildResourceType(ResourceType type); | |
533 | |
534 ResourceType GetParentResourceType(ResourceType type); | |
535 | |
536 DicomModule GetModule(ResourceType type); | |
537 | |
538 const char* GetDicomSpecificCharacterSet(Encoding encoding); | |
539 | |
540 HttpStatus ConvertErrorCodeToHttpStatus(ErrorCode error); | |
541 | |
542 bool IsUserContentType(FileContentType type); | |
543 | |
544 bool IsBinaryValueRepresentation(ValueRepresentation vr); | |
545 } |