17 #ifndef MITKRIGIDREGISTRATIONOBSERVER_H
18 #define MITKRIGIDREGISTRATIONOBSERVER_H
21 #include "itkCommand.h"
22 #include "itkSingleValuedNonLinearOptimizer.h"
24 #include <itkAmoebaOptimizer.h>
25 #include <itkConjugateGradientOptimizer.h>
26 #include <itkExhaustiveOptimizer.h>
27 #include <itkFRPROptimizer.h>
28 #include <itkGradientDescentOptimizer.h>
29 #include <itkLBFGSBOptimizer.h>
30 #include <itkLBFGSOptimizer.h>
31 #include <itkNormalVariateGenerator.h>
32 #include <itkOnePlusOneEvolutionaryOptimizer.h>
33 #include <itkPowellOptimizer.h>
34 #include <itkQuaternionRigidTransformGradientDescentOptimizer.h>
35 #include <itkRegularStepGradientDescentOptimizer.h>
36 #include <itkSPSAOptimizer.h>
37 #include <itkVersorRigid3DTransformOptimizer.h>
38 #include <itkVersorTransformOptimizer.h>
71 itkFactorylessNewMacro(Self) itkCloneMacro(Self)
83 void Execute(
itk::Object *caller, const
itk::EventObject &event) override;
89 void Execute(const
itk::Object *
object, const
itk::EventObject &event) override;
95 void AddStepsToDo(
int steps);
101 void SetRemainingProgress(
int steps);
109 double GetCurrentOptimizerValue();
116 itk::Array<
double> GetCurrentTranslation();
124 void SetStopOptimization(
bool stopOptimization);
129 void HandleOptimizationIterationEvent(OptimizerType *optimizer);
132 double m_OptimizerValue;
133 itk::Array<
double> m_Params;
134 bool m_StopOptimization;
144 itkFactorylessNewMacro(Self) itkCloneMacro(Self)
146 void Execute(
itk::Object *caller, const
itk::EventObject & )
override
150 if (registration == NULL)
153 OptimizerType *optimizer =
dynamic_cast<OptimizerType *
>(registration->GetOptimizer());
155 if (optimizer == NULL)
157 MITK_WARN(
"Pyramid.Registration.Command") <<
"No step adaptation possible with given optimizer, cast failed! ";
161 MITK_DEBUG <<
"\t - Pyramid level " << registration->GetCurrentLevel();
163 if (registration->GetCurrentLevel() == 0)
165 MITK_INFO(
"Pyramid.Registration.Command") <<
"First pyramid resolution level: ";
166 MITK_INFO(
"Pyramid.Registration.Command") <<
" Current settings: \n"
167 <<
" Step length: (" << optimizer->GetMinimumStepLength() <<
","
168 << optimizer->GetMaximumStepLength()
169 <<
"), Tolerance: " << optimizer->GetGradientMagnitudeTolerance()
170 <<
" Iterations: " << optimizer->GetNumberOfIterations();
174 optimizer->SetMaximumStepLength(optimizer->GetMaximumStepLength() * 0.25f);
175 optimizer->SetMinimumStepLength(optimizer->GetMinimumStepLength() * 0.1f);
176 optimizer->SetGradientMagnitudeTolerance(optimizer->GetGradientMagnitudeTolerance() * 0.1f);
177 optimizer->SetNumberOfIterations(optimizer->GetNumberOfIterations() * 1.5f);
179 MITK_INFO(
"Pyramid.Registration.Command") <<
" Current settings: \n"
180 <<
" Step length: (" << optimizer->GetMinimumStepLength() <<
","
181 << optimizer->GetMaximumStepLength()
182 <<
"), Tolerance: " << optimizer->GetGradientMagnitudeTolerance()
183 <<
" Iterations: " << optimizer->GetNumberOfIterations();
186 void Execute(
const itk::Object * ,
const itk::EventObject & )
override {}
191 #endif // MITKRIGIDREGISTRATIONOBSERVER_H
Observer to react on rigid registration optimizer events.
#define MITKRIGIDREGISTRATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
RigidRegistrationObserver Self
itk::SmartPointer< Self > Pointer
#define mitkClassMacroItkParent(className, SuperClassName)
OptimizerType * OptimizerPointer
void Execute(const itk::Object *, const itk::EventObject &) override
itk::SingleValuedNonLinearOptimizer OptimizerType
itk::RegularStepGradientDescentBaseOptimizer OptimizerType
::map::core::RegistrationBase RegistrationType