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()
itk::SmartPointer< const Self > ConstPointer
CommandVnlIterationUpdate Self
void SetOptimizer(OptimizerType *optimizer)
virtual void Execute(itk::Object *caller, const itk::EventObject &event) override
virtual void Execute(const itk::Object *, const itk::EventObject &event) override
Abstraction of the Events used to communicating among filters and with GUIs.
Base class for most ITK classes.
Superclass for callback/observer methods.
WeakPointer< OptimizerType > m_Optimizer
itk::SmartPointer< Self > Pointer