annotate Framework/Radiography/RadiographyScene.cpp @ 448:cc47e6eaefb0 bgo-commands-codegen

Fixed dummy change
author bgo-osimis
date Wed, 16 Jan 2019 21:08:38 +0100
parents a750f11892ec
children 3c28542229a3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
439
b70e9be013e4 preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 418
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #include "RadiographyScene.h"
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
24 #include "RadiographyAlphaLayer.h"
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
25 #include "RadiographyDicomLayer.h"
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
26 #include "RadiographyTextLayer.h"
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "../Toolbox/DicomFrameConverter.h"
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <Core/Images/Image.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include <Core/Images/ImageProcessing.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include <Core/Images/PamReader.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #include <Core/Images/PamWriter.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #include <Core/Images/PngWriter.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include <Core/OrthancException.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include <Core/Toolbox.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 #include <Plugins/Samples/Common/DicomDatasetReader.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include <Plugins/Samples/Common/FullOrthancDataset.h>
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
412
71c16998fcc8 fix msvc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
39 #include <boost/math/special_functions/round.hpp>
71c16998fcc8 fix msvc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
40
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 namespace OrthancStone
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 RadiographyScene::LayerAccessor::LayerAccessor(RadiographyScene& scene,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 size_t index) :
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 scene_(scene),
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 index_(index)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 Layers::iterator layer = scene.layers_.find(index);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 if (layer == scene.layers_.end())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 layer_ = NULL;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 assert(layer->second != NULL);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 layer_ = layer->second;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
61
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 RadiographyScene::LayerAccessor::LayerAccessor(RadiographyScene& scene,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 double x,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 double y) :
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 scene_(scene),
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 index_(0) // Dummy initialization
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 if (scene.LookupLayer(index_, x, y))
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 Layers::iterator layer = scene.layers_.find(index_);
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
71
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 if (layer == scene.layers_.end())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 assert(layer->second != NULL);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 layer_ = layer->second;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 layer_ = NULL;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 RadiographyScene& RadiographyScene::LayerAccessor::GetScene() const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 if (IsValid())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 return scene_;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 size_t RadiographyScene::LayerAccessor::GetIndex() const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 if (IsValid())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 return index_;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
115 RadiographyLayer& RadiographyScene::LayerAccessor::GetLayer() const
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 if (IsValid())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 return *layer_;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 }
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
125 }
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
127 RadiographyLayer& RadiographyScene::RegisterLayer(RadiographyLayer* layer)
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 if (layer == NULL)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
134 std::auto_ptr<RadiographyLayer> raii(layer);
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
135
428
751fb354149e ability to change the scene of the RadiographyWidget
am@osimis.io
parents: 426
diff changeset
136 LOG(INFO) << "Registering layer: " << countLayers_;
751fb354149e ability to change the scene of the RadiographyWidget
am@osimis.io
parents: 426
diff changeset
137
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 size_t index = countLayers_++;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 raii->SetIndex(index);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 layers_[index] = raii.release();
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
142 EmitMessage(GeometryChangedMessage(*this, *layer));
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
143 EmitMessage(ContentChangedMessage(*this, *layer));
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 return *layer;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 }
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
147
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
149 RadiographyScene::RadiographyScene(MessageBroker& broker) :
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 IObserver(broker),
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 IObservable(broker),
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 countLayers_(0),
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 hasWindowing_(false),
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 windowingCenter_(0), // Dummy initialization
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 windowingWidth_(0) // Dummy initialization
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 RadiographyScene::~RadiographyScene()
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 for (Layers::iterator it = layers_.begin(); it != layers_.end(); it++)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 assert(it->second != NULL);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 delete it->second;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
432
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
169 PhotometricDisplayMode RadiographyScene::GetPreferredPhotomotricDisplayMode() const
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
170 {
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
171 // return the mode of the first layer who "cares" about its display mode (normaly, the one and only layer that is a DicomLayer)
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
172 for (Layers::const_iterator it = layers_.begin(); it != layers_.end(); it++)
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
173 {
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
174 if (it->second->GetPreferredPhotomotricDisplayMode() != PhotometricDisplayMode_Default)
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
175 {
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
176 return it->second->GetPreferredPhotomotricDisplayMode();
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
177 }
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
178 }
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
179
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
180 return PhotometricDisplayMode_Default;
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
181 }
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
182
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
183
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
184 void RadiographyScene::GetLayersIndexes(std::vector<size_t>& output) const
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
185 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
186 for (Layers::const_iterator it = layers_.begin(); it != layers_.end(); it++)
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
187 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
188 output.push_back(it->first);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
189 }
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
190 }
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
191
425
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
192 void RadiographyScene::RemoveLayer(size_t layerIndex)
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
193 {
428
751fb354149e ability to change the scene of the RadiographyWidget
am@osimis.io
parents: 426
diff changeset
194 LOG(INFO) << "Removing layer: " << layerIndex;
751fb354149e ability to change the scene of the RadiographyWidget
am@osimis.io
parents: 426
diff changeset
195
425
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
196 if (layerIndex > countLayers_)
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
197 {
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
198 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
199 }
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
200 delete layers_[layerIndex];
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
201 layers_.erase(layerIndex);
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
202 countLayers_--;
428
751fb354149e ability to change the scene of the RadiographyWidget
am@osimis.io
parents: 426
diff changeset
203 LOG(INFO) << "Removing layer, there are now : " << countLayers_ << " layers";
425
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
204 }
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
205
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
206 const RadiographyLayer& RadiographyScene::GetLayer(size_t layerIndex) const
425
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
207 {
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
208 if (layerIndex > countLayers_)
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
209 {
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
210 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
211 }
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
212
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
213 return *(layers_.at(layerIndex));
425
087237703d63 added layer accessors
am@osimis.io
parents: 418
diff changeset
214 }
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 bool RadiographyScene::GetWindowing(float& center,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 float& width) const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 if (hasWindowing_)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 center = windowingCenter_;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 width = windowingWidth_;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 return true;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 return false;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 void RadiographyScene::GetWindowingWithDefault(float& center,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 float& width) const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 if (!GetWindowing(center, width))
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 center = 128;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 width = 256;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 void RadiographyScene::SetWindowing(float center,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 float width)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 hasWindowing_ = true;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 windowingCenter_ = center;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 windowingWidth_ = width;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
252 RadiographyLayer& RadiographyScene::LoadText(const Orthanc::Font& font,
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
253 const std::string& utf8,
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
254 RadiographyLayer::Geometry* geometry)
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 {
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
256 std::auto_ptr<RadiographyTextLayer> alpha(new RadiographyTextLayer(*this));
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 alpha->LoadText(font, utf8);
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
258 if (geometry != NULL)
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
259 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
260 alpha->SetGeometry(*geometry);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
261 }
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 return RegisterLayer(alpha.release());
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
266
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
267 RadiographyLayer& RadiographyScene::LoadTestBlock(unsigned int width,
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
268 unsigned int height,
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
269 RadiographyLayer::Geometry* geometry)
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 std::auto_ptr<Orthanc::Image> block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false));
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 for (unsigned int padding = 0;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 (width > 2 * padding) && (height > 2 * padding);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 padding++)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 uint8_t color;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 if (255 > 10 * padding)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 color = 255 - 10 * padding;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 color = 0;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 Orthanc::ImageAccessor region;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 block->GetRegion(region, padding, padding, width - 2 * padding, height - 2 * padding);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 Orthanc::ImageProcessing::Set(region, color);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
292 return LoadAlphaBitmap(block.release(), geometry);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
293 }
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
294
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
295 RadiographyLayer& RadiographyScene::LoadAlphaBitmap(Orthanc::ImageAccessor* bitmap, RadiographyLayer::Geometry *geometry)
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
296 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
297 std::auto_ptr<RadiographyAlphaLayer> alpha(new RadiographyAlphaLayer(*this));
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
298 alpha->SetAlpha(bitmap);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
299 if (geometry != NULL)
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
300 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
301 alpha->SetGeometry(*geometry);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
302 }
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 return RegisterLayer(alpha.release());
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
307 RadiographyLayer& RadiographyScene::LoadDicomFrame(OrthancApiClient& orthanc,
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
308 const std::string& instance,
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
309 unsigned int frame,
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
310 bool httpCompression,
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
311 RadiographyLayer::Geometry* geometry)
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 {
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
313 RadiographyDicomLayer& layer = dynamic_cast<RadiographyDicomLayer&>(RegisterLayer(new RadiographyDicomLayer));
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
314 layer.SetInstance(instance, frame);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
315
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
316 if (geometry != NULL)
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
317 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
318 layer.SetGeometry(*geometry);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
319 }
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 {
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
322 IWebService::HttpHeaders headers;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 std::string uri = "/instances/" + instance + "/tags";
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
324
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
325 orthanc.GetBinaryAsync(
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
326 uri, headers,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
327 new Callable<RadiographyScene, OrthancApiClient::BinaryResponseReadyMessage>
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
328 (*this, &RadiographyScene::OnTagsReceived), NULL,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
329 new Orthanc::SingleValueObject<size_t>(layer.GetIndex()));
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 {
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
333 IWebService::HttpHeaders headers;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 headers["Accept"] = "image/x-portable-arbitrarymap";
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 if (httpCompression)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 headers["Accept-Encoding"] = "gzip";
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 }
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
340
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 std::string uri = ("/instances/" + instance + "/frames/" +
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 boost::lexical_cast<std::string>(frame) + "/image-uint16");
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
343
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
344 orthanc.GetBinaryAsync(
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
345 uri, headers,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
346 new Callable<RadiographyScene, OrthancApiClient::BinaryResponseReadyMessage>
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
347 (*this, &RadiographyScene::OnFrameReceived), NULL,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
348 new Orthanc::SingleValueObject<size_t>(layer.GetIndex()));
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 return layer;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
354
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
355 RadiographyLayer& RadiographyScene::LoadDicomWebFrame(IWebService& web)
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
356 {
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
357 RadiographyLayer& layer = RegisterLayer(new RadiographyDicomLayer);
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
358
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
359
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
360 return layer;
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
361 }
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
362
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
363
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
364
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 void RadiographyScene::OnTagsReceived(const OrthancApiClient::BinaryResponseReadyMessage& message)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 size_t index = dynamic_cast<const Orthanc::SingleValueObject<size_t>&>
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
368 (message.GetPayload()).GetValue();
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 LOG(INFO) << "JSON received: " << message.GetUri().c_str()
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 << " (" << message.GetAnswerSize() << " bytes) for layer " << index;
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
372
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 Layers::iterator layer = layers_.find(index);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 if (layer != layers_.end())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 assert(layer->second != NULL);
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
377
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 OrthancPlugins::FullOrthancDataset dicom(message.GetAnswer(), message.GetAnswerSize());
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
379 dynamic_cast<RadiographyDicomLayer*>(layer->second)->SetDicomTags(dicom);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 float c, w;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 if (!hasWindowing_ &&
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 layer->second->GetDefaultWindowing(c, w))
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 hasWindowing_ = true;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 windowingCenter_ = c;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 windowingWidth_ = w;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
390 EmitMessage(GeometryChangedMessage(*this, *(layer->second)));
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 }
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
393
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 void RadiographyScene::OnFrameReceived(const OrthancApiClient::BinaryResponseReadyMessage& message)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 size_t index = dynamic_cast<const Orthanc::SingleValueObject<size_t>&>(message.GetPayload()).GetValue();
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
398
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 LOG(INFO) << "DICOM frame received: " << message.GetUri().c_str()
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 << " (" << message.GetAnswerSize() << " bytes) for layer " << index;
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
401
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 Layers::iterator layer = layers_.find(index);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 if (layer != layers_.end())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 assert(layer->second != NULL);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 std::string content;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 if (message.GetAnswerSize() > 0)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 content.assign(reinterpret_cast<const char*>(message.GetAnswer()), message.GetAnswerSize());
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 }
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
412
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 std::auto_ptr<Orthanc::PamReader> reader(new Orthanc::PamReader);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 reader->ReadFromMemory(content);
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
415 dynamic_cast<RadiographyDicomLayer*>(layer->second)->SetSourceImage(reader.release());
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 428 427
diff changeset
417 EmitMessage(ContentChangedMessage(*this, *(layer->second)));
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 Extent2D RadiographyScene::GetSceneExtent() const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 Extent2D extent;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 for (Layers::const_iterator it = layers_.begin();
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 it != layers_.end(); ++it)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 assert(it->second != NULL);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 extent.Union(it->second->GetExtent());
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 return extent;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 }
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
435
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 void RadiographyScene::Render(Orthanc::ImageAccessor& buffer,
409
99c9b3238008 AffineTransform2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 408
diff changeset
438 const AffineTransform2D& viewTransform,
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 ImageInterpolation interpolation) const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 // Render layers in the background-to-foreground order
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 for (size_t index = 0; index < countLayers_; index++)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 Layers::const_iterator it = layers_.find(index);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 if (it != layers_.end())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 assert(it->second != NULL);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 it->second->Render(buffer, viewTransform, interpolation);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 bool RadiographyScene::LookupLayer(size_t& index /* out */,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 double x,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 double y) const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 // Render layers in the foreground-to-background order
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 for (size_t i = countLayers_; i > 0; i--)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 index = i - 1;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 Layers::const_iterator it = layers_.find(index);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 if (it != layers_.end())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 assert(it->second != NULL);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 if (it->second->Contains(x, y))
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 return true;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 return false;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
476
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 void RadiographyScene::DrawBorder(CairoContext& context,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 unsigned int layer,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 double zoom)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 Layers::const_iterator found = layers_.find(layer);
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
482
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 if (found != layers_.end())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 context.SetSourceColor(255, 0, 0);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 found->second->DrawBorders(context, zoom);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 void RadiographyScene::GetRange(float& minValue,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 float& maxValue) const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 bool first = true;
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
495
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 for (Layers::const_iterator it = layers_.begin();
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 it != layers_.end(); it++)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 assert(it->second != NULL);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 float a, b;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 if (it->second->GetRange(a, b))
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504 if (first)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506 minValue = a;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507 maxValue = b;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 first = false;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 minValue = std::min(a, minValue);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 maxValue = std::max(b, maxValue);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518 if (first)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 minValue = 0;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521 maxValue = 0;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
526 void RadiographyScene::ExportDicom(OrthancApiClient& orthanc,
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
527 const Orthanc::DicomMap& dicom,
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
528 const std::string& parentOrthancId,
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529 double pixelSpacingX,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 double pixelSpacingY,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 bool invert,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 ImageInterpolation interpolation,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 bool usePam)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 {
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
535 Json::Value createDicomRequestContent;
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
536
427
am@osimis.io
parents: 426
diff changeset
537 ExportToCreateDicomRequest(createDicomRequestContent, dicom, pixelSpacingX, pixelSpacingY, invert, interpolation, usePam);
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
538
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
539 if (!parentOrthancId.empty())
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
540 {
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
541 createDicomRequestContent["Parent"] = parentOrthancId;
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
542 }
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
543
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
544 orthanc.PostJsonAsyncExpectJson(
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
545 "/tools/create-dicom", createDicomRequestContent,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
546 new Callable<RadiographyScene, OrthancApiClient::JsonResponseReadyMessage>
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
547 (*this, &RadiographyScene::OnDicomExported),
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
548 NULL, NULL);
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
549 }
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
550
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
551 // Export using PAM is faster than using PNG, but requires Orthanc
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
552 // core >= 1.4.3
427
am@osimis.io
parents: 426
diff changeset
553 void RadiographyScene::ExportToCreateDicomRequest(Json::Value& createDicomRequestContent,
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
554 const Orthanc::DicomMap& dicom,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
555 double pixelSpacingX,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
556 double pixelSpacingY,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
557 bool invert,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
558 ImageInterpolation interpolation,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
559 bool usePam)
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
560 {
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 if (pixelSpacingX <= 0 ||
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562 pixelSpacingY <= 0)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565 }
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
566
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 LOG(INFO) << "Exporting DICOM";
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 Extent2D extent = GetSceneExtent();
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 int w = std::ceil(extent.GetWidth() / pixelSpacingX);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 int h = std::ceil(extent.GetHeight() / pixelSpacingY);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 if (w < 0 || h < 0)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 Orthanc::Image layers(Orthanc::PixelFormat_Float32,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 static_cast<unsigned int>(w),
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581 static_cast<unsigned int>(h), false);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582
409
99c9b3238008 AffineTransform2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 408
diff changeset
583 AffineTransform2D view = AffineTransform2D::Combine(
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
584 AffineTransform2D::CreateScaling(1.0 / pixelSpacingX, 1.0 / pixelSpacingY),
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
585 AffineTransform2D::CreateOffset(-extent.GetX1(), -extent.GetY1()));
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
586
432
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
587 // wipe background before rendering
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
588 Orthanc::ImageProcessing::Set(layers, 0);
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 431
diff changeset
589
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 Render(layers, view, interpolation);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592 Orthanc::Image rendered(Orthanc::PixelFormat_Grayscale16,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 layers.GetWidth(), layers.GetHeight(), false);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 Orthanc::ImageProcessing::Convert(rendered, layers);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596 std::string base64;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
598 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599 std::string content;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 if (usePam)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603 Orthanc::PamWriter writer;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 writer.WriteToMemory(content, rendered);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606 else
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 Orthanc::PngWriter writer;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 writer.WriteToMemory(content, rendered);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 Orthanc::Toolbox::EncodeBase64(base64, content);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615 std::set<Orthanc::DicomTag> tags;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616 dicom.GetTags(tags);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
618 createDicomRequestContent["Tags"] = Json::objectValue;
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
619
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 for (std::set<Orthanc::DicomTag>::const_iterator
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
621 tag = tags.begin(); tag != tags.end(); ++tag)
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623 const Orthanc::DicomValue& value = dicom.GetValue(*tag);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624 if (!value.IsNull() &&
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 !value.IsBinary())
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626 {
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
627 createDicomRequestContent["Tags"][tag->Format()] = value.GetContent();
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630
436
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
631 PhotometricDisplayMode photometricMode = GetPreferredPhotomotricDisplayMode();
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
632 if ((invert && photometricMode != PhotometricDisplayMode_Monochrome2) ||
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
633 (!invert && photometricMode == PhotometricDisplayMode_Monochrome1))
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
634 {
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
635 createDicomRequestContent["Tags"][Orthanc::DICOM_TAG_PHOTOMETRIC_INTERPRETATION.Format()] = "MONOCHROME1";
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
636 }
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
637 else
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
638 {
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
639 createDicomRequestContent["Tags"][Orthanc::DICOM_TAG_PHOTOMETRIC_INTERPRETATION.Format()] = "MONOCHROME2";
04711a2e12cd fix crop + export photometric interpretation correctly
am@osimis.io
parents: 432
diff changeset
640 }
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642 // WARNING: The order of PixelSpacing is Y/X. We use "%0.8f" to
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643 // avoid floating-point numbers to grow over 16 characters,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 // which would be invalid according to DICOM standard
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645 // ("dciodvfy" would complain).
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646 char buf[32];
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647 sprintf(buf, "%0.8f\\%0.8f", pixelSpacingY, pixelSpacingX);
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
648
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
649 createDicomRequestContent["Tags"][Orthanc::DICOM_TAG_PIXEL_SPACING.Format()] = buf;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 float center, width;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 if (GetWindowing(center, width))
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 {
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
654 createDicomRequestContent["Tags"][Orthanc::DICOM_TAG_WINDOW_CENTER.Format()] =
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
655 boost::lexical_cast<std::string>(boost::math::iround(center));
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
656
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
657 createDicomRequestContent["Tags"][Orthanc::DICOM_TAG_WINDOW_WIDTH.Format()] =
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
658 boost::lexical_cast<std::string>(boost::math::iround(width));
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
661
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 // This is Data URI scheme: https://en.wikipedia.org/wiki/Data_URI_scheme
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
663 createDicomRequestContent["Content"] = ("data:" +
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
664 std::string(usePam ? Orthanc::MIME_PAM : Orthanc::MIME_PNG) +
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
665 ";base64," + base64);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 void RadiographyScene::OnDicomExported(const OrthancApiClient::JsonResponseReadyMessage& message)
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 {
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
671 LOG(INFO) << "DICOM export was successful: "
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672 << message.GetJson().toStyledString();
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 }
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
674
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
675
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
676 void RadiographyScene::OnDicomWebReceived(const IWebService::HttpRequestSuccessMessage& message)
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
677 {
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
678 LOG(INFO) << "DICOMweb WADO-RS received: " << message.GetAnswerSize() << " bytes";
418
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 417
diff changeset
679
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 417
diff changeset
680 const IWebService::HttpHeaders& h = message.GetAnswerHttpHeaders();
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 417
diff changeset
681 for (IWebService::HttpHeaders::const_iterator
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
682 it = h.begin(); it != h.end(); ++it)
418
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 417
diff changeset
683 {
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 417
diff changeset
684 printf("[%s] = [%s]\n", it->first.c_str(), it->second.c_str());
c23df8b3433b refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 417
diff changeset
685 }
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
686 }
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
687
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 }