Mercurial > hg > orthanc-stone
annotate Framework/Toolbox/MessagingToolbox.cpp @ 293:017044be141b am-2
renaming
author | am@osimis.io |
---|---|
date | Thu, 30 Aug 2018 17:15:22 +0200 |
parents | 5412adf19980 |
children | 14ef1227120f |
rev | line source |
---|---|
0 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
134
4cff7b1ed31d
upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
47 | 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. | |
0 | 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 | |
47 | 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 | |
0 | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | |
20 | |
21 | |
22 #include "MessagingToolbox.h" | |
23 | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
24 #include <Core/Images/Image.h> |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
25 #include <Core/Images/ImageProcessing.h> |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
26 #include <Core/Images/JpegReader.h> |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
27 #include <Core/Images/PngReader.h> |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
28 #include <Core/OrthancException.h> |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
29 #include <Core/Toolbox.h> |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
30 #include <Core/Logging.h> |
0 | 31 |
32 #include <boost/lexical_cast.hpp> | |
33 #include <json/reader.h> | |
34 | |
35 namespace OrthancStone | |
36 { | |
37 namespace MessagingToolbox | |
38 { | |
39 static bool ParseVersion(std::string& version, | |
40 unsigned int& major, | |
41 unsigned int& minor, | |
42 unsigned int& patch, | |
43 const Json::Value& info) | |
44 { | |
45 if (info.type() != Json::objectValue || | |
46 !info.isMember("Version") || | |
47 info["Version"].type() != Json::stringValue) | |
48 { | |
49 return false; | |
50 } | |
51 | |
52 version = info["Version"].asString(); | |
53 if (version == "mainline") | |
54 { | |
55 // Some arbitrary high values Orthanc versions will never reach ;) | |
56 major = 999; | |
57 minor = 999; | |
58 patch = 999; | |
59 return true; | |
60 } | |
61 | |
62 std::vector<std::string> tokens; | |
63 Orthanc::Toolbox::TokenizeString(tokens, version, '.'); | |
64 | |
65 if (tokens.size() != 2 && | |
66 tokens.size() != 3) | |
67 { | |
68 return false; | |
69 } | |
70 | |
71 int a, b, c; | |
72 try | |
73 { | |
74 a = boost::lexical_cast<int>(tokens[0]); | |
75 b = boost::lexical_cast<int>(tokens[1]); | |
76 | |
77 if (tokens.size() == 3) | |
78 { | |
79 c = boost::lexical_cast<int>(tokens[2]); | |
80 } | |
81 else | |
82 { | |
83 c = 0; | |
84 } | |
85 } | |
86 catch (boost::bad_lexical_cast&) | |
87 { | |
88 return false; | |
89 } | |
90 | |
91 if (a < 0 || | |
92 b < 0 || | |
93 c < 0) | |
94 { | |
95 return false; | |
96 } | |
97 else | |
98 { | |
99 major = static_cast<unsigned int>(a); | |
100 minor = static_cast<unsigned int>(b); | |
101 patch = static_cast<unsigned int>(c); | |
102 return true; | |
103 } | |
104 } | |
105 | |
34 | 106 |
67
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
107 bool ParseJson(Json::Value& target, |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
108 const void* content, |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
109 size_t size) |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
110 { |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
111 Json::Reader reader; |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
112 return reader.parse(reinterpret_cast<const char*>(content), |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
113 reinterpret_cast<const char*>(content) + size, |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
114 target); |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
115 } |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
116 |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
117 |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
118 static void ParseJsonException(Json::Value& target, |
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
119 const std::string& source) |
0 | 120 { |
121 Json::Reader reader; | |
122 if (!reader.parse(source, target)) | |
123 { | |
124 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); | |
125 } | |
126 } | |
127 | |
34 | 128 |
0 | 129 void RestApiGet(Json::Value& target, |
31
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
130 OrthancPlugins::IOrthancConnection& orthanc, |
0 | 131 const std::string& uri) |
132 { | |
133 std::string tmp; | |
134 orthanc.RestApiGet(tmp, uri); | |
67
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
135 ParseJsonException(target, tmp); |
0 | 136 } |
137 | |
138 | |
34 | 139 void RestApiPost(Json::Value& target, |
140 OrthancPlugins::IOrthancConnection& orthanc, | |
141 const std::string& uri, | |
142 const std::string& body) | |
143 { | |
144 std::string tmp; | |
145 orthanc.RestApiPost(tmp, uri, body); | |
67
acb60cbb8301
refactoring SeriesLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
146 ParseJsonException(target, tmp); |
34 | 147 } |
148 | |
149 | |
31
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
150 bool HasWebViewerInstalled(OrthancPlugins::IOrthancConnection& orthanc) |
0 | 151 { |
152 try | |
153 { | |
154 Json::Value json; | |
155 RestApiGet(json, orthanc, "/plugins/web-viewer"); | |
156 return json.type() == Json::objectValue; | |
157 } | |
158 catch (Orthanc::OrthancException&) | |
159 { | |
160 return false; | |
161 } | |
162 } | |
163 | |
164 | |
31
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
165 bool CheckOrthancVersion(OrthancPlugins::IOrthancConnection& orthanc) |
0 | 166 { |
167 Json::Value json; | |
168 std::string version; | |
169 unsigned int major, minor, patch; | |
170 | |
171 try | |
172 { | |
173 RestApiGet(json, orthanc, "/system"); | |
174 } | |
175 catch (Orthanc::OrthancException&) | |
176 { | |
177 LOG(ERROR) << "Cannot connect to your Orthanc server"; | |
178 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
179 } | |
180 | |
181 if (!ParseVersion(version, major, minor, patch, json)) | |
182 { | |
183 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
184 } | |
185 | |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
119
diff
changeset
|
186 LOG(WARNING) << "Version of the Orthanc core (must be above 1.3.1): " << version; |
0 | 187 |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
119
diff
changeset
|
188 // Stone is only compatible with Orthanc >= 1.3.1 |
0 | 189 if (major < 1 || |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
119
diff
changeset
|
190 (major == 1 && minor < 3) || |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
119
diff
changeset
|
191 (major == 1 && minor == 3 && patch < 1)) |
0 | 192 { |
193 return false; | |
194 } | |
195 | |
196 try | |
197 { | |
198 RestApiGet(json, orthanc, "/plugins/web-viewer"); | |
199 } | |
200 catch (Orthanc::OrthancException&) | |
201 { | |
202 // The Web viewer is not installed, this is OK | |
203 LOG(WARNING) << "The Web viewer plugin is not installed, progressive download is disabled"; | |
204 return true; | |
205 } | |
206 | |
207 if (!ParseVersion(version, major, minor, patch, json)) | |
208 { | |
209 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
210 } | |
211 | |
212 LOG(WARNING) << "Version of the Web viewer plugin (must be above 2.2): " << version; | |
213 | |
214 return (major >= 3 || | |
215 (major == 2 && minor >= 2)); | |
216 } | |
217 | |
218 | |
31
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
219 Orthanc::ImageAccessor* DecodeFrame(OrthancPlugins::IOrthancConnection& orthanc, |
0 | 220 const std::string& instance, |
221 unsigned int frame, | |
222 Orthanc::PixelFormat targetFormat) | |
223 { | |
224 std::string uri = ("instances/" + instance + "/frames/" + | |
225 boost::lexical_cast<std::string>(frame)); | |
226 | |
227 std::string compressed; | |
228 | |
229 switch (targetFormat) | |
230 { | |
231 case Orthanc::PixelFormat_RGB24: | |
232 orthanc.RestApiGet(compressed, uri + "/preview"); | |
233 break; | |
234 | |
235 case Orthanc::PixelFormat_Grayscale16: | |
236 orthanc.RestApiGet(compressed, uri + "/image-uint16"); | |
237 break; | |
238 | |
239 case Orthanc::PixelFormat_SignedGrayscale16: | |
240 orthanc.RestApiGet(compressed, uri + "/image-int16"); | |
241 break; | |
242 | |
243 default: | |
244 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | |
245 } | |
246 | |
247 std::auto_ptr<Orthanc::PngReader> result(new Orthanc::PngReader); | |
248 result->ReadFromMemory(compressed); | |
249 | |
250 if (targetFormat == Orthanc::PixelFormat_SignedGrayscale16) | |
251 { | |
252 if (result->GetFormat() == Orthanc::PixelFormat_Grayscale16) | |
253 { | |
254 result->SetFormat(Orthanc::PixelFormat_SignedGrayscale16); | |
255 } | |
256 else | |
257 { | |
258 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
259 } | |
260 } | |
261 | |
262 return result.release(); | |
263 } | |
264 | |
265 | |
31
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
266 Orthanc::ImageAccessor* DecodeJpegFrame(OrthancPlugins::IOrthancConnection& orthanc, |
0 | 267 const std::string& instance, |
268 unsigned int frame, | |
269 unsigned int quality, | |
270 Orthanc::PixelFormat targetFormat) | |
271 { | |
272 if (quality <= 0 || | |
273 quality > 100) | |
274 { | |
275 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | |
276 } | |
277 | |
278 // This requires the official Web viewer plugin to be installed! | |
279 std::string uri = ("web-viewer/instances/jpeg" + | |
280 boost::lexical_cast<std::string>(quality) + | |
281 "-" + instance + "_" + | |
282 boost::lexical_cast<std::string>(frame)); | |
283 | |
284 Json::Value encoded; | |
285 RestApiGet(encoded, orthanc, uri); | |
286 | |
287 if (encoded.type() != Json::objectValue || | |
288 !encoded.isMember("Orthanc") || | |
289 encoded["Orthanc"].type() != Json::objectValue) | |
290 { | |
291 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
292 } | |
293 | |
294 Json::Value& info = encoded["Orthanc"]; | |
295 if (!info.isMember("PixelData") || | |
296 !info.isMember("Stretched") || | |
297 !info.isMember("Compression") || | |
298 info["Compression"].type() != Json::stringValue || | |
299 info["PixelData"].type() != Json::stringValue || | |
300 info["Stretched"].type() != Json::booleanValue || | |
301 info["Compression"].asString() != "Jpeg") | |
302 { | |
303 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
304 } | |
305 | |
306 bool isSigned = false; | |
307 bool isStretched = info["Stretched"].asBool(); | |
308 | |
309 if (info.isMember("IsSigned")) | |
310 { | |
311 if (info["IsSigned"].type() != Json::booleanValue) | |
312 { | |
313 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
314 } | |
315 else | |
316 { | |
317 isSigned = info["IsSigned"].asBool(); | |
318 } | |
319 } | |
320 | |
321 std::string jpeg; | |
322 Orthanc::Toolbox::DecodeBase64(jpeg, info["PixelData"].asString()); | |
323 | |
324 std::auto_ptr<Orthanc::JpegReader> reader(new Orthanc::JpegReader); | |
325 reader->ReadFromMemory(jpeg); | |
326 | |
327 if (reader->GetFormat() == Orthanc::PixelFormat_RGB24) // This is a color image | |
328 { | |
329 if (targetFormat != Orthanc::PixelFormat_RGB24) | |
330 { | |
331 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
332 } | |
333 | |
334 if (isSigned || isStretched) | |
335 { | |
336 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); | |
337 } | |
338 else | |
339 { | |
340 return reader.release(); | |
341 } | |
342 } | |
343 | |
344 if (reader->GetFormat() != Orthanc::PixelFormat_Grayscale8) | |
345 { | |
346 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); | |
347 } | |
348 | |
349 if (!isStretched) | |
350 { | |
351 if (targetFormat != reader->GetFormat()) | |
352 { | |
353 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
354 } | |
355 | |
356 return reader.release(); | |
357 } | |
358 | |
359 int32_t stretchLow = 0; | |
360 int32_t stretchHigh = 0; | |
361 | |
362 if (!info.isMember("StretchLow") || | |
363 !info.isMember("StretchHigh") || | |
364 info["StretchLow"].type() != Json::intValue || | |
365 info["StretchHigh"].type() != Json::intValue) | |
366 { | |
367 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | |
368 } | |
369 | |
370 stretchLow = info["StretchLow"].asInt(); | |
371 stretchHigh = info["StretchHigh"].asInt(); | |
372 | |
373 if (stretchLow < -32768 || | |
374 stretchHigh > 65535 || | |
375 (stretchLow < 0 && stretchHigh > 32767)) | |
376 { | |
377 // This range cannot be represented with a uint16_t or an int16_t | |
378 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); | |
379 } | |
380 | |
381 // Decode a grayscale JPEG 8bpp image coming from the Web viewer | |
382 std::auto_ptr<Orthanc::ImageAccessor> image | |
11 | 383 (new Orthanc::Image(targetFormat, reader->GetWidth(), reader->GetHeight(), false)); |
0 | 384 |
385 float scaling = static_cast<float>(stretchHigh - stretchLow) / 255.0f; | |
386 float offset = static_cast<float>(stretchLow) / scaling; | |
387 | |
388 Orthanc::ImageProcessing::Convert(*image, *reader); | |
178 | 389 Orthanc::ImageProcessing::ShiftScale(*image, offset, scaling, true); |
0 | 390 |
391 #if 0 | |
392 /*info.removeMember("PixelData"); | |
393 std::cout << info.toStyledString();*/ | |
394 | |
395 int64_t a, b; | |
396 Orthanc::ImageProcessing::GetMinMaxValue(a, b, *image); | |
397 std::cout << stretchLow << "->" << stretchHigh << " = " << a << "->" << b << std::endl; | |
398 #endif | |
399 | |
400 return image.release(); | |
401 } | |
118
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
402 |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
403 |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
404 static void AddTag(Orthanc::DicomMap& target, |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
405 const OrthancPlugins::IDicomDataset& source, |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
406 const Orthanc::DicomTag& tag) |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
407 { |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
408 OrthancPlugins::DicomTag key(tag.GetGroup(), tag.GetElement()); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
409 |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
410 std::string value; |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
411 if (source.GetStringValue(value, key)) |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
412 { |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
413 target.SetValue(tag, value, false); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
414 } |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
415 } |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
416 |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
417 |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
418 void ConvertDataset(Orthanc::DicomMap& target, |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
419 const OrthancPlugins::IDicomDataset& source) |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
420 { |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
421 target.Clear(); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
422 |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
423 AddTag(target, source, Orthanc::DICOM_TAG_BITS_ALLOCATED); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
424 AddTag(target, source, Orthanc::DICOM_TAG_BITS_STORED); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
425 AddTag(target, source, Orthanc::DICOM_TAG_COLUMNS); |
119
ba83e38cf3ff
rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
118
diff
changeset
|
426 AddTag(target, source, Orthanc::DICOM_TAG_DOSE_GRID_SCALING); |
118
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
427 AddTag(target, source, Orthanc::DICOM_TAG_FRAME_INCREMENT_POINTER); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
428 AddTag(target, source, Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
429 AddTag(target, source, Orthanc::DICOM_TAG_HIGH_BIT); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
430 AddTag(target, source, Orthanc::DICOM_TAG_IMAGE_ORIENTATION_PATIENT); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
431 AddTag(target, source, Orthanc::DICOM_TAG_IMAGE_POSITION_PATIENT); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
432 AddTag(target, source, Orthanc::DICOM_TAG_NUMBER_OF_FRAMES); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
433 AddTag(target, source, Orthanc::DICOM_TAG_PHOTOMETRIC_INTERPRETATION); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
434 AddTag(target, source, Orthanc::DICOM_TAG_PIXEL_REPRESENTATION); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
435 AddTag(target, source, Orthanc::DICOM_TAG_PIXEL_SPACING); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
436 AddTag(target, source, Orthanc::DICOM_TAG_PLANAR_CONFIGURATION); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
437 AddTag(target, source, Orthanc::DICOM_TAG_RESCALE_INTERCEPT); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
438 AddTag(target, source, Orthanc::DICOM_TAG_RESCALE_SLOPE); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
439 AddTag(target, source, Orthanc::DICOM_TAG_ROWS); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
440 AddTag(target, source, Orthanc::DICOM_TAG_SAMPLES_PER_PIXEL); |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
119
diff
changeset
|
441 AddTag(target, source, Orthanc::DICOM_TAG_SERIES_INSTANCE_UID); |
118
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
442 AddTag(target, source, Orthanc::DICOM_TAG_SLICE_THICKNESS); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
443 AddTag(target, source, Orthanc::DICOM_TAG_SOP_CLASS_UID); |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
119
diff
changeset
|
444 AddTag(target, source, Orthanc::DICOM_TAG_SOP_INSTANCE_UID); |
118
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
445 AddTag(target, source, Orthanc::DICOM_TAG_WINDOW_CENTER); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
446 AddTag(target, source, Orthanc::DICOM_TAG_WINDOW_WIDTH); |
a4d0b6c82b29
using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
447 } |
0 | 448 } |
449 } |