comparison Framework/Loaders/DicomSource.h @ 1228:c471a0aa137b broker

adding the next generation of loaders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 09 Dec 2019 13:58:37 +0100
parents
children 0ca50d275b9a
comparison
equal deleted inserted replaced
1227:a1c0c9c9f9af 1228:c471a0aa137b
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-2019 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 <Core/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 void AutodetectOrthancFeatures(const std::string& system,
102 const std::string& plugins);
103
104 void SetOrthancWebViewer1(bool hasPlugin);
105
106 bool HasOrthancWebViewer1() const;
107
108 void SetOrthancAdvancedPreview(bool hasFeature);
109
110 bool HasOrthancAdvancedPreview() const;
111
112 void SetDicomWebRendered(bool hasFeature);
113
114 bool HasDicomWebRendered() const;
115
116 unsigned int GetQualityCount() const;
117 };
118 }