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