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