comparison Resources/Orthanc/Core/Enumerations.cpp @ 200:03afbee0cc7b

integration of Orthanc core into Stone
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Mar 2018 11:04:03 +0100
parents
children e7f90aba3c97
comparison
equal deleted inserted replaced
199:dabe9982fca3 200:03afbee0cc7b
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
11 *
12 * In addition, as a special exception, the copyright holders of this
13 * program give permission to link the code of its release with the
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
15 * that use the same license as the "OpenSSL" library), and distribute
16 * the linked executables. You must obey the GNU General Public License
17 * in all respects for all of the code used other than "OpenSSL". If you
18 * modify file(s) with this exception, you may extend this exception to
19 * your version of the file(s), but you are not obligated to do so. If
20 * you do not wish to do so, delete this exception statement from your
21 * version. If you delete this exception statement from all source files
22 * in the program, then also delete it here.
23 *
24 * This program is distributed in the hope that it will be useful, but
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public License
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31 **/
32
33
34 #include "PrecompiledHeaders.h"
35 #include "Enumerations.h"
36
37 #include "OrthancException.h"
38 #include "Toolbox.h"
39 #include "Logging.h"
40
41 #include <boost/thread/mutex.hpp>
42 #include <string.h>
43 #include <cassert>
44
45 namespace Orthanc
46 {
47 // This function is autogenerated by the script
48 // "Resources/GenerateErrorCodes.py"
49 const char* EnumerationToString(ErrorCode error)
50 {
51 switch (error)
52 {
53 case ErrorCode_InternalError:
54 return "Internal error";
55
56 case ErrorCode_Success:
57 return "Success";
58
59 case ErrorCode_Plugin:
60 return "Error encountered within the plugin engine";
61
62 case ErrorCode_NotImplemented:
63 return "Not implemented yet";
64
65 case ErrorCode_ParameterOutOfRange:
66 return "Parameter out of range";
67
68 case ErrorCode_NotEnoughMemory:
69 return "The server hosting Orthanc is running out of memory";
70
71 case ErrorCode_BadParameterType:
72 return "Bad type for a parameter";
73
74 case ErrorCode_BadSequenceOfCalls:
75 return "Bad sequence of calls";
76
77 case ErrorCode_InexistentItem:
78 return "Accessing an inexistent item";
79
80 case ErrorCode_BadRequest:
81 return "Bad request";
82
83 case ErrorCode_NetworkProtocol:
84 return "Error in the network protocol";
85
86 case ErrorCode_SystemCommand:
87 return "Error while calling a system command";
88
89 case ErrorCode_Database:
90 return "Error with the database engine";
91
92 case ErrorCode_UriSyntax:
93 return "Badly formatted URI";
94
95 case ErrorCode_InexistentFile:
96 return "Inexistent file";
97
98 case ErrorCode_CannotWriteFile:
99 return "Cannot write to file";
100
101 case ErrorCode_BadFileFormat:
102 return "Bad file format";
103
104 case ErrorCode_Timeout:
105 return "Timeout";
106
107 case ErrorCode_UnknownResource:
108 return "Unknown resource";
109
110 case ErrorCode_IncompatibleDatabaseVersion:
111 return "Incompatible version of the database";
112
113 case ErrorCode_FullStorage:
114 return "The file storage is full";
115
116 case ErrorCode_CorruptedFile:
117 return "Corrupted file (e.g. inconsistent MD5 hash)";
118
119 case ErrorCode_InexistentTag:
120 return "Inexistent tag";
121
122 case ErrorCode_ReadOnly:
123 return "Cannot modify a read-only data structure";
124
125 case ErrorCode_IncompatibleImageFormat:
126 return "Incompatible format of the images";
127
128 case ErrorCode_IncompatibleImageSize:
129 return "Incompatible size of the images";
130
131 case ErrorCode_SharedLibrary:
132 return "Error while using a shared library (plugin)";
133
134 case ErrorCode_UnknownPluginService:
135 return "Plugin invoking an unknown service";
136
137 case ErrorCode_UnknownDicomTag:
138 return "Unknown DICOM tag";
139
140 case ErrorCode_BadJson:
141 return "Cannot parse a JSON document";
142
143 case ErrorCode_Unauthorized:
144 return "Bad credentials were provided to an HTTP request";
145
146 case ErrorCode_BadFont:
147 return "Badly formatted font file";
148
149 case ErrorCode_DatabasePlugin:
150 return "The plugin implementing a custom database back-end does not fulfill the proper interface";
151
152 case ErrorCode_StorageAreaPlugin:
153 return "Error in the plugin implementing a custom storage area";
154
155 case ErrorCode_EmptyRequest:
156 return "The request is empty";
157
158 case ErrorCode_NotAcceptable:
159 return "Cannot send a response which is acceptable according to the Accept HTTP header";
160
161 case ErrorCode_NullPointer:
162 return "Cannot handle a NULL pointer";
163
164 case ErrorCode_DatabaseUnavailable:
165 return "The database is currently not available (probably a transient situation)";
166
167 case ErrorCode_SQLiteNotOpened:
168 return "SQLite: The database is not opened";
169
170 case ErrorCode_SQLiteAlreadyOpened:
171 return "SQLite: Connection is already open";
172
173 case ErrorCode_SQLiteCannotOpen:
174 return "SQLite: Unable to open the database";
175
176 case ErrorCode_SQLiteStatementAlreadyUsed:
177 return "SQLite: This cached statement is already being referred to";
178
179 case ErrorCode_SQLiteExecute:
180 return "SQLite: Cannot execute a command";
181
182 case ErrorCode_SQLiteRollbackWithoutTransaction:
183 return "SQLite: Rolling back a nonexistent transaction (have you called Begin()?)";
184
185 case ErrorCode_SQLiteCommitWithoutTransaction:
186 return "SQLite: Committing a nonexistent transaction";
187
188 case ErrorCode_SQLiteRegisterFunction:
189 return "SQLite: Unable to register a function";
190
191 case ErrorCode_SQLiteFlush:
192 return "SQLite: Unable to flush the database";
193
194 case ErrorCode_SQLiteCannotRun:
195 return "SQLite: Cannot run a cached statement";
196
197 case ErrorCode_SQLiteCannotStep:
198 return "SQLite: Cannot step over a cached statement";
199
200 case ErrorCode_SQLiteBindOutOfRange:
201 return "SQLite: Bing a value while out of range (serious error)";
202
203 case ErrorCode_SQLitePrepareStatement:
204 return "SQLite: Cannot prepare a cached statement";
205
206 case ErrorCode_SQLiteTransactionAlreadyStarted:
207 return "SQLite: Beginning the same transaction twice";
208
209 case ErrorCode_SQLiteTransactionCommit:
210 return "SQLite: Failure when committing the transaction";
211
212 case ErrorCode_SQLiteTransactionBegin:
213 return "SQLite: Cannot start a transaction";
214
215 case ErrorCode_DirectoryOverFile:
216 return "The directory to be created is already occupied by a regular file";
217
218 case ErrorCode_FileStorageCannotWrite:
219 return "Unable to create a subdirectory or a file in the file storage";
220
221 case ErrorCode_DirectoryExpected:
222 return "The specified path does not point to a directory";
223
224 case ErrorCode_HttpPortInUse:
225 return "The TCP port of the HTTP server is privileged or already in use";
226
227 case ErrorCode_DicomPortInUse:
228 return "The TCP port of the DICOM server is privileged or already in use";
229
230 case ErrorCode_BadHttpStatusInRest:
231 return "This HTTP status is not allowed in a REST API";
232
233 case ErrorCode_RegularFileExpected:
234 return "The specified path does not point to a regular file";
235
236 case ErrorCode_PathToExecutable:
237 return "Unable to get the path to the executable";
238
239 case ErrorCode_MakeDirectory:
240 return "Cannot create a directory";
241
242 case ErrorCode_BadApplicationEntityTitle:
243 return "An application entity title (AET) cannot be empty or be longer than 16 characters";
244
245 case ErrorCode_NoCFindHandler:
246 return "No request handler factory for DICOM C-FIND SCP";
247
248 case ErrorCode_NoCMoveHandler:
249 return "No request handler factory for DICOM C-MOVE SCP";
250
251 case ErrorCode_NoCStoreHandler:
252 return "No request handler factory for DICOM C-STORE SCP";
253
254 case ErrorCode_NoApplicationEntityFilter:
255 return "No application entity filter";
256
257 case ErrorCode_NoSopClassOrInstance:
258 return "DicomUserConnection: Unable to find the SOP class and instance";
259
260 case ErrorCode_NoPresentationContext:
261 return "DicomUserConnection: No acceptable presentation context for modality";
262
263 case ErrorCode_DicomFindUnavailable:
264 return "DicomUserConnection: The C-FIND command is not supported by the remote SCP";
265
266 case ErrorCode_DicomMoveUnavailable:
267 return "DicomUserConnection: The C-MOVE command is not supported by the remote SCP";
268
269 case ErrorCode_CannotStoreInstance:
270 return "Cannot store an instance";
271
272 case ErrorCode_CreateDicomNotString:
273 return "Only string values are supported when creating DICOM instances";
274
275 case ErrorCode_CreateDicomOverrideTag:
276 return "Trying to override a value inherited from a parent module";
277
278 case ErrorCode_CreateDicomUseContent:
279 return "Use \"Content\" to inject an image into a new DICOM instance";
280
281 case ErrorCode_CreateDicomNoPayload:
282 return "No payload is present for one instance in the series";
283
284 case ErrorCode_CreateDicomUseDataUriScheme:
285 return "The payload of the DICOM instance must be specified according to Data URI scheme";
286
287 case ErrorCode_CreateDicomBadParent:
288 return "Trying to attach a new DICOM instance to an inexistent resource";
289
290 case ErrorCode_CreateDicomParentIsInstance:
291 return "Trying to attach a new DICOM instance to an instance (must be a series, study or patient)";
292
293 case ErrorCode_CreateDicomParentEncoding:
294 return "Unable to get the encoding of the parent resource";
295
296 case ErrorCode_UnknownModality:
297 return "Unknown modality";
298
299 case ErrorCode_BadJobOrdering:
300 return "Bad ordering of filters in a job";
301
302 case ErrorCode_JsonToLuaTable:
303 return "Cannot convert the given JSON object to a Lua table";
304
305 case ErrorCode_CannotCreateLua:
306 return "Cannot create the Lua context";
307
308 case ErrorCode_CannotExecuteLua:
309 return "Cannot execute a Lua command";
310
311 case ErrorCode_LuaAlreadyExecuted:
312 return "Arguments cannot be pushed after the Lua function is executed";
313
314 case ErrorCode_LuaBadOutput:
315 return "The Lua function does not give the expected number of outputs";
316
317 case ErrorCode_NotLuaPredicate:
318 return "The Lua function is not a predicate (only true/false outputs allowed)";
319
320 case ErrorCode_LuaReturnsNoString:
321 return "The Lua function does not return a string";
322
323 case ErrorCode_StorageAreaAlreadyRegistered:
324 return "Another plugin has already registered a custom storage area";
325
326 case ErrorCode_DatabaseBackendAlreadyRegistered:
327 return "Another plugin has already registered a custom database back-end";
328
329 case ErrorCode_DatabaseNotInitialized:
330 return "Plugin trying to call the database during its initialization";
331
332 case ErrorCode_SslDisabled:
333 return "Orthanc has been built without SSL support";
334
335 case ErrorCode_CannotOrderSlices:
336 return "Unable to order the slices of the series";
337
338 case ErrorCode_NoWorklistHandler:
339 return "No request handler factory for DICOM C-Find Modality SCP";
340
341 case ErrorCode_AlreadyExistingTag:
342 return "Cannot override the value of a tag that already exists";
343
344 default:
345 if (error >= ErrorCode_START_PLUGINS)
346 {
347 return "Error encountered within some plugin";
348 }
349 else
350 {
351 return "Unknown error code";
352 }
353 }
354 }
355
356
357 const char* EnumerationToString(HttpMethod method)
358 {
359 switch (method)
360 {
361 case HttpMethod_Get:
362 return "GET";
363
364 case HttpMethod_Post:
365 return "POST";
366
367 case HttpMethod_Delete:
368 return "DELETE";
369
370 case HttpMethod_Put:
371 return "PUT";
372
373 default:
374 return "?";
375 }
376 }
377
378
379 const char* EnumerationToString(HttpStatus status)
380 {
381 switch (status)
382 {
383 case HttpStatus_100_Continue:
384 return "Continue";
385
386 case HttpStatus_101_SwitchingProtocols:
387 return "Switching Protocols";
388
389 case HttpStatus_102_Processing:
390 return "Processing";
391
392 case HttpStatus_200_Ok:
393 return "OK";
394
395 case HttpStatus_201_Created:
396 return "Created";
397
398 case HttpStatus_202_Accepted:
399 return "Accepted";
400
401 case HttpStatus_203_NonAuthoritativeInformation:
402 return "Non-Authoritative Information";
403
404 case HttpStatus_204_NoContent:
405 return "No Content";
406
407 case HttpStatus_205_ResetContent:
408 return "Reset Content";
409
410 case HttpStatus_206_PartialContent:
411 return "Partial Content";
412
413 case HttpStatus_207_MultiStatus:
414 return "Multi-Status";
415
416 case HttpStatus_208_AlreadyReported:
417 return "Already Reported";
418
419 case HttpStatus_226_IMUsed:
420 return "IM Used";
421
422 case HttpStatus_300_MultipleChoices:
423 return "Multiple Choices";
424
425 case HttpStatus_301_MovedPermanently:
426 return "Moved Permanently";
427
428 case HttpStatus_302_Found:
429 return "Found";
430
431 case HttpStatus_303_SeeOther:
432 return "See Other";
433
434 case HttpStatus_304_NotModified:
435 return "Not Modified";
436
437 case HttpStatus_305_UseProxy:
438 return "Use Proxy";
439
440 case HttpStatus_307_TemporaryRedirect:
441 return "Temporary Redirect";
442
443 case HttpStatus_400_BadRequest:
444 return "Bad Request";
445
446 case HttpStatus_401_Unauthorized:
447 return "Unauthorized";
448
449 case HttpStatus_402_PaymentRequired:
450 return "Payment Required";
451
452 case HttpStatus_403_Forbidden:
453 return "Forbidden";
454
455 case HttpStatus_404_NotFound:
456 return "Not Found";
457
458 case HttpStatus_405_MethodNotAllowed:
459 return "Method Not Allowed";
460
461 case HttpStatus_406_NotAcceptable:
462 return "Not Acceptable";
463
464 case HttpStatus_407_ProxyAuthenticationRequired:
465 return "Proxy Authentication Required";
466
467 case HttpStatus_408_RequestTimeout:
468 return "Request Timeout";
469
470 case HttpStatus_409_Conflict:
471 return "Conflict";
472
473 case HttpStatus_410_Gone:
474 return "Gone";
475
476 case HttpStatus_411_LengthRequired:
477 return "Length Required";
478
479 case HttpStatus_412_PreconditionFailed:
480 return "Precondition Failed";
481
482 case HttpStatus_413_RequestEntityTooLarge:
483 return "Request Entity Too Large";
484
485 case HttpStatus_414_RequestUriTooLong:
486 return "Request-URI Too Long";
487
488 case HttpStatus_415_UnsupportedMediaType:
489 return "Unsupported Media Type";
490
491 case HttpStatus_416_RequestedRangeNotSatisfiable:
492 return "Requested Range Not Satisfiable";
493
494 case HttpStatus_417_ExpectationFailed:
495 return "Expectation Failed";
496
497 case HttpStatus_422_UnprocessableEntity:
498 return "Unprocessable Entity";
499
500 case HttpStatus_423_Locked:
501 return "Locked";
502
503 case HttpStatus_424_FailedDependency:
504 return "Failed Dependency";
505
506 case HttpStatus_426_UpgradeRequired:
507 return "Upgrade Required";
508
509 case HttpStatus_500_InternalServerError:
510 return "Internal Server Error";
511
512 case HttpStatus_501_NotImplemented:
513 return "Not Implemented";
514
515 case HttpStatus_502_BadGateway:
516 return "Bad Gateway";
517
518 case HttpStatus_503_ServiceUnavailable:
519 return "Service Unavailable";
520
521 case HttpStatus_504_GatewayTimeout:
522 return "Gateway Timeout";
523
524 case HttpStatus_505_HttpVersionNotSupported:
525 return "HTTP Version Not Supported";
526
527 case HttpStatus_506_VariantAlsoNegotiates:
528 return "Variant Also Negotiates";
529
530 case HttpStatus_507_InsufficientStorage:
531 return "Insufficient Storage";
532
533 case HttpStatus_509_BandwidthLimitExceeded:
534 return "Bandwidth Limit Exceeded";
535
536 case HttpStatus_510_NotExtended:
537 return "Not Extended";
538
539 default:
540 throw OrthancException(ErrorCode_ParameterOutOfRange);
541 }
542 }
543
544
545 const char* EnumerationToString(ResourceType type)
546 {
547 switch (type)
548 {
549 case ResourceType_Patient:
550 return "Patient";
551
552 case ResourceType_Study:
553 return "Study";
554
555 case ResourceType_Series:
556 return "Series";
557
558 case ResourceType_Instance:
559 return "Instance";
560
561 default:
562 throw OrthancException(ErrorCode_ParameterOutOfRange);
563 }
564 }
565
566
567 const char* EnumerationToString(ImageFormat format)
568 {
569 switch (format)
570 {
571 case ImageFormat_Png:
572 return "Png";
573
574 default:
575 throw OrthancException(ErrorCode_ParameterOutOfRange);
576 }
577 }
578
579
580 const char* EnumerationToString(Encoding encoding)
581 {
582 switch (encoding)
583 {
584 case Encoding_Ascii:
585 return "Ascii";
586
587 case Encoding_Utf8:
588 return "Utf8";
589
590 case Encoding_Latin1:
591 return "Latin1";
592
593 case Encoding_Latin2:
594 return "Latin2";
595
596 case Encoding_Latin3:
597 return "Latin3";
598
599 case Encoding_Latin4:
600 return "Latin4";
601
602 case Encoding_Latin5:
603 return "Latin5";
604
605 case Encoding_Cyrillic:
606 return "Cyrillic";
607
608 case Encoding_Windows1251:
609 return "Windows1251";
610
611 case Encoding_Arabic:
612 return "Arabic";
613
614 case Encoding_Greek:
615 return "Greek";
616
617 case Encoding_Hebrew:
618 return "Hebrew";
619
620 case Encoding_Thai:
621 return "Thai";
622
623 case Encoding_Japanese:
624 return "Japanese";
625
626 case Encoding_Chinese:
627 return "Chinese";
628
629 default:
630 throw OrthancException(ErrorCode_ParameterOutOfRange);
631 }
632 }
633
634
635 const char* EnumerationToString(PhotometricInterpretation photometric)
636 {
637 switch (photometric)
638 {
639 case PhotometricInterpretation_RGB:
640 return "RGB";
641
642 case PhotometricInterpretation_Monochrome1:
643 return "MONOCHROME1";
644
645 case PhotometricInterpretation_Monochrome2:
646 return "MONOCHROME2";
647
648 case PhotometricInterpretation_ARGB:
649 return "ARGB";
650
651 case PhotometricInterpretation_CMYK:
652 return "CMYK";
653
654 case PhotometricInterpretation_HSV:
655 return "HSV";
656
657 case PhotometricInterpretation_Palette:
658 return "PALETTE COLOR";
659
660 case PhotometricInterpretation_YBRFull:
661 return "YBR_FULL";
662
663 case PhotometricInterpretation_YBRFull422:
664 return "YBR_FULL_422";
665
666 case PhotometricInterpretation_YBRPartial420:
667 return "YBR_PARTIAL_420";
668
669 case PhotometricInterpretation_YBRPartial422:
670 return "YBR_PARTIAL_422";
671
672 case PhotometricInterpretation_YBR_ICT:
673 return "YBR_ICT";
674
675 case PhotometricInterpretation_YBR_RCT:
676 return "YBR_RCT";
677
678 case PhotometricInterpretation_Unknown:
679 return "Unknown";
680
681 default:
682 throw OrthancException(ErrorCode_ParameterOutOfRange);
683 }
684 }
685
686
687 const char* EnumerationToString(RequestOrigin origin)
688 {
689 switch (origin)
690 {
691 case RequestOrigin_Unknown:
692 return "Unknown";
693
694 case RequestOrigin_DicomProtocol:
695 return "DicomProtocol";
696
697 case RequestOrigin_RestApi:
698 return "RestApi";
699
700 case RequestOrigin_Plugins:
701 return "Plugins";
702
703 case RequestOrigin_Lua:
704 return "Lua";
705
706 default:
707 throw OrthancException(ErrorCode_ParameterOutOfRange);
708 }
709 }
710
711
712 const char* EnumerationToString(LogLevel level)
713 {
714 switch (level)
715 {
716 case LogLevel_Error:
717 return "ERROR";
718
719 case LogLevel_Warning:
720 return "WARNING";
721
722 case LogLevel_Info:
723 return "INFO";
724
725 case LogLevel_Trace:
726 return "TRACE";
727
728 default:
729 throw OrthancException(ErrorCode_ParameterOutOfRange);
730 }
731 }
732
733
734 const char* EnumerationToString(PixelFormat format)
735 {
736 switch (format)
737 {
738 case PixelFormat_RGB24:
739 return "RGB24";
740
741 case PixelFormat_RGBA32:
742 return "RGBA32";
743
744 case PixelFormat_BGRA32:
745 return "BGRA32";
746
747 case PixelFormat_Grayscale8:
748 return "Grayscale (unsigned 8bpp)";
749
750 case PixelFormat_Grayscale16:
751 return "Grayscale (unsigned 16bpp)";
752
753 case PixelFormat_SignedGrayscale16:
754 return "Grayscale (signed 16bpp)";
755
756 case PixelFormat_Float32:
757 return "Grayscale (float 32bpp)";
758
759 case PixelFormat_Grayscale32:
760 return "Grayscale (unsigned 32bpp)";
761
762 case PixelFormat_RGB48:
763 return "RGB48";
764
765 default:
766 throw OrthancException(ErrorCode_ParameterOutOfRange);
767 }
768 }
769
770
771 const char* EnumerationToString(ModalityManufacturer manufacturer)
772 {
773 switch (manufacturer)
774 {
775 case ModalityManufacturer_Generic:
776 return "Generic";
777
778 case ModalityManufacturer_GenericNoWildcardInDates:
779 return "GenericNoWildcardInDates";
780
781 case ModalityManufacturer_GenericNoUniversalWildcard:
782 return "GenericNoUniversalWildcard";
783
784 case ModalityManufacturer_StoreScp:
785 return "StoreScp";
786
787 case ModalityManufacturer_ClearCanvas:
788 return "ClearCanvas";
789
790 case ModalityManufacturer_Dcm4Chee:
791 return "Dcm4Chee";
792
793 case ModalityManufacturer_Vitrea:
794 return "Vitrea";
795
796 default:
797 throw OrthancException(ErrorCode_ParameterOutOfRange);
798 }
799 }
800
801
802 const char* EnumerationToString(DicomRequestType type)
803 {
804 switch (type)
805 {
806 case DicomRequestType_Echo:
807 return "Echo";
808 break;
809
810 case DicomRequestType_Find:
811 return "Find";
812 break;
813
814 case DicomRequestType_Get:
815 return "Get";
816 break;
817
818 case DicomRequestType_Move:
819 return "Move";
820 break;
821
822 case DicomRequestType_Store:
823 return "Store";
824 break;
825
826 default:
827 throw OrthancException(ErrorCode_ParameterOutOfRange);
828 }
829 }
830
831
832 const char* EnumerationToString(TransferSyntax syntax)
833 {
834 switch (syntax)
835 {
836 case TransferSyntax_Deflated:
837 return "Deflated";
838
839 case TransferSyntax_Jpeg:
840 return "JPEG";
841
842 case TransferSyntax_Jpeg2000:
843 return "JPEG2000";
844
845 case TransferSyntax_JpegLossless:
846 return "JPEG Lossless";
847
848 case TransferSyntax_Jpip:
849 return "JPIP";
850
851 case TransferSyntax_Mpeg2:
852 return "MPEG2";
853
854 case TransferSyntax_Rle:
855 return "RLE";
856
857 default:
858 throw OrthancException(ErrorCode_ParameterOutOfRange);
859 }
860 }
861
862
863 const char* EnumerationToString(DicomVersion version)
864 {
865 switch (version)
866 {
867 case DicomVersion_2008:
868 return "2008";
869 break;
870
871 case DicomVersion_2017c:
872 return "2017c";
873 break;
874
875 default:
876 throw OrthancException(ErrorCode_ParameterOutOfRange);
877 }
878 }
879
880
881 Encoding StringToEncoding(const char* encoding)
882 {
883 std::string s(encoding);
884 Toolbox::ToUpperCase(s);
885
886 if (s == "UTF8")
887 {
888 return Encoding_Utf8;
889 }
890
891 if (s == "ASCII")
892 {
893 return Encoding_Ascii;
894 }
895
896 if (s == "LATIN1")
897 {
898 return Encoding_Latin1;
899 }
900
901 if (s == "LATIN2")
902 {
903 return Encoding_Latin2;
904 }
905
906 if (s == "LATIN3")
907 {
908 return Encoding_Latin3;
909 }
910
911 if (s == "LATIN4")
912 {
913 return Encoding_Latin4;
914 }
915
916 if (s == "LATIN5")
917 {
918 return Encoding_Latin5;
919 }
920
921 if (s == "CYRILLIC")
922 {
923 return Encoding_Cyrillic;
924 }
925
926 if (s == "WINDOWS1251")
927 {
928 return Encoding_Windows1251;
929 }
930
931 if (s == "ARABIC")
932 {
933 return Encoding_Arabic;
934 }
935
936 if (s == "GREEK")
937 {
938 return Encoding_Greek;
939 }
940
941 if (s == "HEBREW")
942 {
943 return Encoding_Hebrew;
944 }
945
946 if (s == "THAI")
947 {
948 return Encoding_Thai;
949 }
950
951 if (s == "JAPANESE")
952 {
953 return Encoding_Japanese;
954 }
955
956 if (s == "CHINESE")
957 {
958 return Encoding_Chinese;
959 }
960
961 throw OrthancException(ErrorCode_ParameterOutOfRange);
962 }
963
964
965 ResourceType StringToResourceType(const char* type)
966 {
967 std::string s(type);
968 Toolbox::ToUpperCase(s);
969
970 if (s == "PATIENT" || s == "PATIENTS")
971 {
972 return ResourceType_Patient;
973 }
974 else if (s == "STUDY" || s == "STUDIES")
975 {
976 return ResourceType_Study;
977 }
978 else if (s == "SERIES")
979 {
980 return ResourceType_Series;
981 }
982 else if (s == "INSTANCE" || s == "IMAGE" ||
983 s == "INSTANCES" || s == "IMAGES")
984 {
985 return ResourceType_Instance;
986 }
987
988 throw OrthancException(ErrorCode_ParameterOutOfRange);
989 }
990
991
992 ImageFormat StringToImageFormat(const char* format)
993 {
994 std::string s(format);
995 Toolbox::ToUpperCase(s);
996
997 if (s == "PNG")
998 {
999 return ImageFormat_Png;
1000 }
1001
1002 throw OrthancException(ErrorCode_ParameterOutOfRange);
1003 }
1004
1005
1006 LogLevel StringToLogLevel(const char *level)
1007 {
1008 if (strcmp(level, "ERROR") == 0)
1009 {
1010 return LogLevel_Error;
1011 }
1012 else if (strcmp(level, "WARNING") == 0)
1013 {
1014 return LogLevel_Warning;
1015 }
1016 else if (strcmp(level, "INFO") == 0)
1017 {
1018 return LogLevel_Info;
1019 }
1020 else if (strcmp(level, "TRACE") == 0)
1021 {
1022 return LogLevel_Trace;
1023 }
1024 else
1025 {
1026 throw OrthancException(ErrorCode_InternalError);
1027 }
1028 }
1029
1030
1031 ValueRepresentation StringToValueRepresentation(const std::string& vr,
1032 bool throwIfUnsupported)
1033 {
1034 if (vr == "AE")
1035 {
1036 return ValueRepresentation_ApplicationEntity;
1037 }
1038 else if (vr == "AS")
1039 {
1040 return ValueRepresentation_AgeString;
1041 }
1042 else if (vr == "AT")
1043 {
1044 return ValueRepresentation_AttributeTag;
1045 }
1046 else if (vr == "CS")
1047 {
1048 return ValueRepresentation_CodeString;
1049 }
1050 else if (vr == "DA")
1051 {
1052 return ValueRepresentation_Date;
1053 }
1054 else if (vr == "DS")
1055 {
1056 return ValueRepresentation_DecimalString;
1057 }
1058 else if (vr == "DT")
1059 {
1060 return ValueRepresentation_DateTime;
1061 }
1062 else if (vr == "FL")
1063 {
1064 return ValueRepresentation_FloatingPointSingle;
1065 }
1066 else if (vr == "FD")
1067 {
1068 return ValueRepresentation_FloatingPointDouble;
1069 }
1070 else if (vr == "IS")
1071 {
1072 return ValueRepresentation_IntegerString;
1073 }
1074 else if (vr == "LO")
1075 {
1076 return ValueRepresentation_LongString;
1077 }
1078 else if (vr == "LT")
1079 {
1080 return ValueRepresentation_LongText;
1081 }
1082 else if (vr == "OB")
1083 {
1084 return ValueRepresentation_OtherByte;
1085 }
1086 else if (vr == "OD")
1087 {
1088 return ValueRepresentation_OtherDouble;
1089 }
1090 else if (vr == "OF")
1091 {
1092 return ValueRepresentation_OtherFloat;
1093 }
1094 else if (vr == "OL")
1095 {
1096 return ValueRepresentation_OtherLong;
1097 }
1098 else if (vr == "OW")
1099 {
1100 return ValueRepresentation_OtherWord;
1101 }
1102 else if (vr == "PN")
1103 {
1104 return ValueRepresentation_PersonName;
1105 }
1106 else if (vr == "SH")
1107 {
1108 return ValueRepresentation_ShortString;
1109 }
1110 else if (vr == "SL")
1111 {
1112 return ValueRepresentation_SignedLong;
1113 }
1114 else if (vr == "SQ")
1115 {
1116 return ValueRepresentation_Sequence;
1117 }
1118 else if (vr == "SS")
1119 {
1120 return ValueRepresentation_SignedShort;
1121 }
1122 else if (vr == "ST")
1123 {
1124 return ValueRepresentation_ShortText;
1125 }
1126 else if (vr == "TM")
1127 {
1128 return ValueRepresentation_Time;
1129 }
1130 else if (vr == "UC")
1131 {
1132 return ValueRepresentation_UnlimitedCharacters;
1133 }
1134 else if (vr == "UI")
1135 {
1136 return ValueRepresentation_UniqueIdentifier;
1137 }
1138 else if (vr == "UL")
1139 {
1140 return ValueRepresentation_UnsignedLong;
1141 }
1142 else if (vr == "UN")
1143 {
1144 return ValueRepresentation_Unknown;
1145 }
1146 else if (vr == "UR")
1147 {
1148 return ValueRepresentation_UniversalResource;
1149 }
1150 else if (vr == "US")
1151 {
1152 return ValueRepresentation_UnsignedShort;
1153 }
1154 else if (vr == "UT")
1155 {
1156 return ValueRepresentation_UnlimitedText;
1157 }
1158 else
1159 {
1160 std::string s = "Unsupported value representation encountered: " + vr;
1161
1162 if (throwIfUnsupported)
1163 {
1164 LOG(ERROR) << s;
1165 throw OrthancException(ErrorCode_ParameterOutOfRange);
1166 }
1167 else
1168 {
1169 LOG(INFO) << s;
1170 return ValueRepresentation_NotSupported;
1171 }
1172 }
1173 }
1174
1175
1176 PhotometricInterpretation StringToPhotometricInterpretation(const char* value)
1177 {
1178 // http://dicom.nema.org/medical/dicom/2017a/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2
1179 std::string s(value);
1180
1181 if (s == "MONOCHROME1")
1182 {
1183 return PhotometricInterpretation_Monochrome1;
1184 }
1185
1186 if (s == "MONOCHROME2")
1187 {
1188 return PhotometricInterpretation_Monochrome2;
1189 }
1190
1191 if (s == "PALETTE COLOR")
1192 {
1193 return PhotometricInterpretation_Palette;
1194 }
1195
1196 if (s == "RGB")
1197 {
1198 return PhotometricInterpretation_RGB;
1199 }
1200
1201 if (s == "HSV")
1202 {
1203 return PhotometricInterpretation_HSV;
1204 }
1205
1206 if (s == "ARGB")
1207 {
1208 return PhotometricInterpretation_ARGB;
1209 }
1210
1211 if (s == "CMYK")
1212 {
1213 return PhotometricInterpretation_CMYK;
1214 }
1215
1216 if (s == "YBR_FULL")
1217 {
1218 return PhotometricInterpretation_YBRFull;
1219 }
1220
1221 if (s == "YBR_FULL_422")
1222 {
1223 return PhotometricInterpretation_YBRFull422;
1224 }
1225
1226 if (s == "YBR_PARTIAL_422")
1227 {
1228 return PhotometricInterpretation_YBRPartial422;
1229 }
1230
1231 if (s == "YBR_PARTIAL_420")
1232 {
1233 return PhotometricInterpretation_YBRPartial420;
1234 }
1235
1236 if (s == "YBR_ICT")
1237 {
1238 return PhotometricInterpretation_YBR_ICT;
1239 }
1240
1241 if (s == "YBR_RCT")
1242 {
1243 return PhotometricInterpretation_YBR_RCT;
1244 }
1245
1246 throw OrthancException(ErrorCode_ParameterOutOfRange);
1247 }
1248
1249
1250 ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer)
1251 {
1252 ModalityManufacturer result;
1253 bool obsolete = false;
1254
1255 if (manufacturer == "Generic")
1256 {
1257 return ModalityManufacturer_Generic;
1258 }
1259 else if (manufacturer == "GenericNoWildcardInDates")
1260 {
1261 return ModalityManufacturer_GenericNoWildcardInDates;
1262 }
1263 else if (manufacturer == "GenericNoUniversalWildcard")
1264 {
1265 return ModalityManufacturer_GenericNoUniversalWildcard;
1266 }
1267 else if (manufacturer == "ClearCanvas")
1268 {
1269 return ModalityManufacturer_ClearCanvas;
1270 }
1271 else if (manufacturer == "StoreScp")
1272 {
1273 return ModalityManufacturer_StoreScp;
1274 }
1275 else if (manufacturer == "Dcm4Chee")
1276 {
1277 return ModalityManufacturer_Dcm4Chee;
1278 }
1279 else if (manufacturer == "Vitrea")
1280 {
1281 return ModalityManufacturer_Vitrea;
1282 }
1283 else if (manufacturer == "AgfaImpax" ||
1284 manufacturer == "SyngoVia")
1285 {
1286 result = ModalityManufacturer_GenericNoWildcardInDates;
1287 obsolete = true;
1288 }
1289 else if (manufacturer == "EFilm2" ||
1290 manufacturer == "MedInria")
1291 {
1292 result = ModalityManufacturer_Generic;
1293 obsolete = true;
1294 }
1295 else
1296 {
1297 throw OrthancException(ErrorCode_ParameterOutOfRange);
1298 }
1299
1300 if (obsolete)
1301 {
1302 LOG(WARNING) << "The \"" << manufacturer << "\" manufacturer is obsolete since "
1303 << "Orthanc 1.3.0. To guarantee compatibility with future Orthanc "
1304 << "releases, you should replace it by \""
1305 << EnumerationToString(result)
1306 << "\" in your configuration file.";
1307 }
1308
1309 return result;
1310 }
1311
1312
1313 DicomVersion StringToDicomVersion(const std::string& version)
1314 {
1315 if (version == "2008")
1316 {
1317 return DicomVersion_2008;
1318 }
1319 else if (version == "2017c")
1320 {
1321 return DicomVersion_2017c;
1322 }
1323 else
1324 {
1325 throw OrthancException(ErrorCode_ParameterOutOfRange);
1326 }
1327 }
1328
1329
1330 unsigned int GetBytesPerPixel(PixelFormat format)
1331 {
1332 switch (format)
1333 {
1334 case PixelFormat_Grayscale8:
1335 return 1;
1336
1337 case PixelFormat_Grayscale16:
1338 case PixelFormat_SignedGrayscale16:
1339 return 2;
1340
1341 case PixelFormat_RGB24:
1342 return 3;
1343
1344 case PixelFormat_RGBA32:
1345 case PixelFormat_BGRA32:
1346 case PixelFormat_Grayscale32:
1347 return 4;
1348
1349 case PixelFormat_Float32:
1350 assert(sizeof(float) == 4);
1351 return 4;
1352
1353 case PixelFormat_RGB48:
1354 return 6;
1355
1356 default:
1357 throw OrthancException(ErrorCode_ParameterOutOfRange);
1358 }
1359 }
1360
1361
1362 bool GetDicomEncoding(Encoding& encoding,
1363 const char* specificCharacterSet)
1364 {
1365 std::string s = Toolbox::StripSpaces(specificCharacterSet);
1366 Toolbox::ToUpperCase(s);
1367
1368 // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2
1369 // https://github.com/dcm4che/dcm4che/blob/master/dcm4che-core/src/main/java/org/dcm4che3/data/SpecificCharacterSet.java
1370 if (s == "ISO_IR 6" ||
1371 s == "ISO 2022 IR 6")
1372 {
1373 encoding = Encoding_Ascii;
1374 }
1375 else if (s == "ISO_IR 192")
1376 {
1377 encoding = Encoding_Utf8;
1378 }
1379 else if (s == "ISO_IR 100" ||
1380 s == "ISO 2022 IR 100")
1381 {
1382 encoding = Encoding_Latin1;
1383 }
1384 else if (s == "ISO_IR 101" ||
1385 s == "ISO 2022 IR 101")
1386 {
1387 encoding = Encoding_Latin2;
1388 }
1389 else if (s == "ISO_IR 109" ||
1390 s == "ISO 2022 IR 109")
1391 {
1392 encoding = Encoding_Latin3;
1393 }
1394 else if (s == "ISO_IR 110" ||
1395 s == "ISO 2022 IR 110")
1396 {
1397 encoding = Encoding_Latin4;
1398 }
1399 else if (s == "ISO_IR 148" ||
1400 s == "ISO 2022 IR 148")
1401 {
1402 encoding = Encoding_Latin5;
1403 }
1404 else if (s == "ISO_IR 144" ||
1405 s == "ISO 2022 IR 144")
1406 {
1407 encoding = Encoding_Cyrillic;
1408 }
1409 else if (s == "ISO_IR 127" ||
1410 s == "ISO 2022 IR 127")
1411 {
1412 encoding = Encoding_Arabic;
1413 }
1414 else if (s == "ISO_IR 126" ||
1415 s == "ISO 2022 IR 126")
1416 {
1417 encoding = Encoding_Greek;
1418 }
1419 else if (s == "ISO_IR 138" ||
1420 s == "ISO 2022 IR 138")
1421 {
1422 encoding = Encoding_Hebrew;
1423 }
1424 else if (s == "ISO_IR 166" || s == "ISO 2022 IR 166")
1425 {
1426 encoding = Encoding_Thai;
1427 }
1428 else if (s == "ISO_IR 13" || s == "ISO 2022 IR 13")
1429 {
1430 encoding = Encoding_Japanese;
1431 }
1432 else if (s == "GB18030" || s == "GBK")
1433 {
1434 /**
1435 * According to tumashu@163.com, "In China, many dicom file's
1436 * 0008,0005 tag is set as "GBK", instead of "GB18030", GBK is a
1437 * subset of GB18030, and which is used frequently in China,
1438 * suggest support it."
1439 * https://groups.google.com/d/msg/orthanc-users/WMM8LMbjpUc/02-1f_yFCgAJ
1440 **/
1441 encoding = Encoding_Chinese;
1442 }
1443 /*
1444 else if (s == "ISO 2022 IR 149")
1445 {
1446 TODO
1447 }
1448 else if (s == "ISO 2022 IR 159")
1449 {
1450 TODO
1451 }
1452 else if (s == "ISO 2022 IR 87")
1453 {
1454 TODO
1455 }
1456 */
1457 else
1458 {
1459 return false;
1460 }
1461
1462 // The encoding was properly detected
1463 return true;
1464 }
1465
1466
1467 ResourceType GetChildResourceType(ResourceType type)
1468 {
1469 switch (type)
1470 {
1471 case ResourceType_Patient:
1472 return ResourceType_Study;
1473
1474 case ResourceType_Study:
1475 return ResourceType_Series;
1476
1477 case ResourceType_Series:
1478 return ResourceType_Instance;
1479
1480 default:
1481 throw OrthancException(ErrorCode_ParameterOutOfRange);
1482 }
1483 }
1484
1485
1486 ResourceType GetParentResourceType(ResourceType type)
1487 {
1488 switch (type)
1489 {
1490 case ResourceType_Study:
1491 return ResourceType_Patient;
1492
1493 case ResourceType_Series:
1494 return ResourceType_Study;
1495
1496 case ResourceType_Instance:
1497 return ResourceType_Series;
1498
1499 default:
1500 throw OrthancException(ErrorCode_ParameterOutOfRange);
1501 }
1502 }
1503
1504
1505 DicomModule GetModule(ResourceType type)
1506 {
1507 switch (type)
1508 {
1509 case ResourceType_Patient:
1510 return DicomModule_Patient;
1511
1512 case ResourceType_Study:
1513 return DicomModule_Study;
1514
1515 case ResourceType_Series:
1516 return DicomModule_Series;
1517
1518 default:
1519 throw OrthancException(ErrorCode_ParameterOutOfRange);
1520 }
1521 }
1522
1523
1524
1525 const char* GetDicomSpecificCharacterSet(Encoding encoding)
1526 {
1527 // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2
1528 switch (encoding)
1529 {
1530 case Encoding_Ascii:
1531 return "ISO_IR 6";
1532
1533 case Encoding_Utf8:
1534 return "ISO_IR 192";
1535
1536 case Encoding_Latin1:
1537 return "ISO_IR 100";
1538
1539 case Encoding_Latin2:
1540 return "ISO_IR 101";
1541
1542 case Encoding_Latin3:
1543 return "ISO_IR 109";
1544
1545 case Encoding_Latin4:
1546 return "ISO_IR 110";
1547
1548 case Encoding_Latin5:
1549 return "ISO_IR 148";
1550
1551 case Encoding_Cyrillic:
1552 return "ISO_IR 144";
1553
1554 case Encoding_Arabic:
1555 return "ISO_IR 127";
1556
1557 case Encoding_Greek:
1558 return "ISO_IR 126";
1559
1560 case Encoding_Hebrew:
1561 return "ISO_IR 138";
1562
1563 case Encoding_Japanese:
1564 return "ISO_IR 13";
1565
1566 case Encoding_Chinese:
1567 return "GB18030";
1568
1569 case Encoding_Thai:
1570 return "ISO_IR 166";
1571
1572 default:
1573 throw OrthancException(ErrorCode_ParameterOutOfRange);
1574 }
1575 }
1576
1577
1578 // This function is autogenerated by the script
1579 // "Resources/GenerateErrorCodes.py"
1580 HttpStatus ConvertErrorCodeToHttpStatus(ErrorCode error)
1581 {
1582 switch (error)
1583 {
1584 case ErrorCode_Success:
1585 return HttpStatus_200_Ok;
1586
1587 case ErrorCode_ParameterOutOfRange:
1588 return HttpStatus_400_BadRequest;
1589
1590 case ErrorCode_BadParameterType:
1591 return HttpStatus_400_BadRequest;
1592
1593 case ErrorCode_InexistentItem:
1594 return HttpStatus_404_NotFound;
1595
1596 case ErrorCode_BadRequest:
1597 return HttpStatus_400_BadRequest;
1598
1599 case ErrorCode_UriSyntax:
1600 return HttpStatus_400_BadRequest;
1601
1602 case ErrorCode_InexistentFile:
1603 return HttpStatus_404_NotFound;
1604
1605 case ErrorCode_BadFileFormat:
1606 return HttpStatus_400_BadRequest;
1607
1608 case ErrorCode_UnknownResource:
1609 return HttpStatus_404_NotFound;
1610
1611 case ErrorCode_InexistentTag:
1612 return HttpStatus_404_NotFound;
1613
1614 case ErrorCode_BadJson:
1615 return HttpStatus_400_BadRequest;
1616
1617 case ErrorCode_Unauthorized:
1618 return HttpStatus_401_Unauthorized;
1619
1620 case ErrorCode_NotAcceptable:
1621 return HttpStatus_406_NotAcceptable;
1622
1623 case ErrorCode_DatabaseUnavailable:
1624 return HttpStatus_503_ServiceUnavailable;
1625
1626 default:
1627 return HttpStatus_500_InternalServerError;
1628 }
1629 }
1630
1631
1632 bool IsUserContentType(FileContentType type)
1633 {
1634 return (type >= FileContentType_StartUser &&
1635 type <= FileContentType_EndUser);
1636 }
1637
1638
1639 bool IsBinaryValueRepresentation(ValueRepresentation vr)
1640 {
1641 // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html
1642
1643 switch (vr)
1644 {
1645 case ValueRepresentation_ApplicationEntity: // AE
1646 case ValueRepresentation_AgeString: // AS
1647 case ValueRepresentation_CodeString: // CS
1648 case ValueRepresentation_Date: // DA
1649 case ValueRepresentation_DecimalString: // DS
1650 case ValueRepresentation_DateTime: // DT
1651 case ValueRepresentation_IntegerString: // IS
1652 case ValueRepresentation_LongString: // LO
1653 case ValueRepresentation_LongText: // LT
1654 case ValueRepresentation_PersonName: // PN
1655 case ValueRepresentation_ShortString: // SH
1656 case ValueRepresentation_ShortText: // ST
1657 case ValueRepresentation_Time: // TM
1658 case ValueRepresentation_UnlimitedCharacters: // UC
1659 case ValueRepresentation_UniqueIdentifier: // UI (UID)
1660 case ValueRepresentation_UniversalResource: // UR (URI or URL)
1661 case ValueRepresentation_UnlimitedText: // UT
1662 {
1663 return false;
1664 }
1665
1666 /**
1667 * Below are all the VR whose character repertoire is tagged as
1668 * "not applicable"
1669 **/
1670 case ValueRepresentation_AttributeTag: // AT (2 x uint16_t)
1671 case ValueRepresentation_FloatingPointSingle: // FL (float)
1672 case ValueRepresentation_FloatingPointDouble: // FD (double)
1673 case ValueRepresentation_OtherByte: // OB
1674 case ValueRepresentation_OtherDouble: // OD
1675 case ValueRepresentation_OtherFloat: // OF
1676 case ValueRepresentation_OtherLong: // OL
1677 case ValueRepresentation_OtherWord: // OW
1678 case ValueRepresentation_SignedLong: // SL (int32_t)
1679 case ValueRepresentation_Sequence: // SQ
1680 case ValueRepresentation_SignedShort: // SS (int16_t)
1681 case ValueRepresentation_UnsignedLong: // UL (uint32_t)
1682 case ValueRepresentation_Unknown: // UN
1683 case ValueRepresentation_UnsignedShort: // US (uint16_t)
1684 {
1685 return true;
1686 }
1687
1688 case ValueRepresentation_NotSupported:
1689 default:
1690 throw OrthancException(ErrorCode_ParameterOutOfRange);
1691 }
1692 }
1693
1694
1695 static boost::mutex defaultEncodingMutex_; // Should not be necessary
1696 static Encoding defaultEncoding_ = ORTHANC_DEFAULT_DICOM_ENCODING;
1697
1698 Encoding GetDefaultDicomEncoding()
1699 {
1700 boost::mutex::scoped_lock lock(defaultEncodingMutex_);
1701 return defaultEncoding_;
1702 }
1703
1704 void SetDefaultDicomEncoding(Encoding encoding)
1705 {
1706 std::string name = EnumerationToString(encoding);
1707
1708 {
1709 boost::mutex::scoped_lock lock(defaultEncodingMutex_);
1710 defaultEncoding_ = encoding;
1711 }
1712
1713 LOG(INFO) << "Default encoding for DICOM was changed to: " << name;
1714 }
1715
1716 }