9 #ifndef __FWITKIO_HELPER_PROGRESSITKTOFW_HXX__ 10 #define __FWITKIO_HELPER_PROGRESSITKTOFW_HXX__ 12 #include <fwCore/base.hpp> 14 #include <itkCommand.h> 15 #include <itkEventObject.h> 16 #include <itkLightProcessObject.h> 17 #include <itkSmartPointer.h> 34 typedef itk::SmartPointer<LocalCommand> Pointer;
39 void Execute(itk::Object* caller,
const itk::EventObject& event)
override 41 itk::LightProcessObject* po =
dynamic_cast<itk::LightProcessObject*
>(caller);
46 float percent = po->GetProgress();
47 OSLM_TRACE(
"LocalCommand::Execute '" << m_msg <<
"' " << percent );
48 m_adviser->notifyProgress( percent, m_msg );
53 void Execute(
const itk::Object* caller,
const itk::EventObject& event)
override 55 itk::LightProcessObject* po =
dynamic_cast<itk::LightProcessObject*
>(
const_cast<itk::Object*
>(caller));
65 template<
typename OBSERVEE >
68 m_observee( observee),
69 m_obsTag(std::numeric_limits<unsigned long>::max()),
72 typename LocalCommand::Pointer itkCallBack;
73 itkCallBack = LocalCommand::New();
74 itkCallBack->m_msg = msg;
75 itkCallBack->m_adviser = observer;
76 m_obsTag = m_observee->AddObserver(itk::ProgressEvent(), itkCallBack );
82 template<
typename OBSERVEE >
87 m_observee->RemoveObserver(m_obsTag);
93 #endif // __FWITKIO_HELPER_PROGRESSITKTOFW_HXX__
#define OSLM_TRACE(message)
The namespace fwItkIO contains reader, writer and helper for itk image.