annotate OrthancStone/Sources/StoneInitialization.cpp @ 1882:4e80b8afd0da

numpy in rendering plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Jan 2022 18:02:24 +0100
parents 7053b8a0aaec
children 07964689cb0b
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
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * 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
9 * 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
10 * as published by the Free Software Foundation, either version 3 of
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * 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
14 * 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
15 * 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
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1591
diff changeset
17 *
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
18 * 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
19 * 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
20 * <http://www.gnu.org/licenses/>.
610
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
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "StoneInitialization.h"
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
26 #if !defined(ORTHANC_ENABLE_SSL)
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
27 # error Macro ORTHANC_ENABLE_SSL must be defined
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
28 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
29
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
30 #if !defined(ORTHANC_ENABLE_CURL)
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
31 # error Macro ORTHANC_ENABLE_CURL must be defined
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
32 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
33
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
34 #if !defined(ORTHANC_ENABLE_DCMTK)
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
35 # error Macro ORTHANC_ENABLE_DCMTK must be defined
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
36 # if !defined(DCMTK_VERSION_NUMBER)
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
37 # error Macro DCMTK_VERSION_NUMBER must be defined
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 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
40
797
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
41 #if ORTHANC_ENABLE_CURL == 1
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
42 # include <HttpClient.h>
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
43 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
44
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
45 #if ORTHANC_ENABLE_DCMTK == 1
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
46 # include <DicomParsing/FromDcmtkBridge.h>
797
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
47 #endif
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
48
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
49 #include "Toolbox/LinearAlgebra.h"
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
50
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
51 #include <Logging.h>
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
52 #include <OrthancException.h>
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
53 #include <Toolbox.h>
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
54
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
55 #include <locale>
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
56
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
57
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 namespace OrthancStone
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 {
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
60 void StoneInitialize(void* pluginContext)
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 {
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
62 if (pluginContext != NULL)
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
63 {
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
64 Orthanc::Logging::InitializePluginContext(pluginContext);
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
65 }
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
66 else
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
67 {
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
68 Orthanc::Logging::Initialize();
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1397
diff changeset
69 }
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
71 #if ORTHANC_ENABLE_SSL == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
72 // Must be before curl
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
73 Orthanc::Toolbox::InitializeOpenSsl();
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 #endif
797
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
75
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
76 #if ORTHANC_ENABLE_CURL == 1
20262f5e5e88 Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents: 663
diff changeset
77 Orthanc::HttpClient::GlobalInitialize();
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
78 # if ORTHANC_ENABLE_SSL == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
79 Orthanc::HttpClient::ConfigureSsl(false, "");
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 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
82
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
83 #if ORTHANC_ENABLE_DCMTK == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
84 Orthanc::FromDcmtkBridge::InitializeDictionary(true);
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
85 Orthanc::FromDcmtkBridge::InitializeCodecs();
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
86 # if DCMTK_VERSION_NUMBER <= 360
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
87 OFLog::configure(OFLogger::FATAL_LOG_LEVEL);
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
88 # else
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
89 OFLog::configure(OFLogger::OFF_LOG_LEVEL);
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 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
92
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
93 /**
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
94 * 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
95 * 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
96 * 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
97 * decimal separator.
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
98 * https://stackoverflow.com/a/18981514/881731
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
99 **/
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
100 std::locale::global(std::locale::classic());
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
101
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
102 {
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
103 // 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
104 // been initialized, as Qt changes locale settings
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
105
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
106 {
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
107 Vector v;
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
108 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
109 v.size() != 2 ||
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
110 !LinearAlgebra::IsNear(1.3671875f, v[0]) ||
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
111 !LinearAlgebra::IsNear(-1.3671875f, v[1]))
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
112 {
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
113 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
114 "Error in the locale settings, giving up");
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 {
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
119 Json::Value dicomweb = Json::objectValue;
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
120 dicomweb["00280030"] = Json::objectValue;
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
121 dicomweb["00280030"]["vr"] = "DS";
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
122 dicomweb["00280030"]["Value"] = Json::arrayValue;
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
123 dicomweb["00280030"]["Value"].append(1.2f);
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
124 dicomweb["00280030"]["Value"].append(-1.5f);
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
125
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
126 Orthanc::DicomMap source;
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
127 source.FromDicomWeb(dicomweb);
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
128
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
129 std::string s;
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
130 Vector v;
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
131 if (!source.LookupStringValue(s, Orthanc::DICOM_TAG_PIXEL_SPACING, false) ||
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
132 !LinearAlgebra::ParseVector(v, s) ||
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
133 v.size() != 2 ||
1640
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
134 !LinearAlgebra::IsNear(1.2f, v[0]) ||
52b8b96cb55f cleaning namespaces
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
135 !LinearAlgebra::IsNear(-1.5f, v[1]))
1187
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
136 {
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
137 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
138 "Error in the locale settings, giving up");
092ec2a225ad dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1167
diff changeset
139 }
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
140 }
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
141 }
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 }
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
143
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 void StoneFinalize()
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 {
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
147 #if ORTHANC_ENABLE_DCMTK == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
148 Orthanc::FromDcmtkBridge::FinalizeCodecs();
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
149 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
150
804
61ba4b504e9a PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 797
diff changeset
151 #if ORTHANC_ENABLE_CURL == 1
61ba4b504e9a PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 797
diff changeset
152 Orthanc::HttpClient::GlobalFinalize();
61ba4b504e9a PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 797
diff changeset
153 #endif
61ba4b504e9a PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 797
diff changeset
154
1167
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
155 #if ORTHANC_ENABLE_SSL == 1
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
156 Orthanc::Toolbox::FinalizeOpenSsl();
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
157 #endif
ad4e21df4e40 enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1047
diff changeset
158
610
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 Orthanc::Logging::Finalize();
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 }
0c4c0693b97c OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 }