Mercurial > hg > orthanc-stone
comparison Applications/Samples/SingleVolumeApplication.h @ 120:063f7f3d9f14 wasm
fix 3d locations of the doses
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 04 Oct 2017 15:51:34 +0200 |
parents | ba83e38cf3ff |
children | e66b2c757790 |
comparison
equal
deleted
inserted
replaced
119:ba83e38cf3ff | 120:063f7f3d9f14 |
---|---|
52 | 52 |
53 RenderStyle s = widget_.GetLayerStyle(layer_); | 53 RenderStyle s = widget_.GetLayerStyle(layer_); |
54 | 54 |
55 if (image.FitWindowingToRange(s, slice.GetConverter())) | 55 if (image.FitWindowingToRange(s, slice.GetConverter())) |
56 { | 56 { |
57 //printf("ICI: %f => %f\n", s.customWindowCenter_, s.customWindowWidth_); | 57 //printf("Windowing: %f => %f\n", s.customWindowCenter_, s.customWindowWidth_); |
58 widget_.SetLayerStyle(layer_, s); | 58 widget_.SetLayerStyle(layer_, s); |
59 } | 59 } |
60 } | |
61 | |
62 virtual void MouseOver(CairoContext& context, | |
63 WorldSceneWidget& widget, | |
64 const ViewportGeometry& view, | |
65 double x, | |
66 double y, | |
67 IStatusBar* statusBar) | |
68 { | |
69 const LayerWidget& w = dynamic_cast<const LayerWidget&>(widget); | |
70 Vector p = w.GetSlice().MapSliceToWorldCoordinates(x, y); | |
71 printf("%f %f %f\n", p[0], p[1], p[2]); | |
60 } | 72 } |
61 | 73 |
62 public: | 74 public: |
63 Interactor(OrthancVolumeImage& volume, | 75 Interactor(OrthancVolumeImage& volume, |
64 LayerWidget& widget, | 76 LayerWidget& widget, |
183 widget->SetLayerStyle(0, s); | 195 widget->SetLayerStyle(0, s); |
184 } | 196 } |
185 #else | 197 #else |
186 std::auto_ptr<OrthancVolumeImage> ct(new OrthancVolumeImage(context.GetWebService(), false)); | 198 std::auto_ptr<OrthancVolumeImage> ct(new OrthancVolumeImage(context.GetWebService(), false)); |
187 //ct->ScheduleLoadSeries("dd069910-4f090474-7d2bba07-e5c10783-f9e4fb1d"); | 199 //ct->ScheduleLoadSeries("dd069910-4f090474-7d2bba07-e5c10783-f9e4fb1d"); |
188 //ct->ScheduleLoadSeries("3025d8df-a82f3b00-83942fa3-ee6a6be3-a8bf32e8"); | 200 ct->ScheduleLoadSeries("a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa"); // IBA |
189 ct->ScheduleLoadSeries("a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa"); | 201 //ct->ScheduleLoadSeries("03677739-1d8bca40-db1daf59-d74ff548-7f6fc9c0"); // 0522c0001 TCIA |
190 | 202 |
191 std::auto_ptr<OrthancVolumeImage> pet(new OrthancVolumeImage(context.GetWebService(), true)); | 203 std::auto_ptr<OrthancVolumeImage> pet(new OrthancVolumeImage(context.GetWebService(), true)); |
192 //pet->ScheduleLoadSeries("aabad2e7-80702b5d-e599d26c-4f13398e-38d58a9e"); | 204 //pet->ScheduleLoadSeries("aabad2e7-80702b5d-e599d26c-4f13398e-38d58a9e"); |
193 //pet->ScheduleLoadInstance("830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb"); | 205 pet->ScheduleLoadInstance("830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb"); // IBA 1 |
194 //pet->ScheduleLoadInstance("337876a1-a68a9718-f15abccd-38faafa1-b99b496a"); | 206 //pet->ScheduleLoadInstance("337876a1-a68a9718-f15abccd-38faafa1-b99b496a"); // IBA 2 |
195 pet->ScheduleLoadInstance("830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb"); | 207 //pet->ScheduleLoadInstance("830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb"); // IBA 3 |
208 //pet->ScheduleLoadInstance("269f26f4-0c83eeeb-2e67abbd-5467a40f-f1bec90c"); // 0522c0001 TCIA | |
196 | 209 |
197 widget->AddLayer(new VolumeImageSource(*ct)); | 210 widget->AddLayer(new VolumeImageSource(*ct)); |
198 widget->AddLayer(new VolumeImageSource(*pet)); | 211 widget->AddLayer(new VolumeImageSource(*pet)); |
199 | 212 |
200 context.AddInteractor(new Interactor(*pet, *widget, projection, 1)); | 213 //context.AddInteractor(new Interactor(*pet, *widget, projection, 1)); |
214 context.AddInteractor(new VolumeImageInteractor(*ct, *widget, projection)); | |
201 context.AddVolume(ct.release()); | 215 context.AddVolume(ct.release()); |
202 context.AddVolume(pet.release()); | 216 context.AddVolume(pet.release()); |
203 | 217 |
204 { | 218 { |
205 RenderStyle s; | 219 RenderStyle s; |
215 s.SetColor(255, 0, 0); // Draw missing PET layer in red | 229 s.SetColor(255, 0, 0); // Draw missing PET layer in red |
216 s.alpha_ = 0.5; | 230 s.alpha_ = 0.5; |
217 s.applyLut_ = true; | 231 s.applyLut_ = true; |
218 s.lut_ = Orthanc::EmbeddedResources::COLORMAP_JET; | 232 s.lut_ = Orthanc::EmbeddedResources::COLORMAP_JET; |
219 s.interpolation_ = ImageInterpolation_Linear; | 233 s.interpolation_ = ImageInterpolation_Linear; |
234 s.windowing_ = ImageWindowing_Custom; | |
235 s.customWindowCenter_ = 0; | |
236 s.customWindowWidth_ = 128; | |
220 widget->SetLayerStyle(1, s); | 237 widget->SetLayerStyle(1, s); |
221 } | 238 } |
222 #endif | 239 #endif |
223 | 240 |
224 | 241 |