comparison OrthancStone/Sources/Loaders/DicomSource.h @ 1512:244ad1e4e76a

reorganization of folders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 16:21:02 +0200
parents Framework/Loaders/DicomSource.h@9cbc6d21ae89
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1511:9dfeee74c1e6 1512:244ad1e4e76a
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2020 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 Affero General Public License
9 * as published by the Free Software Foundation, either version 3 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/
20
21
22 #pragma once
23
24 #include "../Oracle/IOracleCommand.h"
25
26 #include <WebServiceParameters.h>
27
28 namespace OrthancStone
29 {
30 enum DicomSourceType
31 {
32 DicomSourceType_Orthanc,
33 DicomSourceType_DicomWeb,
34 DicomSourceType_DicomWebThroughOrthanc,
35 DicomSourceType_DicomDir
36 };
37
38
39 class DicomSource
40 {
41 private:
42 DicomSourceType type_;
43 Orthanc::WebServiceParameters webService_;
44 std::string orthancDicomWebRoot_;
45 std::string serverName_;
46 bool hasOrthancWebViewer1_;
47 bool hasOrthancAdvancedPreview_;
48 bool hasDicomWebRendered_;
49
50 public:
51 DicomSource() :
52 hasOrthancWebViewer1_(false),
53 hasOrthancAdvancedPreview_(false),
54 hasDicomWebRendered_(false)
55 {
56 SetOrthancSource();
57 }
58
59 DicomSourceType GetType() const
60 {
61 return type_;
62 }
63
64 void SetOrthancSource();
65
66 void SetOrthancSource(const Orthanc::WebServiceParameters& parameters);
67
68 const Orthanc::WebServiceParameters& GetOrthancParameters() const;
69
70 void SetDicomDirSource();
71
72 void SetDicomWebSource(const std::string& baseUrl);
73
74 void SetDicomWebSource(const std::string& baseUrl,
75 const std::string& username,
76 const std::string& password);
77
78 void SetDicomWebThroughOrthancSource(const Orthanc::WebServiceParameters& orthancParameters,
79 const std::string& dicomWebRoot,
80 const std::string& serverName);
81
82 void SetDicomWebThroughOrthancSource(const std::string& serverName);
83
84 bool IsDicomWeb() const;
85
86 bool IsOrthanc() const
87 {
88 return type_ == DicomSourceType_Orthanc;
89 }
90
91 bool IsDicomDir() const
92 {
93 return type_ == DicomSourceType_DicomDir;
94 }
95
96 IOracleCommand* CreateDicomWebCommand(const std::string& uri,
97 const std::map<std::string, std::string>& arguments,
98 const std::map<std::string, std::string>& headers,
99 Orthanc::IDynamicObject* payload /* takes ownership */) const;
100
101 IOracleCommand* CreateDicomWebCommand(const std::string& uri,
102 Orthanc::IDynamicObject* payload /* takes ownership */) const
103 {
104 std::map<std::string, std::string> none;
105 return CreateDicomWebCommand(uri, none, none, payload);
106 }
107
108 void AutodetectOrthancFeatures(const std::string& system,
109 const std::string& plugins);
110
111 void SetOrthancWebViewer1(bool hasPlugin);
112
113 bool HasOrthancWebViewer1() const;
114
115 void SetOrthancAdvancedPreview(bool hasFeature);
116
117 bool HasOrthancAdvancedPreview() const;
118
119 void SetDicomWebRendered(bool hasFeature);
120
121 bool HasDicomWebRendered() const;
122
123 unsigned int GetQualityCount() const;
124 };
125 }