18#ifndef itkCommandIterationUpdate_h
19#define itkCommandIterationUpdate_h
32template <
typename TOptimizer>
71 if (
typeid(event) ==
typeid(itk::StartEvent))
73 std::cout << std::endl <<
"Position Value" << std::endl << std::endl;
75 else if (
typeid(event) ==
typeid(itk::IterationEvent))
80 else if (
typeid(event) ==
typeid(itk::EndEvent))
82 std::cout << std::endl
84 <<
"After " <<
m_Optimizer->GetCurrentIteration() <<
" iterations " << std::endl
85 <<
"Solution is = " <<
m_Optimizer->GetCurrentPosition() << std::endl
86 <<
"With value = " <<
m_Optimizer->GetValue() << std::endl
87 <<
"Stop condition = " <<
m_Optimizer->GetStopCondition() << std::endl;
117 m_Optimizer->AddObserver(itk::IterationEvent(),
this);
void Execute(const itk::Object *, const itk::EventObject &event) override
void SetOptimizer(OptimizerType *optimizer)
CommandIterationUpdate()=default
void Execute(itk::Object *caller, const itk::EventObject &event) override
WeakPointer< OptimizerType > m_Optimizer
Superclass for callback/observer methods.
Abstraction of the Events used to communicating among filters and with GUIs.
Base class for most ITK classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT Command