18 #ifndef itkCommandIterationUpdate_h
19 #define itkCommandIterationUpdate_h
32 template <
typename TOptimizer>
71 if (
typeid(event) ==
typeid(itk::StartEvent))
73 std::cout << std::endl <<
"Position Value";
74 std::cout << std::endl << std::endl;
76 else if (
typeid(event) ==
typeid(itk::IterationEvent))
78 std::cout <<
m_Optimizer->GetCurrentIteration() <<
" = ";
80 std::cout <<
m_Optimizer->GetCurrentPosition() << std::endl;
82 else if (
typeid(event) ==
typeid(itk::EndEvent))
84 std::cout << std::endl << std::endl;
85 std::cout <<
"After " <<
m_Optimizer->GetCurrentIteration();
86 std::cout <<
" iterations " << std::endl;
87 std::cout <<
"Solution is = " <<
m_Optimizer->GetCurrentPosition();
88 std::cout << std::endl;
89 std::cout <<
"With value = " <<
m_Optimizer->GetValue();
90 std::cout << std::endl;
91 std::cout <<
"Stop condition = " <<
m_Optimizer->GetStopCondition();
92 std::cout << std::endl;
122 m_Optimizer->AddObserver(itk::IterationEvent(),
this);