comparison Framework/DicomizerParameters.h @ 0:4a7a53257c7d

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 22 Oct 2016 21:48:33 +0200
parents
children 7a3853d51c45
comparison
equal deleted inserted replaced
-1:000000000000 0:4a7a53257c7d
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 *
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public License
8 * as published by the Free Software Foundation, either version 3 of
9 * the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 **/
19
20
21 #pragma once
22
23 #include "Inputs/ITiledPyramid.h"
24 #include "Outputs/IPyramidWriter.h"
25 #include "Messaging/IFileTarget.h"
26 #include "DicomToolbox.h"
27 #include "Orthanc/Core/WebServiceParameters.h"
28
29 #include <stdint.h>
30
31 namespace OrthancWSI
32 {
33 class DicomizerParameters
34 {
35 private:
36 bool safetyCheck_;
37 bool repaintBackground_;
38 uint8_t backgroundColor_[3];
39 ImageCompression targetCompression_;
40 bool hasTargetTileSize_;
41 unsigned int targetTileWidth_;
42 unsigned int targetTileHeight_;
43 unsigned int threadsCount_;
44 unsigned int maxDicomFileSize_;
45 bool reconstructPyramid_;
46 unsigned int pyramidLevelsCount_; // "0" means use default choice
47 unsigned int pyramidLowerLevelsCount_; // "0" means use default choice
48 bool smooth_;
49 std::string inputFile_;
50 uint8_t jpegQuality_;
51 bool forceReencode_;
52 std::string folder_;
53 std::string folderPattern_;
54 std::string dataset_;
55 OpticalPath opticalPath_;
56 std::string iccProfile_;
57
58 Orthanc::WebServiceParameters orthanc_;
59
60 public:
61 DicomizerParameters();
62
63 void SetSafetyCheck(bool safety)
64 {
65 safetyCheck_ = safety;
66 }
67
68 bool IsSafetyCheck() const
69 {
70 return safetyCheck_;
71 }
72
73 bool IsRepaintBackground() const
74 {
75 return repaintBackground_;
76 }
77
78 void SetRepaintBackground(bool repaint)
79 {
80 repaintBackground_ = repaint;
81 }
82
83 void SetBackgroundColor(uint8_t red,
84 uint8_t green,
85 uint8_t blue);
86
87 uint8_t GetBackgroundColorRed() const
88 {
89 return backgroundColor_[0];
90 }
91
92 uint8_t GetBackgroundColorGreen() const
93 {
94 return backgroundColor_[1];
95 }
96
97 uint8_t GetBackgroundColorBlue() const
98 {
99 return backgroundColor_[2];
100 }
101
102 void SetTargetCompression(ImageCompression compression)
103 {
104 targetCompression_ = compression;
105 }
106
107 ImageCompression GetTargetCompression() const
108 {
109 return targetCompression_;
110 }
111
112 void SetTargetTileSize(unsigned int width,
113 unsigned int height);
114
115 unsigned int GetTargetTileWidth(unsigned int defaultWidth) const;
116
117 unsigned int GetTargetTileWidth(const ITiledPyramid& source) const
118 {
119 return GetTargetTileWidth(source.GetTileWidth());
120 }
121
122 unsigned int GetTargetTileHeight(unsigned int defaultHeight) const;
123
124 unsigned int GetTargetTileHeight(const ITiledPyramid& source) const
125 {
126 return GetTargetTileHeight(source.GetTileHeight());
127 }
128
129 void SetThreadsCount(unsigned int threads);
130
131 unsigned int GetThreadsCount() const
132 {
133 return threadsCount_;
134 }
135
136 void SetDicomMaxFileSize(unsigned int size);
137
138 unsigned int GetDicomMaxFileSize() const
139 {
140 return maxDicomFileSize_;
141 }
142
143 bool IsReconstructPyramid() const
144 {
145 return reconstructPyramid_;
146 }
147
148 void SetReconstructPyramid(bool reconstruct)
149 {
150 reconstructPyramid_ = reconstruct;
151 }
152
153 void SetPyramidLevelsCount(unsigned int count);
154
155 unsigned int GetPyramidLevelsCount(const IPyramidWriter& target,
156 const ITiledPyramid& source) const;
157
158 void SetPyramidLowerLevelsCount(unsigned int count);
159
160 unsigned int GetPyramidLowerLevelsCount(const IPyramidWriter& target,
161 const ITiledPyramid& source) const;
162
163 void SetSmoothEnabled(bool smooth)
164 {
165 smooth_ = smooth;
166 }
167
168 bool IsSmoothEnabled() const
169 {
170 return smooth_;
171 }
172
173 void SetInputFile(const std::string& path)
174 {
175 inputFile_ = path;
176 }
177
178 const std::string& GetInputFile() const
179 {
180 return inputFile_;
181 }
182
183 void SetJpegQuality(int quality);
184
185 uint8_t GetJpegQuality() const
186 {
187 return jpegQuality_;
188 }
189
190 void SetForceReencode(bool force)
191 {
192 forceReencode_ = force;
193 }
194
195 bool IsForceReencode() const
196 {
197 return forceReencode_;
198 }
199
200 void SetTargetFolder(const std::string& folder)
201 {
202 folder_ = folder;
203 }
204
205 const std::string& GetTargetFolderPattern() const
206 {
207 return folderPattern_;
208 }
209
210 void SetTargetFolderPattern(const std::string& pattern)
211 {
212 folderPattern_ = pattern;
213 }
214
215 Orthanc::WebServiceParameters& GetOrthancParameters()
216 {
217 return orthanc_;
218 }
219
220 const Orthanc::WebServiceParameters& GetOrthancParameters() const
221 {
222 return orthanc_;
223 }
224
225 IFileTarget* CreateTarget() const;
226
227 void SetDatasetPath(const std::string& path)
228 {
229 dataset_ = path;
230 }
231
232 const std::string& GetDatasetPath() const
233 {
234 return dataset_;
235 }
236
237 void SetOpticalPath(OpticalPath opticalPath)
238 {
239 opticalPath_ = opticalPath;
240 }
241
242 OpticalPath GetOpticalPath() const
243 {
244 return opticalPath_;
245 }
246
247 void SetIccProfilePath(const std::string& path)
248 {
249 iccProfile_ = path;
250 }
251
252 const std::string& GetIccProfilePath() const
253 {
254 return iccProfile_;
255 }
256 };
257 }