18#ifndef itkCommandIterationUpdatev4_h
19#define itkCommandIterationUpdatev4_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 std::cout <<
" : " <<
m_Optimizer->GetCurrentPosition();
82 std::cout << std::endl;
84 else if (
typeid(event) ==
typeid(itk::EndEvent))
86 std::cout << std::endl
88 <<
"After " <<
m_Optimizer->GetCurrentIteration() <<
" iterations " << std::endl;
91 std::cout <<
" Solution is = " <<
m_Optimizer->GetCurrentPosition() << std::endl;
93 std::cout <<
"Solution value = " <<
m_Optimizer->GetValue() << std::endl
94 <<
"Stop condition = " <<
m_Optimizer->GetStopConditionDescription() << std::endl;
124 m_Optimizer->AddObserver(itk::IterationEvent(),
this);
131 itkSetMacro(PrintParameters,
bool);
132 itkGetMacro(PrintParameters,
bool);
133 itkBooleanMacro(PrintParameters);
Implementation of the Command Pattern to be invoked every iteration.
void Execute(const itk::Object *, const itk::EventObject &event) override
WeakPointer< OptimizerType > m_Optimizer
CommandIterationUpdatev4()
void Execute(itk::Object *caller, const itk::EventObject &event) override
void SetOptimizer(OptimizerType *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