annotate Framework/Radiography/RadiographyScene.h @ 1273:398ea4259e65

merge
author Alain Mazy <alain@mazy.be>
date Mon, 03 Feb 2020 14:57:22 +0100
parents a989c7d46b9a 2d8ab34c8c91
children 7ec8fea061b9 d4e6cd35107b
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
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1259
diff changeset
5 * Copyright (C) 2017-2020 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 #pragma once
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
24 #include "RadiographyLayer.h"
732
c35e98d22764 move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 726
diff changeset
25 #include "../Deprecated/Toolbox/DicomFrameConverter.h"
c35e98d22764 move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 726
diff changeset
26 #include "../Deprecated/Toolbox/OrthancApiClient.h"
c35e98d22764 move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 726
diff changeset
27 #include "../StoneEnumerations.h"
481
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
28 #include "Core/Images/Image.h"
488
aede9b042cb7 now using ImageProcessing::FillPolygon
am@osimis.io
parents: 484
diff changeset
29 #include "Core/Images/ImageProcessing.h"
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace OrthancStone
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
475
3c28542229a3 added a mask layer in the RadiographyWidget (to be cleaned)
am@osimis.io
parents: 452
diff changeset
33 class RadiographyDicomLayer;
3c28542229a3 added a mask layer in the RadiographyWidget (to be cleaned)
am@osimis.io
parents: 452
diff changeset
34
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 class RadiographyScene :
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
36 public IObserver,
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
37 public IObservable
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 {
1259
69177b10e2b9 various fixes for RadiographyScene: support text layers outside the dicom layer, fix background in this case + extract dicom from rendered scene
Alain Mazy <alain@mazy.be>
parents: 1257
diff changeset
39 friend class RadiographySceneGeometryReader;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 public:
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
41 class GeometryChangedMessage : public OriginMessage<RadiographyScene>
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
42 {
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
43 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
44
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
45 private:
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
46 RadiographyLayer& layer_;
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
47
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
48 public:
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
49 GeometryChangedMessage(const RadiographyScene& origin,
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
50 RadiographyLayer& layer) :
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
51 OriginMessage(origin),
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
52 layer_(layer)
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
53 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
54 }
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
55
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
56 RadiographyLayer& GetLayer() const
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
57 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
58 return layer_;
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
59 }
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
60 };
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
61
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
62 class ContentChangedMessage : public OriginMessage<RadiographyScene>
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
63 {
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
64 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
65
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
66 private:
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
67 RadiographyLayer& layer_;
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
68
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
69 public:
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
70 ContentChangedMessage(const RadiographyScene& origin,
438
237160cbb44f allow derivation of RadiographyScene
am@osimis.io
parents: 432
diff changeset
71 RadiographyLayer& layer) :
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
72 OriginMessage(origin),
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
73 layer_(layer)
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
74 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
75 }
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
76
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
77 RadiographyLayer& GetLayer() const
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
78 {
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
79 return layer_;
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
80 }
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
81 };
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
82
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
83 class LayerEditedMessage : public OriginMessage<RadiographyScene>
503
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
84 {
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
85 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
86
503
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
87 private:
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
88 const RadiographyLayer& layer_;
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
89
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
90 public:
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
91 LayerEditedMessage(const RadiographyScene& origin,
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
92 const RadiographyLayer& layer) :
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
93 OriginMessage(origin),
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
94 layer_(layer)
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
95 {
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
96 }
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
97
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
98 const RadiographyLayer& GetLayer() const
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
99 {
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
100 return layer_;
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
101 }
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
102 };
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
103
1131
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
104 class LayerRemovedMessage : public OriginMessage<RadiographyScene>
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
105 {
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
106 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
107
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
108 private:
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
109 size_t& layerIndex_;
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
110
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
111 public:
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
112 LayerRemovedMessage(const RadiographyScene& origin,
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
113 size_t& layerIndex) :
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
114 OriginMessage(origin),
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
115 layerIndex_(layerIndex)
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
116 {
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
117 }
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
118
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
119 size_t& GetLayerIndex() const
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
120 {
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
121 return layerIndex_;
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
122 }
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
123 };
4663f158c748 RadiographyWidget is now notified when a layer is removed from the scene
Alain Mazy <alain@mazy.be>
parents: 1118
diff changeset
124
503
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
125
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
126 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, WindowingChangedMessage, RadiographyScene);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
643
f0008c55e5f7 getting rid of MessageType enumeration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 587
diff changeset
128
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 class LayerAccessor : public boost::noncopyable
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 private:
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 RadiographyScene& scene_;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 size_t index_;
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
134 RadiographyLayer* layer_;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 public:
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 LayerAccessor(RadiographyScene& scene,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 size_t index);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 LayerAccessor(RadiographyScene& scene,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 double x,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 double y);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 void Invalidate()
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 layer_ = NULL;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 bool IsValid() const
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 {
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 return layer_ != NULL;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 }
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 RadiographyScene& GetScene() const;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 size_t GetIndex() const;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
158 RadiographyLayer& GetLayer() const;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 };
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161
452
9a8fe40acfff improved inheritence of RadiographyScene
Alain Mazy <alain@mazy.be>
parents: 440
diff changeset
162 protected:
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
163 typedef std::map<size_t, RadiographyLayer*> Layers;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
1199
922d2e61aa5d RadiograpyScene: can now remove any layer + new key wrappers for Delete/Backspace
Alain Mazy <alain@mazy.be>
parents: 1196
diff changeset
165 size_t nextLayerIndex_;
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
166 bool hasWindowing_;
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
167 float windowingCenter_;
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
168 float windowingWidth_;
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
169 Layers layers_;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170
1259
69177b10e2b9 various fixes for RadiographyScene: support text layers outside the dicom layer, fix background in this case + extract dicom from rendered scene
Alain Mazy <alain@mazy.be>
parents: 1257
diff changeset
171 public:
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
172 RadiographyLayer& RegisterLayer(RadiographyLayer* layer);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
1259
69177b10e2b9 various fixes for RadiographyScene: support text layers outside the dicom layer, fix background in this case + extract dicom from rendered scene
Alain Mazy <alain@mazy.be>
parents: 1257
diff changeset
174 protected:
1257
6af941a68472 RadiographyScene: virtual methods to use in derived class
Alain Mazy <alain@mazy.be>
parents: 1220
diff changeset
175 virtual void _RegisterLayer(RadiographyLayer* layer);
1272
a989c7d46b9a options to avoid multiple LayerEditedMessage
Alain Mazy <alain@mazy.be>
parents: 1259
diff changeset
176 virtual void _OnLayerRemoved() {}
1257
6af941a68472 RadiographyScene: virtual methods to use in derived class
Alain Mazy <alain@mazy.be>
parents: 1220
diff changeset
177
6af941a68472 RadiographyScene: virtual methods to use in derived class
Alain Mazy <alain@mazy.be>
parents: 1220
diff changeset
178 void SetLayerIndex(RadiographyLayer* layer, size_t index)
6af941a68472 RadiographyScene: virtual methods to use in derived class
Alain Mazy <alain@mazy.be>
parents: 1220
diff changeset
179 {
6af941a68472 RadiographyScene: virtual methods to use in derived class
Alain Mazy <alain@mazy.be>
parents: 1220
diff changeset
180 layer->SetIndex(index);
6af941a68472 RadiographyScene: virtual methods to use in derived class
Alain Mazy <alain@mazy.be>
parents: 1220
diff changeset
181 }
6af941a68472 RadiographyScene: virtual methods to use in derived class
Alain Mazy <alain@mazy.be>
parents: 1220
diff changeset
182
1118
35e798b16b65 RadiographyDicomLayer: allow replacing low res image by high res image
Alain Mazy <alain@mazy.be>
parents: 1038
diff changeset
183 virtual void OnTagsReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
185 virtual void OnFrameReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
187 void OnDicomExported(const Deprecated::OrthancApiClient::JsonResponseReadyMessage& message);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
189 void OnDicomWebReceived(const Deprecated::IWebService::HttpRequestSuccessMessage& message);
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
190
730
fe938bddb932 fix after namespace rename to Deprecated
Alain Mazy <alain@mazy.be>
parents: 726
diff changeset
191 virtual void OnLayerEdited(const RadiographyLayer::LayerEditedMessage& message);
1201
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
192
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 public:
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
194 RadiographyScene(MessageBroker& broker);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 virtual ~RadiographyScene();
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197
876
580dd82e13f5 added GetApproximateMemoryUsage
Alain Mazy <alain@mazy.be>
parents: 739
diff changeset
198 virtual size_t GetApproximateMemoryUsage() const;
580dd82e13f5 added GetApproximateMemoryUsage
Alain Mazy <alain@mazy.be>
parents: 739
diff changeset
199
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 bool GetWindowing(float& center,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 float& width) const;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 void GetWindowingWithDefault(float& center,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 float& width) const;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205
730
fe938bddb932 fix after namespace rename to Deprecated
Alain Mazy <alain@mazy.be>
parents: 726
diff changeset
206 virtual void SetWindowing(float center,
fe938bddb932 fix after namespace rename to Deprecated
Alain Mazy <alain@mazy.be>
parents: 726
diff changeset
207 float width);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208
739
be9c1530d40a deprecating enum SliceImageQuality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 733
diff changeset
209 RadiographyPhotometricDisplayMode GetPreferredPhotomotricDisplayMode() const;
432
4eb96c6b4e96 improved handling of MONOCHROME1, background and invertion
am@osimis.io
parents: 430
diff changeset
210
1190
f417a0ae282b wip: TextLayer with new fonts
Alain Mazy <alain@mazy.be>
parents: 1131
diff changeset
211 RadiographyLayer& LoadText(const std::string& utf8,
1220
9ee6b28f53e8 RadiographyTextLayer: support multiple fonts
Alain Mazy <alain@mazy.be>
parents: 1202
diff changeset
212 const std::string& font,
1196
a5f2a6b04a31 RadiographyScene: windowing is now only applied to the Dicom layer
Alain Mazy <alain@mazy.be>
parents: 1190
diff changeset
213 unsigned int fontSize,
1190
f417a0ae282b wip: TextLayer with new fonts
Alain Mazy <alain@mazy.be>
parents: 1131
diff changeset
214 uint8_t foreground,
1220
9ee6b28f53e8 RadiographyTextLayer: support multiple fonts
Alain Mazy <alain@mazy.be>
parents: 1202
diff changeset
215 RadiographyLayer::Geometry* geometry,
9ee6b28f53e8 RadiographyTextLayer: support multiple fonts
Alain Mazy <alain@mazy.be>
parents: 1202
diff changeset
216 bool isCenterGeometry);
1201
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
217
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
218 RadiographyLayer& UpdateText(size_t layerIndex,
1220
9ee6b28f53e8 RadiographyTextLayer: support multiple fonts
Alain Mazy <alain@mazy.be>
parents: 1202
diff changeset
219 const std::string& font,
1201
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
220 const std::string& utf8,
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
221 unsigned int fontSize,
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
222 uint8_t foreground);
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
223
410
6decc0ba9da5 rename RadiographyScene::Layer as RadiographyLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 409
diff changeset
224 RadiographyLayer& LoadTestBlock(unsigned int width,
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
225 unsigned int height,
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
226 RadiographyLayer::Geometry* geometry);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
227
488
aede9b042cb7 now using ImageProcessing::FillPolygon
am@osimis.io
parents: 484
diff changeset
228 RadiographyLayer& LoadMask(const std::vector<Orthanc::ImageProcessing::ImagePoint>& corners,
475
3c28542229a3 added a mask layer in the RadiographyWidget (to be cleaned)
am@osimis.io
parents: 452
diff changeset
229 const RadiographyDicomLayer& dicomLayer,
3c28542229a3 added a mask layer in the RadiographyWidget (to be cleaned)
am@osimis.io
parents: 452
diff changeset
230 float foreground,
3c28542229a3 added a mask layer in the RadiographyWidget (to be cleaned)
am@osimis.io
parents: 452
diff changeset
231 RadiographyLayer::Geometry* geometry);
3c28542229a3 added a mask layer in the RadiographyWidget (to be cleaned)
am@osimis.io
parents: 452
diff changeset
232
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
233 RadiographyLayer& LoadAlphaBitmap(Orthanc::ImageAccessor* bitmap, // takes ownership
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
234 RadiographyLayer::Geometry* geometry);
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
235
553
92305ee35b1c web-worker consequences: give access to lower level data
Alain Mazy <alain@mazy.be>
parents: 503
diff changeset
236 virtual RadiographyLayer& LoadDicomImage(Orthanc::ImageAccessor* dicomImage, // takes ownership
92305ee35b1c web-worker consequences: give access to lower level data
Alain Mazy <alain@mazy.be>
parents: 503
diff changeset
237 const std::string& instance,
92305ee35b1c web-worker consequences: give access to lower level data
Alain Mazy <alain@mazy.be>
parents: 503
diff changeset
238 unsigned int frame,
714
d2c0e347ddc2 deprecating DicomFrameConverter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 658
diff changeset
239 Deprecated::DicomFrameConverter* converter, // takes ownership
739
be9c1530d40a deprecating enum SliceImageQuality
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 733
diff changeset
240 RadiographyPhotometricDisplayMode preferredPhotometricDisplayMode,
553
92305ee35b1c web-worker consequences: give access to lower level data
Alain Mazy <alain@mazy.be>
parents: 503
diff changeset
241 RadiographyLayer::Geometry* geometry);
92305ee35b1c web-worker consequences: give access to lower level data
Alain Mazy <alain@mazy.be>
parents: 503
diff changeset
242
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
243 virtual RadiographyLayer& LoadDicomFrame(Deprecated::OrthancApiClient& orthanc,
438
237160cbb44f allow derivation of RadiographyScene
am@osimis.io
parents: 432
diff changeset
244 const std::string& instance,
237160cbb44f allow derivation of RadiographyScene
am@osimis.io
parents: 432
diff changeset
245 unsigned int frame,
237160cbb44f allow derivation of RadiographyScene
am@osimis.io
parents: 432
diff changeset
246 bool httpCompression,
237160cbb44f allow derivation of RadiographyScene
am@osimis.io
parents: 432
diff changeset
247 RadiographyLayer::Geometry* geometry); // pass NULL if you want default geometry
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
249 RadiographyLayer& LoadDicomWebFrame(Deprecated::IWebService& web);
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
250
425
087237703d63 added layer accessors
am@osimis.io
parents: 417
diff changeset
251 void RemoveLayer(size_t layerIndex);
087237703d63 added layer accessors
am@osimis.io
parents: 417
diff changeset
252
1201
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
253 RadiographyLayer& GetLayer(size_t layerIndex);
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
254
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
255 const RadiographyLayer& GetLayer(size_t layerIndex) const;
425
087237703d63 added layer accessors
am@osimis.io
parents: 417
diff changeset
256
492
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
257 template <typename TypeLayer>
1201
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
258 TypeLayer* GetTypedLayer(size_t indexOfType = 0)
492
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
259 {
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
260 std::vector<size_t> layerIndexes;
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
261 GetLayersIndexes(layerIndexes);
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
262
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
263 size_t count = 0;
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
264
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
265 for (size_t i = 0; i < layerIndexes.size(); ++i)
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
266 {
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
267 TypeLayer* typedLayer = dynamic_cast<TypeLayer*>(layers_[layerIndexes[i]]);
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
268 if (typedLayer != NULL)
64d90190a08c template GetLayer
Alain Mazy <alain@mazy.be>
parents: 488
diff changeset
269 {
1201
ab958fd99b07 RadiographyScene fixes
Alain Mazy <alain@mazy.be>
parents: 1199
diff changeset
270 if (count == indexOfType)
503
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
271 {
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
272 return typedLayer;
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
273 }
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
274 count++;
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
275 }
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
276 }
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
277
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
278 return NULL;
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
279 }
77e0eb83ff63 layers are now Observable and emitting LayerEdited messages
amazy
parents: 492
diff changeset
280
430
b85f635f1eb5 added serialization for RadiographyScene
am@osimis.io
parents: 427
diff changeset
281 void GetLayersIndexes(std::vector<size_t>& output) const;
425
087237703d63 added layer accessors
am@osimis.io
parents: 417
diff changeset
282
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 Extent2D GetSceneExtent() const;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284
1038
692291406f6a virtual Render
Alain Mazy <alain@mazy.be>
parents: 876
diff changeset
285 virtual void Render(Orthanc::ImageAccessor& buffer,
692291406f6a virtual Render
Alain Mazy <alain@mazy.be>
parents: 876
diff changeset
286 const AffineTransform2D& viewTransform,
1196
a5f2a6b04a31 RadiographyScene: windowing is now only applied to the Dicom layer
Alain Mazy <alain@mazy.be>
parents: 1190
diff changeset
287 ImageInterpolation interpolation,
a5f2a6b04a31 RadiographyScene: windowing is now only applied to the Dicom layer
Alain Mazy <alain@mazy.be>
parents: 1190
diff changeset
288 bool applyWindowing) const;
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 bool LookupLayer(size_t& index /* out */,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 double x,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 double y) const;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 void DrawBorder(CairoContext& context,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 unsigned int layer,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 double zoom);
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 void GetRange(float& minValue,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 float& maxValue) const;
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 // Export using PAM is faster than using PNG, but requires Orthanc
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 // core >= 1.4.3
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
303 void ExportDicom(Deprecated::OrthancApiClient& orthanc,
417
aee3d7941c9b preparing to load images using DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 410
diff changeset
304 const Orthanc::DicomMap& dicom,
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
305 const std::string& parentOrthancId,
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 double pixelSpacingX,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 double pixelSpacingY,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 bool invert,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 ImageInterpolation interpolation,
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 bool usePam);
426
660fe6f6bf4a split Export in 2
am@osimis.io
parents: 425
diff changeset
311
726
4f2416d519b4 moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 714
diff changeset
312 void ExportDicom(Deprecated::OrthancApiClient& orthanc,
483
29fc066b6f65 Export now accepts Json::Value
am@osimis.io
parents: 481
diff changeset
313 const Json::Value& dicomTags,
29fc066b6f65 Export now accepts Json::Value
am@osimis.io
parents: 481
diff changeset
314 const std::string& parentOrthancId,
29fc066b6f65 Export now accepts Json::Value
am@osimis.io
parents: 481
diff changeset
315 double pixelSpacingX,
29fc066b6f65 Export now accepts Json::Value
am@osimis.io
parents: 481
diff changeset
316 double pixelSpacingY,
29fc066b6f65 Export now accepts Json::Value
am@osimis.io
parents: 481
diff changeset
317 bool invert,
29fc066b6f65 Export now accepts Json::Value
am@osimis.io
parents: 481
diff changeset
318 ImageInterpolation interpolation,
29fc066b6f65 Export now accepts Json::Value
am@osimis.io
parents: 481
diff changeset
319 bool usePam);
29fc066b6f65 Export now accepts Json::Value
am@osimis.io
parents: 481
diff changeset
320
484
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
321 void ExportToCreateDicomRequest(Json::Value& createDicomRequestContent,
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
322 const Json::Value& dicomTags,
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
323 const std::string& parentOrthancId,
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
324 double pixelSpacingX,
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
325 double pixelSpacingY,
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
326 bool invert,
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
327 ImageInterpolation interpolation,
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
328 bool usePam);
7bf001b9d244 re-added ExportToCreateDicomRequest
Alain Mazy <alain@mazy.be>
parents: 483
diff changeset
329
587
848170ca4351 more export functions
Alain Mazy <alain@mazy.be>
parents: 553
diff changeset
330 Orthanc::Image* ExportToCreateDicomRequestAndImage(Json::Value& createDicomRequestContent,
848170ca4351 more export functions
Alain Mazy <alain@mazy.be>
parents: 553
diff changeset
331 const Json::Value& dicomTags,
848170ca4351 more export functions
Alain Mazy <alain@mazy.be>
parents: 553
diff changeset
332 const std::string& parentOrthancId,
848170ca4351 more export functions
Alain Mazy <alain@mazy.be>
parents: 553
diff changeset
333 double pixelSpacingX,
848170ca4351 more export functions
Alain Mazy <alain@mazy.be>
parents: 553
diff changeset
334 double pixelSpacingY,
848170ca4351 more export functions
Alain Mazy <alain@mazy.be>
parents: 553
diff changeset
335 bool invert,
848170ca4351 more export functions
Alain Mazy <alain@mazy.be>
parents: 553
diff changeset
336 ImageInterpolation interpolation);
848170ca4351 more export functions
Alain Mazy <alain@mazy.be>
parents: 553
diff changeset
337
481
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
338 Orthanc::Image* ExportToImage(double pixelSpacingX,
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
339 double pixelSpacingY,
1196
a5f2a6b04a31 RadiographyScene: windowing is now only applied to the Dicom layer
Alain Mazy <alain@mazy.be>
parents: 1190
diff changeset
340 ImageInterpolation interpolation,
a5f2a6b04a31 RadiographyScene: windowing is now only applied to the Dicom layer
Alain Mazy <alain@mazy.be>
parents: 1190
diff changeset
341 bool applyWindowing)
481
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
342 {
1196
a5f2a6b04a31 RadiographyScene: windowing is now only applied to the Dicom layer
Alain Mazy <alain@mazy.be>
parents: 1190
diff changeset
343 return ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false, 0, applyWindowing);
481
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
344 }
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
345
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
346 Orthanc::Image* ExportToImage(double pixelSpacingX,
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
347 double pixelSpacingY,
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
348 ImageInterpolation interpolation,
159a465e27bd reworked RadiographyScene export to export to an Orthanc::Image too
am@osimis.io
parents: 475
diff changeset
349 bool invert,
1196
a5f2a6b04a31 RadiographyScene: windowing is now only applied to the Dicom layer
Alain Mazy <alain@mazy.be>
parents: 1190
diff changeset
350 int64_t maxValue /* for inversion */,
1202
9added0d371e cleanup
Alain Mazy <alain@mazy.be>
parents: 1201
diff changeset
351 bool applyWindowing);
9added0d371e cleanup
Alain Mazy <alain@mazy.be>
parents: 1201
diff changeset
352
1259
69177b10e2b9 various fixes for RadiographyScene: support text layers outside the dicom layer, fix background in this case + extract dicom from rendered scene
Alain Mazy <alain@mazy.be>
parents: 1257
diff changeset
353 void ExtractLayerFromRenderedScene(Orthanc::ImageAccessor& layer,
69177b10e2b9 various fixes for RadiographyScene: support text layers outside the dicom layer, fix background in this case + extract dicom from rendered scene
Alain Mazy <alain@mazy.be>
parents: 1257
diff changeset
354 const Orthanc::ImageAccessor& renderedScene,
69177b10e2b9 various fixes for RadiographyScene: support text layers outside the dicom layer, fix background in this case + extract dicom from rendered scene
Alain Mazy <alain@mazy.be>
parents: 1257
diff changeset
355 size_t layerIndex,
69177b10e2b9 various fixes for RadiographyScene: support text layers outside the dicom layer, fix background in this case + extract dicom from rendered scene
Alain Mazy <alain@mazy.be>
parents: 1257
diff changeset
356 ImageInterpolation interpolation);
408
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 };
6834c236b36d reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 }