annotate OrthancStone/Sources/StoneInitialization.cpp @ 1739:9ac2a65d4172

upgrade to year 2021
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Jan 2021 17:50:00 +0100
parents 52b8b96cb55f
children 3889ae96d2e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1739
9ac2a65d4172 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1640
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
8 * modify it under the terms of the GNU Lesser General Public License
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1591
diff changeset
16 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * <http://www.gnu.org/licenses/>.
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "StoneInitialization.h"
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
25 #if !defined(ORTHANC_ENABLE_SSL)
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
26 # error Macro ORTHANC_ENABLE_SSL must be defined
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
27 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
28
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
29 #if !defined(ORTHANC_ENABLE_CURL)
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
30 # error Macro ORTHANC_ENABLE_CURL must be defined
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
31 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
32
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
33 #if !defined(ORTHANC_ENABLE_DCMTK)
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
34 # error Macro ORTHANC_ENABLE_DCMTK must be defined
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
35 # if !defined(DCMTK_VERSION_NUMBER)
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
36 # error Macro DCMTK_VERSION_NUMBER must be defined
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
37 # endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
38 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
39
797
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
40 #if ORTHANC_ENABLE_CURL == 1
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
41 # include <HttpClient.h>
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
42 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
43
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
44 #if ORTHANC_ENABLE_DCMTK == 1
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
45 # include <DicomParsing/FromDcmtkBridge.h>
797
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
46 #endif
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
47
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
48 #include "Toolbox/LinearAlgebra.h"
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
49
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
50 #include <Logging.h>
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
51 #include <OrthancException.h>
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
52 #include <Toolbox.h>
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
53
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
54 #include <locale>
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
55
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
56
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 namespace OrthancStone
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 {
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
59 void StoneInitialize(void* pluginContext)
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 {
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
61 if (pluginContext != NULL)
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
62 {
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
63 Orthanc::Logging::InitializePluginContext(pluginContext);
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
64 }
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
65 else
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
66 {
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
67 Orthanc::Logging::Initialize();
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
68 }
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
70 #if ORTHANC_ENABLE_SSL == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
71 // Must be before curl
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
72 Orthanc::Toolbox::InitializeOpenSsl();
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 #endif
797
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
74
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
75 #if ORTHANC_ENABLE_CURL == 1
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
76 Orthanc::HttpClient::GlobalInitialize();
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
77 # if ORTHANC_ENABLE_SSL == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
78 Orthanc::HttpClient::ConfigureSsl(false, "");
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
79 # endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
80 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
81
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
82 #if ORTHANC_ENABLE_DCMTK == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
83 Orthanc::FromDcmtkBridge::InitializeDictionary(true);
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
84 Orthanc::FromDcmtkBridge::InitializeCodecs();
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
85 # if DCMTK_VERSION_NUMBER <= 360
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
86 OFLog::configure(OFLogger::FATAL_LOG_LEVEL);
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
87 # else
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
88 OFLog::configure(OFLogger::OFF_LOG_LEVEL);
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
89 # endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
90 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
91
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
92 /**
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
93 * This call is necessary to make "boost::lexical_cast<>" work in
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
94 * a consistent way in the presence of "double" or "float", and of
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
95 * a numeric locale that replaces dot (".") by comma (",") as the
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
96 * decimal separator.
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
97 * https://stackoverflow.com/a/18981514/881731
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
98 **/
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
99 std::locale::global(std::locale::classic());
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
100
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
101 {
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
102 // Run-time checks of locale settings, to be run after Qt has
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
103 // been initialized, as Qt changes locale settings
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
104
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
105 {
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
106 Vector v;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
107 if (!LinearAlgebra::ParseVector(v, "1.3671875\\-1.3671875") ||
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
108 v.size() != 2 ||
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
109 !LinearAlgebra::IsNear(1.3671875f, v[0]) ||
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
110 !LinearAlgebra::IsNear(-1.3671875f, v[1]))
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
111 {
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
112 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
113 "Error in the locale settings, giving up");
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
114 }
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
115 }
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
116
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
117 {
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
118 Json::Value dicomweb = Json::objectValue;
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
119 dicomweb["00280030"] = Json::objectValue;
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
120 dicomweb["00280030"]["vr"] = "DS";
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
121 dicomweb["00280030"]["Value"] = Json::arrayValue;
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
122 dicomweb["00280030"]["Value"].append(1.2f);
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
123 dicomweb["00280030"]["Value"].append(-1.5f);
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
124
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
125 Orthanc::DicomMap source;
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
126 source.FromDicomWeb(dicomweb);
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
127
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
128 std::string s;
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
129 Vector v;
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
130 if (!source.LookupStringValue(s, Orthanc::DICOM_TAG_PIXEL_SPACING, false) ||
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
131 !LinearAlgebra::ParseVector(v, s) ||
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
132 v.size() != 2 ||
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
133 !LinearAlgebra::IsNear(1.2f, v[0]) ||
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
134 !LinearAlgebra::IsNear(-1.5f, v[1]))
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
135 {
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
136 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
137 "Error in the locale settings, giving up");
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
138 }
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
139 }
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
140 }
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 }
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
142
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 void StoneFinalize()
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 {
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
146 #if ORTHANC_ENABLE_DCMTK == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
147 Orthanc::FromDcmtkBridge::FinalizeCodecs();
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
148 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
149
804
61ba4b504e9a PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 797
diff changeset
150 #if ORTHANC_ENABLE_CURL == 1
61ba4b504e9a PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 797
diff changeset
151 Orthanc::HttpClient::GlobalFinalize();
61ba4b504e9a PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 797
diff changeset
152 #endif
61ba4b504e9a PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 797
diff changeset
153
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
154 #if ORTHANC_ENABLE_SSL == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
155 Orthanc::Toolbox::FinalizeOpenSsl();
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
156 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
157
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 Orthanc::Logging::Finalize();
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 }
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 }