18 #ifndef itkCommandIterationUpdate_h
19 #define itkCommandIterationUpdate_h
31 template <
typename TOptimizer >
68 if(
typeid( event ) ==
typeid( itk::StartEvent ) )
70 std::cout << std::endl <<
"Position Value";
71 std::cout << std::endl << std::endl;
73 else if(
typeid( event ) ==
typeid( itk::IterationEvent ) )
75 std::cout <<
m_Optimizer->GetCurrentIteration() <<
" = ";
77 std::cout <<
m_Optimizer->GetCurrentPosition() << std::endl;
79 else if(
typeid( event ) ==
typeid( itk::EndEvent ) )
81 std::cout << std::endl << std::endl;
82 std::cout <<
"After " <<
m_Optimizer->GetCurrentIteration();
83 std::cout <<
" iterations " << std::endl;
84 std::cout <<
"Solution is = " <<
m_Optimizer->GetCurrentPosition();
85 std::cout << std::endl;
86 std::cout <<
"With value = " <<
m_Optimizer->GetValue();
87 std::cout << std::endl;
88 std::cout <<
"Stop condition = " <<
m_Optimizer->GetStopCondition();
89 std::cout << std::endl;
119 m_Optimizer->AddObserver( itk::IterationEvent(),
this );
WeakPointer< OptimizerType > m_Optimizer
void SetOptimizer(OptimizerType *optimizer)
itk::SmartPointer< const Self > ConstPointer
virtual void Execute(itk::Object *caller, const itk::EventObject &event) override
virtual void Execute(const itk::Object *, const itk::EventObject &event) override
Abstraction of the Events used to communicating among filters and with GUIs.
Base class for most ITK classes.
itk::SmartPointer< Self > Pointer
CommandIterationUpdate Self
Superclass for callback/observer methods.