18#ifndef itkCommandVnlIterationUpdate_h
19#define itkCommandVnlIterationUpdate_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 (itk::IterationEvent().CheckEvent(&event))
77 std::cout <<
m_Optimizer->GetCurrentIteration() <<
" = " <<
m_Optimizer->GetCurrentPosition() << std::endl;
79 else if (
typeid(event) ==
typeid(itk::EndEvent))
81 std::cout << std::endl
83 <<
"After " <<
m_Optimizer->GetCurrentIteration() <<
" iterations " << std::endl
84 <<
"Solution is = " <<
m_Optimizer->GetCurrentPosition() << std::endl
85 <<
"vnl report = " << std::endl;
86 m_Optimizer->GetOptimizer()->diagnose_outcome(std::cout);
116 m_Optimizer->AddObserver(itk::IterationEvent(),
this);
CommandVnlIterationUpdate()=default
WeakPointer< OptimizerType > m_Optimizer
void Execute(itk::Object *caller, const itk::EventObject &event) override
void Execute(const itk::Object *, 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