Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/StoneInitialization.cpp @ 1591:5887a4f8594b
moving platform-specific files out of the "OrthancStone" folder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 23 Oct 2020 13:15:03 +0200 |
parents | 244ad1e4e76a |
children | 4fb8fdf03314 |
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 |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
5 * Copyright (C) 2017-2020 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 |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
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 |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * Affero General Public License for more details. |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 **/ |
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 #include "StoneInitialization.h" |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
24 #if !defined(ORTHANC_ENABLE_SSL) |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
25 # error Macro ORTHANC_ENABLE_SSL must be defined |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
26 #endif |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
27 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
28 #if !defined(ORTHANC_ENABLE_CURL) |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
29 # error Macro ORTHANC_ENABLE_CURL must be defined |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
30 #endif |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
31 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
32 #if !defined(ORTHANC_ENABLE_DCMTK) |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
33 # error Macro ORTHANC_ENABLE_DCMTK must be defined |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
34 # if !defined(DCMTK_VERSION_NUMBER) |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
35 # error Macro DCMTK_VERSION_NUMBER must be defined |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
36 # endif |
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 |
797
20262f5e5e88
Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents:
663
diff
changeset
|
39 #if ORTHANC_ENABLE_CURL == 1 |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
40 # include <HttpClient.h> |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
41 #endif |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
42 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
43 #if ORTHANC_ENABLE_DCMTK == 1 |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
44 # include <DicomParsing/FromDcmtkBridge.h> |
797
20262f5e5e88
Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents:
663
diff
changeset
|
45 #endif |
20262f5e5e88
Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents:
663
diff
changeset
|
46 |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
47 #include "Toolbox/LinearAlgebra.h" |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
48 |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
49 #include <Logging.h> |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
50 #include <OrthancException.h> |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
51 #include <Toolbox.h> |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
52 |
1187
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
53 #include <locale> |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
54 |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
55 |
610
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 namespace OrthancStone |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 { |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
58 void StoneInitialize(void* pluginContext) |
610
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 if (pluginContext != NULL) |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
61 { |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
62 Orthanc::Logging::InitializePluginContext(pluginContext); |
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 else |
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 Orthanc::Logging::Initialize(); |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1397
diff
changeset
|
67 } |
610
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
69 #if ORTHANC_ENABLE_SSL == 1 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
70 // Must be before curl |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
71 Orthanc::Toolbox::InitializeOpenSsl(); |
610
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 #endif |
797
20262f5e5e88
Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents:
663
diff
changeset
|
73 |
20262f5e5e88
Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents:
663
diff
changeset
|
74 #if ORTHANC_ENABLE_CURL == 1 |
20262f5e5e88
Added missing HttpClient::GlobalInitialize in StoneInitialize
Benjamin Golinvaux <bgo@osimis.io>
parents:
663
diff
changeset
|
75 Orthanc::HttpClient::GlobalInitialize(); |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
76 # if ORTHANC_ENABLE_SSL == 1 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
77 Orthanc::HttpClient::ConfigureSsl(false, ""); |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
78 # endif |
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 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
81 #if ORTHANC_ENABLE_DCMTK == 1 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
82 Orthanc::FromDcmtkBridge::InitializeDictionary(true); |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
83 Orthanc::FromDcmtkBridge::InitializeCodecs(); |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
84 # if DCMTK_VERSION_NUMBER <= 360 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
85 OFLog::configure(OFLogger::FATAL_LOG_LEVEL); |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
86 # else |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
87 OFLog::configure(OFLogger::OFF_LOG_LEVEL); |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
88 # endif |
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 |
1187
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
91 /** |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
92 * 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
|
93 * 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
|
94 * 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
|
95 * decimal separator. |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
96 * https://stackoverflow.com/a/18981514/881731 |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
97 **/ |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
98 std::locale::global(std::locale::classic()); |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
99 |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
100 { |
1187
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
101 // 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
|
102 // been initialized, as Qt changes locale settings |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
103 |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
104 { |
1187
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
105 OrthancStone::Vector v; |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
106 if (!OrthancStone::LinearAlgebra::ParseVector(v, "1.3671875\\-1.3671875") || |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
107 v.size() != 2 || |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
108 !OrthancStone::LinearAlgebra::IsNear(1.3671875f, v[0]) || |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
109 !OrthancStone::LinearAlgebra::IsNear(-1.3671875f, v[1])) |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
110 { |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
111 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
112 "Error in the locale settings, giving up"); |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
113 } |
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 Json::Value dicomweb = Json::objectValue; |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
118 dicomweb["00280030"] = Json::objectValue; |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
119 dicomweb["00280030"]["vr"] = "DS"; |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
120 dicomweb["00280030"]["Value"] = Json::arrayValue; |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
121 dicomweb["00280030"]["Value"].append(1.2f); |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
122 dicomweb["00280030"]["Value"].append(-1.5f); |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
123 |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
124 Orthanc::DicomMap source; |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
125 source.FromDicomWeb(dicomweb); |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
126 |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
127 std::string s; |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
128 OrthancStone::Vector v; |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
129 if (!source.LookupStringValue(s, Orthanc::DICOM_TAG_PIXEL_SPACING, false) || |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
130 !OrthancStone::LinearAlgebra::ParseVector(v, s) || |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
131 v.size() != 2 || |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
132 !OrthancStone::LinearAlgebra::IsNear(1.2f, v[0]) || |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
133 !OrthancStone::LinearAlgebra::IsNear(-1.5f, v[1])) |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
134 { |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
135 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
136 "Error in the locale settings, giving up"); |
092ec2a225ad
dealing with locales in Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1167
diff
changeset
|
137 } |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
138 } |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
139 } |
610
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 } |
1167
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 |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 void StoneFinalize() |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 { |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
145 #if ORTHANC_ENABLE_DCMTK == 1 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
146 Orthanc::FromDcmtkBridge::FinalizeCodecs(); |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
147 #endif |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
148 |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
797
diff
changeset
|
149 #if ORTHANC_ENABLE_CURL == 1 |
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
797
diff
changeset
|
150 Orthanc::HttpClient::GlobalFinalize(); |
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
797
diff
changeset
|
151 #endif |
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
797
diff
changeset
|
152 |
1167
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
153 #if ORTHANC_ENABLE_SSL == 1 |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
154 Orthanc::Toolbox::FinalizeOpenSsl(); |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
155 #endif |
ad4e21df4e40
enriching OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1047
diff
changeset
|
156 |
610
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 Orthanc::Logging::Finalize(); |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 } |
0c4c0693b97c
OrthancStone::StoneInitialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 } |