annotate Applications/Samples/SingleFrameApplication.h @ 85:bd48431ac285 wasm

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 26 May 2017 12:20:26 +0200
parents 4e21f6b3aa0d
children f244018a4e4b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
40
7207a407bcd8 shared copyright with osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 16
diff changeset
5 * Copyright (C) 2017 Osimis, Belgium
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
10 * the License, or (at your option) any later version.
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
15 * Affero General Public License for more details.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
16 *
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "SampleApplicationBase.h"
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
25 #include "SampleInteractor.h"
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
79
4e21f6b3aa0d cleaning up
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 78
diff changeset
27 #include "../../Framework/Layers/OrthancFrameLayerSource.h"
4e21f6b3aa0d cleaning up
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 78
diff changeset
28 #include "../../Framework/Widgets/LayerWidget.h"
51
b340879da9bd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 47
diff changeset
29 #include "../../Resources/Orthanc/Core/Logging.h"
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace OrthancStone
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 namespace Samples
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
35 class SingleFrameApplication :
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
36 public SampleApplicationBase,
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
37 public IVolumeSlicesObserver
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 {
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
39 private:
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
40 class Interactor : public IWorldSceneInteractor
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
41 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
42 public:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
43 virtual IWorldSceneMouseTracker* CreateMouseTracker(WorldSceneWidget& widget,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
44 const ViewportGeometry& view,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
45 MouseButton button,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
46 double x,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
47 double y,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
48 IStatusBar* statusBar)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
49 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
50 return NULL;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
51 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
52
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
53 virtual void MouseOver(CairoContext& context,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
54 WorldSceneWidget& widget,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
55 const ViewportGeometry& view,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
56 double x,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
57 double y,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
58 IStatusBar* statusBar)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
59 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
60 if (statusBar != NULL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
61 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
62 Vector p = dynamic_cast<LayerWidget&>(widget).GetSlice().MapSliceToWorldCoordinates(x, y);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
63
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
64 char buf[64];
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
65 sprintf(buf, "X = %.02f Y = %.02f Z = %.02f (in cm)",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
66 p[0] / 10.0, p[1] / 10.0, p[2] / 10.0);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
67 statusBar->SetMessage(buf);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
68 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
69 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
70
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
71 virtual void MouseWheel(WorldSceneWidget& widget,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
72 MouseWheelDirection direction,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
73 KeyboardModifiers modifiers,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
74 IStatusBar* statusBar)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
75 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
76 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
77
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
78 virtual void KeyPressed(WorldSceneWidget& widget,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
79 char key,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
80 KeyboardModifiers modifiers,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
81 IStatusBar* statusBar)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
82 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
83 switch (key)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
84 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
85 case 's':
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
86 widget.SetDefaultView();
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
87 break;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
88
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
89 default:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
90 break;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
91 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
92 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
93 };
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
94
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
95 LayerWidget* widget_;
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
96
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 public:
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
98 SingleFrameApplication() : widget_(NULL)
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
99 {
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
100 }
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
101
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
102 virtual void NotifySlicesAvailable(const ParallelSlices& slices)
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
103 {
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
104 if (widget_ != NULL &&
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
105 slices.GetSliceCount() > 0)
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
106 {
78
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 71
diff changeset
107 widget_->SetSlice(slices.GetSlice(0));
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
108 widget_->SetDefaultView();
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
109 }
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
110 }
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
111
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 virtual void DeclareCommandLineOptions(boost::program_options::options_description& options)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 boost::program_options::options_description generic("Sample options");
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 generic.add_options()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 ("instance", boost::program_options::value<std::string>(),
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 "Orthanc ID of the instance")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 ("frame", boost::program_options::value<unsigned int>()->default_value(0),
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 "Number of the frame, for multi-frame DICOM instances")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 ("smooth", boost::program_options::value<bool>()->default_value(true),
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 "Enable linear interpolation to smooth the image")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 ;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 options.add(generic);
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 virtual void Initialize(BasicApplicationContext& context,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 IStatusBar& statusBar,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 const boost::program_options::variables_map& parameters)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 using namespace OrthancStone;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
133 statusBar.SetMessage("Use the key \"s\" to reinitialize the layout");
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
134
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 if (parameters.count("instance") != 1)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 LOG(ERROR) << "The instance ID is missing";
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 std::string instance = parameters["instance"].as<std::string>();
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 int frame = parameters["frame"].as<unsigned int>();
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
144 std::auto_ptr<LayerWidget> widget(new LayerWidget);
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
145
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
146 #if 1
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
147 std::auto_ptr<OrthancFrameLayerSource> layer
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
148 (new OrthancFrameLayerSource(context.GetWebService(), instance, frame));
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
149 layer->SetObserver(*this);
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
150 widget->AddLayer(layer.release());
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
151
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
152 if (parameters["smooth"].as<bool>())
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
153 {
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
154 RenderStyle s;
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
155 s.interpolation_ = ImageInterpolation_Linear;
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
156 widget->SetLayerStyle(0, s);
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
157 }
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
158 #else
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
159 // 0178023P**
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
160 std::auto_ptr<OrthancFrameLayerSource> layer;
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
161 layer.reset(new OrthancFrameLayerSource(context.GetWebService(), "c804a1a2-142545c9-33b32fe2-3df4cec0-a2bea6d6", 0));
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
162 //layer.reset(new OrthancFrameLayerSource(context.GetWebService(), "4bd4304f-47478948-71b24af2-51f4f1bc-275b6c1b", 0)); // BAD SLICE
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
163 layer->SetObserver(*this);
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
164 widget->AddLayer(layer.release());
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
165
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
166 widget->AddLayer(new OrthancFrameLayerSource(context.GetWebService(), "a1c4dc6b-255d27f0-88069875-8daed730-2f5ee5c6", 0));
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
167
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
168 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
169 RenderStyle s;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
170 s.alpha_ = 1;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
171 widget->SetLayerStyle(0, s);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
172 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
173
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
174 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
175 RenderStyle s;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
176 s.drawGrid_ = true;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
177 s.SetColor(255, 0, 0); // Draw missing PET layer in red
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
178 s.alpha_ = 0.5;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
179 s.applyLut_ = true;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
180 s.lut_ = Orthanc::EmbeddedResources::COLORMAP_JET;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
181 widget->SetLayerStyle(1, s);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
182 }
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
183 #endif
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
184
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
185 widget_ = widget.get();
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
186 widget_->SetTransmitMouseOver(true);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 79
diff changeset
187 widget_->SetInteractor(context.AddInteractor(new Interactor));
66
298f375dcb68 LayerWidget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
188 context.SetCentralWidget(widget.release());
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 };
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 }