Mercurial > hg > orthanc-stone
comparison Samples/Sdl/Loader.cpp @ 828:28f99af358fa
Merge + FusionMprSdl
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 29 May 2019 16:15:04 +0200 |
parents | 2fd96a637a59 270c31978df1 |
children | 47fc7919977d |
comparison
equal
deleted
inserted
replaced
827:2fd96a637a59 | 828:28f99af358fa |
---|---|
164 | 164 |
165 void Handle(const OrthancStone::DicomVolumeImage::GeometryReadyMessage& message) | 165 void Handle(const OrthancStone::DicomVolumeImage::GeometryReadyMessage& message) |
166 { | 166 { |
167 printf("Geometry ready\n"); | 167 printf("Geometry ready\n"); |
168 | 168 |
169 //plane_ = message.GetOrigin().GetGeometry().GetSagittalGeometry(); | 169 plane_ = message.GetOrigin().GetGeometry().GetSagittalGeometry(); |
170 //plane_ = message.GetOrigin().GetGeometry().GetAxialGeometry(); | 170 //plane_ = message.GetOrigin().GetGeometry().GetAxialGeometry(); |
171 plane_ = message.GetOrigin().GetGeometry().GetCoronalGeometry(); | 171 //plane_ = message.GetOrigin().GetGeometry().GetCoronalGeometry(); |
172 plane_.SetOrigin(message.GetOrigin().GetGeometry().GetCoordinates(0.5f, 0.5f, 0.5f)); | 172 plane_.SetOrigin(message.GetOrigin().GetGeometry().GetCoordinates(0.5f, 0.5f, 0.5f)); |
173 | 173 |
174 Refresh(); | 174 Refresh(); |
175 } | 175 } |
176 | 176 |
300 | 300 |
301 | 301 |
302 void Run(OrthancStone::NativeApplicationContext& context, | 302 void Run(OrthancStone::NativeApplicationContext& context, |
303 OrthancStone::ThreadedOracle& oracle) | 303 OrthancStone::ThreadedOracle& oracle) |
304 { | 304 { |
305 // the oracle has been supplied with the context (as an IEmitter) upon | |
306 // creation | |
305 boost::shared_ptr<OrthancStone::DicomVolumeImage> ct(new OrthancStone::DicomVolumeImage); | 307 boost::shared_ptr<OrthancStone::DicomVolumeImage> ct(new OrthancStone::DicomVolumeImage); |
306 boost::shared_ptr<OrthancStone::DicomVolumeImage> dose(new OrthancStone::DicomVolumeImage); | 308 boost::shared_ptr<OrthancStone::DicomVolumeImage> dose(new OrthancStone::DicomVolumeImage); |
307 | 309 |
308 | 310 |
309 boost::shared_ptr<Toto> toto; | 311 boost::shared_ptr<Toto> toto; |
312 boost::shared_ptr<OrthancStone::DicomStructureSetLoader> rtstructLoader; | 314 boost::shared_ptr<OrthancStone::DicomStructureSetLoader> rtstructLoader; |
313 | 315 |
314 { | 316 { |
315 OrthancStone::NativeApplicationContext::WriterLock lock(context); | 317 OrthancStone::NativeApplicationContext::WriterLock lock(context); |
316 toto.reset(new Toto(oracle, lock.GetOracleObservable())); | 318 toto.reset(new Toto(oracle, lock.GetOracleObservable())); |
319 | |
320 // the oracle is used to schedule commands | |
321 // the oracleObservable is used by the loaders to: | |
322 // - request the broker (lifetime mgmt) | |
323 // - register the loader callbacks (called indirectly by the oracle) | |
317 ctLoader.reset(new OrthancStone::OrthancSeriesVolumeProgressiveLoader(ct, oracle, lock.GetOracleObservable())); | 324 ctLoader.reset(new OrthancStone::OrthancSeriesVolumeProgressiveLoader(ct, oracle, lock.GetOracleObservable())); |
318 doseLoader.reset(new OrthancStone::OrthancMultiframeVolumeLoader(dose, oracle, lock.GetOracleObservable())); | 325 doseLoader.reset(new OrthancStone::OrthancMultiframeVolumeLoader(dose, oracle, lock.GetOracleObservable())); |
319 rtstructLoader.reset(new OrthancStone::DicomStructureSetLoader(oracle, lock.GetOracleObservable())); | 326 rtstructLoader.reset(new OrthancStone::DicomStructureSetLoader(oracle, lock.GetOracleObservable())); |
320 } | 327 } |
321 | 328 |