Mercurial > hg > orthanc-stone
comparison Applications/Samples/SingleFrameApplication.h @ 235:ce4405d98b92 am
Added SimpleViewerApplication (working in SDL)
author | am@osimis.io |
---|---|
date | Tue, 19 Jun 2018 16:02:41 +0200 |
parents | 5412adf19980 |
children | 37ab9d83dc9b |
comparison
equal
deleted
inserted
replaced
234:9afb50d1ac14 | 235:ce4405d98b92 |
---|---|
212 source_(NULL), | 212 source_(NULL), |
213 slice_(0) | 213 slice_(0) |
214 { | 214 { |
215 } | 215 } |
216 | 216 |
217 virtual void DeclareCommandLineOptions(boost::program_options::options_description& options) | 217 virtual void DeclareStartupOptions(boost::program_options::options_description& options) |
218 { | 218 { |
219 boost::program_options::options_description generic("Sample options"); | 219 boost::program_options::options_description generic("Sample options"); |
220 generic.add_options() | 220 generic.add_options() |
221 ("instance", boost::program_options::value<std::string>(), | 221 ("instance", boost::program_options::value<std::string>(), |
222 "Orthanc ID of the instance") | 222 "Orthanc ID of the instance") |
227 ; | 227 ; |
228 | 228 |
229 options.add(generic); | 229 options.add(generic); |
230 } | 230 } |
231 | 231 |
232 virtual void Initialize(BasicApplicationContext& context, | 232 virtual void Initialize(IStatusBar& statusBar, |
233 IStatusBar& statusBar, | |
234 const boost::program_options::variables_map& parameters) | 233 const boost::program_options::variables_map& parameters) |
235 { | 234 { |
236 using namespace OrthancStone; | 235 using namespace OrthancStone; |
237 | 236 |
238 statusBar.SetMessage("Use the key \"s\" to reinitialize the layout"); | 237 statusBar.SetMessage("Use the key \"s\" to reinitialize the layout"); |
248 | 247 |
249 std::auto_ptr<LayerWidget> widget(new LayerWidget); | 248 std::auto_ptr<LayerWidget> widget(new LayerWidget); |
250 | 249 |
251 #if 1 | 250 #if 1 |
252 std::auto_ptr<OrthancFrameLayerSource> layer | 251 std::auto_ptr<OrthancFrameLayerSource> layer |
253 (new OrthancFrameLayerSource(context.GetWebService())); | 252 (new OrthancFrameLayerSource(context_->GetWebService())); |
254 //layer->SetImageQuality(SliceImageQuality_Jpeg50); | 253 //layer->SetImageQuality(SliceImageQuality_Jpeg50); |
255 layer->LoadFrame(instance, frame); | 254 layer->LoadFrame(instance, frame); |
256 //layer->LoadSeries("6f1b492a-e181e200-44e51840-ef8db55e-af529ab6"); | 255 //layer->LoadSeries("6f1b492a-e181e200-44e51840-ef8db55e-af529ab6"); |
257 layer->Register(*this); | 256 layer->Register(*this); |
258 source_ = layer.get(); | 257 source_ = layer.get(); |
269 widget->SetLayerStyle(0, s); | 268 widget->SetLayerStyle(0, s); |
270 #else | 269 #else |
271 // 0178023P** | 270 // 0178023P** |
272 // Extent of the CT layer: (-35.068 -20.368) => (34.932 49.632) | 271 // Extent of the CT layer: (-35.068 -20.368) => (34.932 49.632) |
273 std::auto_ptr<OrthancFrameLayerSource> ct; | 272 std::auto_ptr<OrthancFrameLayerSource> ct; |
274 ct.reset(new OrthancFrameLayerSource(context.GetWebService())); | 273 ct.reset(new OrthancFrameLayerSource(context_->GetWebService())); |
275 //ct->LoadInstance("c804a1a2-142545c9-33b32fe2-3df4cec0-a2bea6d6", 0); | 274 //ct->LoadInstance("c804a1a2-142545c9-33b32fe2-3df4cec0-a2bea6d6", 0); |
276 //ct->LoadInstance("4bd4304f-47478948-71b24af2-51f4f1bc-275b6c1b", 0); // BAD SLICE | 275 //ct->LoadInstance("4bd4304f-47478948-71b24af2-51f4f1bc-275b6c1b", 0); // BAD SLICE |
277 //ct->SetImageQuality(SliceImageQuality_Jpeg50); | 276 //ct->SetImageQuality(SliceImageQuality_Jpeg50); |
278 ct->LoadSeries("dd069910-4f090474-7d2bba07-e5c10783-f9e4fb1d"); | 277 ct->LoadSeries("dd069910-4f090474-7d2bba07-e5c10783-f9e4fb1d"); |
279 | 278 |
280 ct->Register(*this); | 279 ct->Register(*this); |
281 widget->AddLayer(ct.release()); | 280 widget->AddLayer(ct.release()); |
282 | 281 |
283 std::auto_ptr<OrthancFrameLayerSource> pet; | 282 std::auto_ptr<OrthancFrameLayerSource> pet; |
284 pet.reset(new OrthancFrameLayerSource(context.GetWebService())); | 283 pet.reset(new OrthancFrameLayerSource(context_->GetWebService())); |
285 //pet->LoadInstance("a1c4dc6b-255d27f0-88069875-8daed730-2f5ee5c6", 0); | 284 //pet->LoadInstance("a1c4dc6b-255d27f0-88069875-8daed730-2f5ee5c6", 0); |
286 pet->LoadSeries("aabad2e7-80702b5d-e599d26c-4f13398e-38d58a9e"); | 285 pet->LoadSeries("aabad2e7-80702b5d-e599d26c-4f13398e-38d58a9e"); |
287 pet->Register(*this); | 286 pet->Register(*this); |
288 source_ = pet.get(); | 287 source_ = pet.get(); |
289 widget->AddLayer(pet.release()); | 288 widget->AddLayer(pet.release()); |
307 } | 306 } |
308 #endif | 307 #endif |
309 | 308 |
310 widget_ = widget.get(); | 309 widget_ = widget.get(); |
311 widget_->SetTransmitMouseOver(true); | 310 widget_->SetTransmitMouseOver(true); |
312 widget_->SetInteractor(context.AddInteractor(new Interactor(*this))); | 311 widget_->SetInteractor(context_->AddInteractor(new Interactor(*this))); |
313 context.SetCentralWidget(widget.release()); | 312 context_->SetCentralWidget(widget.release()); |
314 } | 313 } |
315 }; | 314 }; |
316 } | 315 } |
317 } | 316 } |