18#ifndef itkCommandIterationUpdatev4_h
19#define itkCommandIterationUpdatev4_h
32template <
typename TOptimizer>
70 if (
typeid(event) ==
typeid(itk::StartEvent))
72 std::cout << std::endl <<
"Position Value" << std::endl << std::endl;
74 else if (
typeid(event) ==
typeid(itk::IterationEvent))
79 std::cout <<
" : " <<
m_Optimizer->GetCurrentPosition();
81 std::cout << std::endl;
83 else if (
typeid(event) ==
typeid(itk::EndEvent))
85 std::cout << std::endl
87 <<
"After " <<
m_Optimizer->GetCurrentIteration() <<
" iterations " << std::endl;
90 std::cout <<
" Solution is = " <<
m_Optimizer->GetCurrentPosition() << std::endl;
92 std::cout <<
"Solution value = " <<
m_Optimizer->GetValue() << std::endl
93 <<
"Stop condition = " <<
m_Optimizer->GetStopConditionDescription() << std::endl;
123 m_Optimizer->AddObserver(itk::IterationEvent(),
this);
130 itkSetMacro(PrintParameters,
bool);
131 itkGetMacro(PrintParameters,
bool);
132 itkBooleanMacro(PrintParameters);
void Execute(const itk::Object *, const itk::EventObject &event) override
WeakPointer< OptimizerType > m_Optimizer
CommandIterationUpdatev4 Self
CommandIterationUpdatev4()
void Execute(itk::Object *caller, const itk::EventObject &event) override
itk::SmartPointer< Self > Pointer
void SetOptimizer(OptimizerType *optimizer)
itk::SmartPointer< const Self > ConstPointer
Superclass for callback/observer methods.
Abstraction of the Events used to communicating among filters and with GUIs.
Base class for most ITK classes.
Implements transparent reference counting.
Implements a weak reference to an object.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....