go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
elastix::FiniteDifferenceGradientDescent< TElastix > Class Template Reference

#include <elxFiniteDifferenceGradientDescent.h>

Detailed Description

template<class TElastix>
class elastix::FiniteDifferenceGradientDescent< TElastix >

An optimizer based on the itk::FiniteDifferenceGradientDescentOptimizer.

This class is a wrap around the FiniteDifferenceGradientDescentOptimizer class. It takes care of setting parameters and printing progress information. For more information about the optimisation method, please read the documentation of the FiniteDifferenceGradientDescentOptimizer class.

Watch out for this optimizer; it may be very slow....

The parameters used in this class are:

Parameters:

Optimizer: Select this optimizer as follows:
(Optimizer "FiniteDifferenceGradientDescent")

MaximumNumberOfIterations: The maximum number of iterations in each resolution.
example: (MaximumNumberOfIterations 100 100 50)
Default value: 500.

SP_a: The gain $a(k)$ at each iteration $k$ is defined by
$\quad a(k) =  SP\_a / (SP\_A + k + 1)^{SP\_alpha}$.
SP_a can be defined for each resolution.
example: (SP_a 3200.0 3200.0 1600.0)
The default value is 400.0. Tuning this variable for you specific problem is recommended.

SP_A: The gain $a(k)$ at each iteration $k$ is defined by
$\quad a(k) =  SP\_a / (SP\_A + k + 1)^{SP\_alpha}$.
SP_A can be defined for each resolution.
example: (SP_A 50.0 50.0 100.0)
The default/recommended value is 50.0.

SP_alpha: The gain $a(k)$ at each iteration $k$ is defined by
$\quad a(k) =  SP\_a / (SP\_A + k + 1)^{SP\_alpha}$.
SP_alpha can be defined for each resolution.
example: (SP_alpha 0.602 0.602 0.602)
The default/recommended value is 0.602.

SP_c: The perturbation step size $c(k)$ at each iteration $k$ is defined by
$\quad c(k) =  SP\_c / ( k + 1)^{SP\_gamma}$.
SP_c can be defined for each resolution.
example: (SP_c 2.0 1.0 1.0)
The default value is 1.0.

SP_gamma: The perturbation step size $c(k)$ at each iteration $k$ is defined by
$\quad c(k) =  SP\_c / ( k + 1)^{SP\_gamma}$.
SP_gamma can be defined for each resolution.
example: (SP_gamma 0.101 0.101 0.101)
The default/recommended value is 0.101.

ShowMetricValues: Defines whether to compute/show the metric value in each iteration.
This flag can NOT be defined for each resolution.
example: (ShowMetricValues "true" )
Default value: "false". Note that turning this flag on increases computation time.

See also
FiniteDifferenceGradientDescentOptimizer

Definition at line 80 of file elxFiniteDifferenceGradientDescent.h.

+ Inheritance diagram for elastix::FiniteDifferenceGradientDescent< TElastix >:

Public Types

typedef Superclass2::ConfigurationPointer ConfigurationPointer
 
typedef Superclass2::ConfigurationType ConfigurationType
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass1::CostFunctionPointer CostFunctionPointer
 
typedef Superclass1::CostFunctionType CostFunctionType
 
typedef Superclass2::ElastixPointer ElastixPointer
 
typedef Superclass2::ElastixType ElastixType
 
typedef Superclass2::ITKBaseType ITKBaseType
 
typedef Superclass1::ParametersType ParametersType
 
typedef itk::SmartPointer< SelfPointer
 
typedef Superclass2::RegistrationPointer RegistrationPointer
 
typedef Superclass2::RegistrationType RegistrationType
 
typedef FiniteDifferenceGradientDescent Self
 
typedef Superclass1::StopConditionType StopConditionType
 
typedef FiniteDifferenceGradientDescentOptimizer Superclass1
 
typedef OptimizerBase< TElastix > Superclass2
 
- Public Types inherited from itk::FiniteDifferenceGradientDescentOptimizer
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef FiniteDifferenceGradientDescentOptimizer Self
 
enum  StopConditionType { MaximumNumberOfIterations , MetricError }
 
typedef ScaledSingleValuedNonLinearOptimizer Superclass
 
- Public Types inherited from itk::ScaledSingleValuedNonLinearOptimizer
typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::CostFunctionType CostFunctionType
 
typedef Superclass::DerivativeType DerivativeType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef ScaledCostFunctionType::Pointer ScaledCostFunctionPointer
 
typedef ScaledSingleValuedCostFunction ScaledCostFunctionType
 
typedef NonLinearOptimizer::ScalesType ScalesType
 
typedef ScaledSingleValuedNonLinearOptimizer Self
 
typedef SingleValuedNonLinearOptimizer Superclass
 
- Public Types inherited from elastix::OptimizerBase< TElastix >
typedef Superclass::ConfigurationPointer ConfigurationPointer
 
typedef Superclass::ConfigurationType ConfigurationType
 
typedef Superclass::ElastixPointer ElastixPointer
 
typedef Superclass::ElastixType ElastixType
 
typedef itk::Optimizer ITKBaseType
 
typedef ITKBaseType::ParametersType ParametersType
 
typedef Superclass::RegistrationPointer RegistrationPointer
 
typedef Superclass::RegistrationType RegistrationType
 
typedef OptimizerBase Self
 
typedef BaseComponentSE< TElastix > Superclass
 
- Public Types inherited from elastix::BaseComponentSE< TElastix >
typedef Configuration::Pointer ConfigurationPointer
 
typedef Configuration ConfigurationType
 
typedef itk::WeakPointer< ElastixTypeElastixPointer
 
typedef TElastix ElastixType
 
typedef RegistrationTypeRegistrationPointer
 
typedef ElastixType::RegistrationBaseType RegistrationType
 
typedef BaseComponentSE Self
 
typedef BaseComponent Superclass
 

Public Member Functions

void AfterEachIteration (void) override
 
void AfterEachResolution (void) override
 
void AfterRegistration (void) override
 
void BeforeEachResolution (void) override
 
void BeforeRegistration (void) override
 
 elxClassNameMacro ("FiniteDifferenceGradientDescent")
 
virtual const char * GetClassName () const
 
void StartOptimization (void) override
 
- Public Member Functions inherited from itk::FiniteDifferenceGradientDescentOptimizer
virtual void AdvanceOneStep (void)
 
virtual void ComputeCurrentValueOff ()
 
virtual void ComputeCurrentValueOn ()
 
virtual const char * GetClassName () const
 
virtual bool GetComputeCurrentValue () const
 
virtual unsigned long GetCurrentIteration () const
 
virtual double GetGradientMagnitude () const
 
virtual double GetLearningRate () const
 
virtual unsigned long GetNumberOfIterations () const
 
virtual double GetParam_a ()
 
virtual double GetParam_A ()
 
virtual double GetParam_alpha ()
 
virtual double GetParam_c ()
 
virtual double GetParam_gamma ()
 
virtual StopConditionType GetStopCondition () const
 
virtual double GetValue () const
 
void ResumeOptimization (void)
 
virtual void SetComputeCurrentValue (bool _arg)
 
virtual void SetNumberOfIterations (unsigned long _arg)
 
virtual void SetParam_a (double _arg)
 
virtual void SetParam_A (double _arg)
 
virtual void SetParam_alpha (double _arg)
 
virtual void SetParam_c (double _arg)
 
virtual void SetParam_gamma (double _arg)
 
void StartOptimization (void) override
 
void StopOptimization (void)
 
- Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
virtual const char * GetClassName () const
 
const ParametersTypeGetCurrentPosition (void) const override
 
virtual bool GetMaximize () const
 
virtual const ScaledCostFunctionTypeGetScaledCostFunction ()
 
virtual const ParametersTypeGetScaledCurrentPosition ()
 
bool GetUseScales (void) const
 
virtual void InitializeScales (void)
 
virtual void MaximizeOff ()
 
virtual void MaximizeOn ()
 
void SetCostFunction (CostFunctionType *costFunction) override
 
virtual void SetMaximize (bool _arg)
 
virtual void SetUseScales (bool arg)
 
- Public Member Functions inherited from elastix::OptimizerBase< TElastix >
void AfterRegistrationBase (void) override
 
void BeforeEachResolutionBase () override
 
virtual ITKBaseTypeGetAsITKBaseType (void)
 
virtual const ITKBaseTypeGetAsITKBaseType (void) const
 
virtual const char * GetClassName () const
 
virtual void SetCurrentPositionPublic (const ParametersType &param)
 
virtual void SetSinusScales (double amplitude, double frequency, unsigned long numberOfParameters)
 
- Public Member Functions inherited from elastix::BaseComponentSE< TElastix >
ConfigurationTypeGetConfiguration (void) const
 
ElastixTypeGetElastix (void) const
 
RegistrationPointer GetRegistration (void) const
 
 ITK_DISALLOW_COPY_AND_ASSIGN (BaseComponentSE)
 
void SetConfiguration (ConfigurationType *_arg)
 
void SetElastix (ElastixType *_arg)
 
- Public Member Functions inherited from elastix::BaseComponent
virtual void AfterEachIteration (void)
 
virtual void AfterEachIterationBase (void)
 
virtual void AfterEachResolution (void)
 
virtual void AfterEachResolutionBase (void)
 
virtual void AfterRegistration (void)
 
virtual void AfterRegistrationBase (void)
 
virtual int BeforeAll (void)
 
virtual int BeforeAllBase (void)
 
virtual void BeforeEachResolution (void)
 
virtual void BeforeEachResolutionBase (void)
 
virtual void BeforeRegistration (void)
 
virtual void BeforeRegistrationBase (void)
 
virtual const char * elxGetClassName (void) const
 
const char * GetComponentLabel (void) const
 
 ITK_DISALLOW_COPY_AND_ASSIGN (BaseComponent)
 
 itkTypeMacroNoParent (BaseComponent)
 
void SetComponentLabel (const char *label, unsigned int idx)
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::FiniteDifferenceGradientDescentOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from elastix::BaseComponent
static std::string ConvertSecondsToDHMS (const double totalSeconds, const unsigned int precision)
 
static void InitializeElastixExecutable ()
 
static bool IsElastixLibrary ()
 

Protected Member Functions

 FiniteDifferenceGradientDescent ()
 
 ~FiniteDifferenceGradientDescent () override
 
- Protected Member Functions inherited from itk::FiniteDifferenceGradientDescentOptimizer
virtual double Compute_a (unsigned long k) const
 
virtual double Compute_c (unsigned long k) const
 
 FiniteDifferenceGradientDescentOptimizer ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~FiniteDifferenceGradientDescentOptimizer () override
 
- Protected Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
virtual void GetScaledDerivative (const ParametersType &parameters, DerivativeType &derivative) const
 
virtual MeasureType GetScaledValue (const ParametersType &parameters) const
 
virtual void GetScaledValueAndDerivative (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ScaledSingleValuedNonLinearOptimizer ()
 
void SetCurrentPosition (const ParametersType &param) override
 
virtual void SetScaledCurrentPosition (const ParametersType &parameters)
 
 ~ScaledSingleValuedNonLinearOptimizer () override
 
- Protected Member Functions inherited from elastix::OptimizerBase< TElastix >
virtual bool GetNewSamplesEveryIteration (void) const
 
 OptimizerBase ()
 
virtual void SelectNewSamples (void)
 
 ~OptimizerBase () override
 
- Protected Member Functions inherited from elastix::BaseComponentSE< TElastix >
 BaseComponentSE ()=default
 
 ~BaseComponentSE () override=default
 
- Protected Member Functions inherited from elastix::BaseComponent
 BaseComponent ()=default
 
virtual ~BaseComponent ()=default
 

Protected Attributes

bool m_ShowMetricValues
 
- Protected Attributes inherited from itk::FiniteDifferenceGradientDescentOptimizer
bool m_ComputeCurrentValue
 
DerivativeType m_Gradient
 
double m_GradientMagnitude
 
double m_LearningRate
 
- Protected Attributes inherited from itk::ScaledSingleValuedNonLinearOptimizer
ScaledCostFunctionPointer m_ScaledCostFunction
 
ParametersType m_ScaledCurrentPosition
 
- Protected Attributes inherited from elastix::BaseComponentSE< TElastix >
ConfigurationPointer m_Configuration {}
 
ElastixPointer m_Elastix {}
 
RegistrationPointer m_Registration {}
 

Private Member Functions

 FiniteDifferenceGradientDescent (const Self &)
 
void operator= (const Self &)
 

Member Typedef Documentation

◆ ConfigurationPointer

template<class TElastix >
typedef Superclass2::ConfigurationPointer elastix::FiniteDifferenceGradientDescent< TElastix >::ConfigurationPointer

Definition at line 116 of file elxFiniteDifferenceGradientDescent.h.

◆ ConfigurationType

template<class TElastix >
typedef Superclass2::ConfigurationType elastix::FiniteDifferenceGradientDescent< TElastix >::ConfigurationType

Definition at line 115 of file elxFiniteDifferenceGradientDescent.h.

◆ ConstPointer

template<class TElastix >
typedef itk::SmartPointer< const Self > elastix::FiniteDifferenceGradientDescent< TElastix >::ConstPointer

Definition at line 93 of file elxFiniteDifferenceGradientDescent.h.

◆ CostFunctionPointer

template<class TElastix >
typedef Superclass1::CostFunctionPointer elastix::FiniteDifferenceGradientDescent< TElastix >::CostFunctionPointer

Definition at line 109 of file elxFiniteDifferenceGradientDescent.h.

◆ CostFunctionType

template<class TElastix >
typedef Superclass1::CostFunctionType elastix::FiniteDifferenceGradientDescent< TElastix >::CostFunctionType

Typedef's inherited from Superclass1.

Definition at line 108 of file elxFiniteDifferenceGradientDescent.h.

◆ ElastixPointer

template<class TElastix >
typedef Superclass2::ElastixPointer elastix::FiniteDifferenceGradientDescent< TElastix >::ElastixPointer

Definition at line 114 of file elxFiniteDifferenceGradientDescent.h.

◆ ElastixType

template<class TElastix >
typedef Superclass2::ElastixType elastix::FiniteDifferenceGradientDescent< TElastix >::ElastixType

Typedef's inherited from Elastix.

Definition at line 113 of file elxFiniteDifferenceGradientDescent.h.

◆ ITKBaseType

template<class TElastix >
typedef Superclass2::ITKBaseType elastix::FiniteDifferenceGradientDescent< TElastix >::ITKBaseType

Definition at line 119 of file elxFiniteDifferenceGradientDescent.h.

◆ ParametersType

template<class TElastix >
typedef Superclass1::ParametersType elastix::FiniteDifferenceGradientDescent< TElastix >::ParametersType

Typedef for the ParametersType.

Definition at line 122 of file elxFiniteDifferenceGradientDescent.h.

◆ Pointer

template<class TElastix >
typedef itk::SmartPointer< Self > elastix::FiniteDifferenceGradientDescent< TElastix >::Pointer

Definition at line 92 of file elxFiniteDifferenceGradientDescent.h.

◆ RegistrationPointer

template<class TElastix >
typedef Superclass2::RegistrationPointer elastix::FiniteDifferenceGradientDescent< TElastix >::RegistrationPointer

Definition at line 118 of file elxFiniteDifferenceGradientDescent.h.

◆ RegistrationType

template<class TElastix >
typedef Superclass2::RegistrationType elastix::FiniteDifferenceGradientDescent< TElastix >::RegistrationType

Definition at line 117 of file elxFiniteDifferenceGradientDescent.h.

◆ Self

template<class TElastix >
typedef FiniteDifferenceGradientDescent elastix::FiniteDifferenceGradientDescent< TElastix >::Self

Standard ITK.

Definition at line 89 of file elxFiniteDifferenceGradientDescent.h.

◆ StopConditionType

template<class TElastix >
typedef Superclass1::StopConditionType elastix::FiniteDifferenceGradientDescent< TElastix >::StopConditionType

Definition at line 110 of file elxFiniteDifferenceGradientDescent.h.

◆ Superclass1

template<class TElastix >
typedef FiniteDifferenceGradientDescentOptimizer elastix::FiniteDifferenceGradientDescent< TElastix >::Superclass1

Definition at line 90 of file elxFiniteDifferenceGradientDescent.h.

◆ Superclass2

template<class TElastix >
typedef OptimizerBase< TElastix > elastix::FiniteDifferenceGradientDescent< TElastix >::Superclass2

Definition at line 91 of file elxFiniteDifferenceGradientDescent.h.

Constructor & Destructor Documentation

◆ FiniteDifferenceGradientDescent() [1/2]

template<class TElastix >
elastix::FiniteDifferenceGradientDescent< TElastix >::FiniteDifferenceGradientDescent ( )
protected

◆ ~FiniteDifferenceGradientDescent()

template<class TElastix >
elastix::FiniteDifferenceGradientDescent< TElastix >::~FiniteDifferenceGradientDescent ( )
inlineoverrideprotected

Definition at line 142 of file elxFiniteDifferenceGradientDescent.h.

◆ FiniteDifferenceGradientDescent() [2/2]

template<class TElastix >
elastix::FiniteDifferenceGradientDescent< TElastix >::FiniteDifferenceGradientDescent ( const Self )
private

Member Function Documentation

◆ AfterEachIteration()

template<class TElastix >
void elastix::FiniteDifferenceGradientDescent< TElastix >::AfterEachIteration ( void  )
overridevirtual

Reimplemented from elastix::BaseComponent.

◆ AfterEachResolution()

template<class TElastix >
void elastix::FiniteDifferenceGradientDescent< TElastix >::AfterEachResolution ( void  )
overridevirtual

Reimplemented from elastix::BaseComponent.

◆ AfterRegistration()

template<class TElastix >
void elastix::FiniteDifferenceGradientDescent< TElastix >::AfterRegistration ( void  )
overridevirtual

Reimplemented from elastix::BaseComponent.

◆ BeforeEachResolution()

template<class TElastix >
void elastix::FiniteDifferenceGradientDescent< TElastix >::BeforeEachResolution ( void  )
overridevirtual

Reimplemented from elastix::BaseComponent.

◆ BeforeRegistration()

template<class TElastix >
void elastix::FiniteDifferenceGradientDescent< TElastix >::BeforeRegistration ( void  )
overridevirtual

Methods that take care of setting parameters and printing progress information.

Reimplemented from elastix::BaseComponent.

◆ elxClassNameMacro()

template<class TElastix >
elastix::FiniteDifferenceGradientDescent< TElastix >::elxClassNameMacro ( "FiniteDifferenceGradientDescent< TElastix >"  )

Name of this class. Use this name in the parameter file to select this specific optimizer.
example: (Optimizer "FiniteDifferenceGradientDescent")

◆ GetClassName()

template<class TElastix >
virtual const char * elastix::FiniteDifferenceGradientDescent< TElastix >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::FiniteDifferenceGradientDescentOptimizer.

◆ New()

template<class TElastix >
static Pointer elastix::FiniteDifferenceGradientDescent< TElastix >::New ( )
static

Method for creation through the object factory.

◆ operator=()

template<class TElastix >
void elastix::FiniteDifferenceGradientDescent< TElastix >::operator= ( const Self )
private

◆ StartOptimization()

template<class TElastix >
void elastix::FiniteDifferenceGradientDescent< TElastix >::StartOptimization ( void  )
override

Check if any scales are set, and set the UseScales flag on or off; after that call the superclass' implementation

Field Documentation

◆ m_ShowMetricValues

template<class TElastix >
bool elastix::FiniteDifferenceGradientDescent< TElastix >::m_ShowMetricValues
protected

Definition at line 144 of file elxFiniteDifferenceGradientDescent.h.



Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo