18 #ifndef itkCommandVnlIterationUpdate_h
19 #define itkCommandVnlIterationUpdate_h
31 template <
typename TOptimizer >
68 if(
typeid( event ) ==
typeid( itk::StartEvent ) )
70 std::cout << std::endl <<
"Position Value";
71 std::cout << std::endl << std::endl;
73 else if( itk::IterationEvent().CheckEvent( &event ) )
75 std::cout <<
m_Optimizer->GetCurrentIteration() <<
" = ";
76 std::cout <<
m_Optimizer->GetCurrentPosition() << std::endl;
78 else if(
typeid( event ) ==
typeid( itk::EndEvent ) )
80 std::cout << std::endl << std::endl;
81 std::cout <<
"After " <<
m_Optimizer->GetCurrentIteration();
82 std::cout <<
" iterations " << std::endl;
83 std::cout <<
"Solution is = " <<
m_Optimizer->GetCurrentPosition();
84 std::cout << std::endl;
85 std::cout <<
"vnl report = " << std::endl;
86 m_Optimizer->GetOptimizer()->diagnose_outcome( std::cout );
116 m_Optimizer->AddObserver( itk::IterationEvent(),
this );
CommandVnlIterationUpdate Self
void Execute(const itk::Object *, const itk::EventObject &event) override
CommandVnlIterationUpdate()=default
void SetOptimizer(OptimizerType *optimizer)
Abstraction of the Events used to communicating among filters and with GUIs.
class ITK_FORWARD_EXPORT Command
void Execute(itk::Object *caller, const itk::EventObject &event) override
Base class for most ITK classes.
Superclass for callback/observer methods.
WeakPointer< OptimizerType > m_Optimizer