18 #ifndef itkCommandIterationUpdatev4_h
19 #define itkCommandIterationUpdatev4_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(
typeid( event ) ==
typeid( itk::IterationEvent ) )
75 std::cout <<
m_Optimizer->GetCurrentIteration() <<
" = ";
79 std::cout <<
" : " <<
m_Optimizer->GetCurrentPosition();
81 std::cout << std::endl;
83 else if(
typeid( event ) ==
typeid( itk::EndEvent ) )
85 std::cout << std::endl << std::endl;
86 std::cout <<
"After " <<
m_Optimizer->GetCurrentIteration();
87 std::cout <<
" iterations " << std::endl;
90 std::cout <<
" Solution is = " <<
m_Optimizer->GetCurrentPosition();
91 std::cout << std::endl;
93 std::cout <<
"Solution value = " <<
m_Optimizer->GetValue();
94 std::cout << std::endl;
95 std::cout <<
"Stop condition = " <<
m_Optimizer->GetStopConditionDescription();
96 std::cout << std::endl;
126 m_Optimizer->AddObserver( itk::IterationEvent(),
this );
133 itkSetMacro( PrintParameters,
bool);
134 itkGetMacro( PrintParameters,
bool);
135 itkBooleanMacro( PrintParameters );
CommandIterationUpdatev4 Self
virtual void Execute(itk::Object *caller, const itk::EventObject &event) override
void SetOptimizer(OptimizerType *optimizer)
Abstraction of the Events used to communicating among filters and with GUIs.
virtual void Execute(const itk::Object *, const itk::EventObject &event) override
Implementation of the Command Pattern to be invoked every iteration.
itk::SmartPointer< Self > Pointer
WeakPointer< OptimizerType > m_Optimizer
CommandIterationUpdatev4()
itk::SmartPointer< const Self > ConstPointer
Base class for most ITK classes.
Superclass for callback/observer methods.