18#ifndef itkCommandVnlIterationUpdate_h
19#define itkCommandVnlIterationUpdate_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 (itk::IterationEvent().CheckEvent(&event))
76 std::cout <<
m_Optimizer->GetCurrentIteration() <<
" = " <<
m_Optimizer->GetCurrentPosition() << std::endl;
78 else if (
typeid(event) ==
typeid(itk::EndEvent))
80 std::cout << std::endl
82 <<
"After " <<
m_Optimizer->GetCurrentIteration() <<
" iterations " << std::endl
83 <<
"Solution is = " <<
m_Optimizer->GetCurrentPosition() << std::endl
84 <<
"vnl report = " << std::endl;
85 m_Optimizer->GetOptimizer()->diagnose_outcome(std::cout);
115 m_Optimizer->AddObserver(itk::IterationEvent(),
this);
CommandVnlIterationUpdate()=default
WeakPointer< OptimizerType > m_Optimizer
CommandVnlIterationUpdate Self
itk::SmartPointer< const Self > ConstPointer
itk::SmartPointer< Self > Pointer
void Execute(itk::Object *caller, const itk::EventObject &event) override
void Execute(const 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.
Implements transparent reference counting.
Implements a weak reference to an object.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....