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 | Private Member Functions | Private Attributes
elastix::StandardGradientDescent< TElastix > Class Template Reference

#include <elxStandardGradientDescent.h>

Detailed Description

template<class TElastix>
class elastix::StandardGradientDescent< TElastix >

A gradient descent optimizer with a decaying gain.

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

The parameters used in this class are:

Parameters:

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

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

MaximumNumberOfSamplingAttempts: The maximum number of sampling attempts. Sometimes not enough corresponding samples can be drawn, upon which an exception is thrown. With this parameter it is possible to try to draw another set of samples.
example: (MaximumNumberOfSamplingAttempts 10 15 10)
Default value: 0, i.e. just fail immediately, for backward compatibility.

SP_a: The gain $a(k)$ at each iteration $k$ is defined by
$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
$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
$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.

See also
StandardGradientDescentOptimizer

Definition at line 68 of file elxStandardGradientDescent.h.

Inheritance diagram for elastix::StandardGradientDescent< TElastix >:
Inheritance graph
[legend]

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 StandardGradientDescent Self
 
typedef Superclass1::StopConditionType StopConditionType
 
typedef StandardGradientDescentOptimizer Superclass1
 
typedef OptimizerBase< TElastix > Superclass2
 
- Public Types inherited from itk::StandardGradientDescentOptimizer
typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::CostFunctionType CostFunctionType
 
typedef Superclass::DerivativeType DerivativeType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Superclass::ScaledCostFunctionPointer ScaledCostFunctionPointer
 
typedef Superclass::ScaledCostFunctionType ScaledCostFunctionType
 
typedef Superclass::ScalesType ScalesType
 
typedef StandardGradientDescentOptimizer Self
 
typedef Superclass::StopConditionType StopConditionType
 
typedef GradientDescentOptimizer2 Superclass
 
- Public Types inherited from itk::GradientDescentOptimizer2
typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::CostFunctionType CostFunctionType
 
typedef Superclass::DerivativeType DerivativeType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Superclass::ScaledCostFunctionPointer ScaledCostFunctionPointer
 
typedef Superclass::ScaledCostFunctionType ScaledCostFunctionType
 
typedef Superclass::ScalesType ScalesType
 
typedef GradientDescentOptimizer2 Self
 
enum  StopConditionType { MaximumNumberOfIterations, MetricError, MinimumStepSize }
 
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 ElastixType::ConfigurationPointer ConfigurationPointer
 
typedef ElastixType::ConfigurationType ConfigurationType
 
typedef ElastixType::Pointer ElastixPointer
 
typedef TElastix ElastixType
 
typedef RegistrationTypeRegistrationPointer
 
typedef ElastixType::RegistrationBaseType RegistrationType
 
typedef BaseComponentSE Self
 
typedef BaseComponent Superclass
 

Public Member Functions

virtual void AfterEachIteration (void)
 
virtual void AfterEachResolution (void)
 
virtual void AfterRegistration (void)
 
virtual void BeforeEachResolution (void)
 
virtual void BeforeRegistration (void)
 
 elxClassNameMacro ("StandardGradientDescent")
 
virtual const char * GetClassName () const
 
virtual const unsigned long & GetMaximumNumberOfSamplingAttempts ()
 
virtual void MetricErrorResponse (itk::ExceptionObject &err)
 
virtual void SetCurrentPositionPublic (const ParametersType &param)
 
virtual void SetMaximumNumberOfSamplingAttempts (unsigned long _arg)
 
virtual void StartOptimization (void)
 
- Public Member Functions inherited from itk::StandardGradientDescentOptimizer
virtual void AdvanceOneStep (void)
 
virtual double GetCurrentTime () const
 
virtual double GetInitialTime () const
 
virtual double GetParam_a () const
 
virtual double GetParam_A () const
 
virtual double GetParam_alpha () const
 
virtual void ResetCurrentTimeToInitialTime (void)
 
virtual void SetInitialTime (double _arg)
 
virtual void SetParam_a (double _arg)
 
virtual void SetParam_A (double _arg)
 
virtual void SetParam_alpha (double _arg)
 
- Public Member Functions inherited from itk::GradientDescentOptimizer2
virtual unsigned int GetCurrentIteration () const
 
virtual const DerivativeTypeGetGradient ()
 
virtual const doubleGetLearningRate ()
 
virtual const unsigned long & GetNumberOfIterations ()
 
virtual const StopConditionTypeGetStopCondition ()
 
virtual const doubleGetValue ()
 
virtual void MetricErrorResponse (ExceptionObject &err)
 
virtual void ResumeOptimization (void)
 
virtual void SetLearningRate (double _arg)
 
virtual void SetNumberOfIterations (unsigned long _arg)
 
void SetNumberOfThreads (ThreadIdType numberOfThreads)
 
virtual void SetUseEigen (bool _arg)
 
virtual void SetUseMultiThread (bool _arg)
 
virtual void SetUseOpenMP (bool _arg)
 
virtual void StopOptimization (void)
 
- Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
virtual const ParametersTypeGetCurrentPosition (void) const
 
virtual bool GetMaximize () const
 
virtual const ScaledCostFunctionTypeGetScaledCostFunction ()
 
virtual const ParametersTypeGetScaledCurrentPosition ()
 
bool GetUseScales (void) const
 
virtual void InitializeScales (void)
 
virtual void MaximizeOff ()
 
virtual void MaximizeOn ()
 
virtual void SetCostFunction (CostFunctionType *costFunction)
 
virtual void SetMaximize (bool _arg)
 
virtual void SetUseScales (bool arg)
 
- Public Member Functions inherited from elastix::OptimizerBase< TElastix >
virtual void AfterRegistrationBase (void)
 
virtual void BeforeEachResolutionBase ()
 
virtual ITKBaseTypeGetAsITKBaseType (void)
 
virtual const ITKBaseTypeGetAsITKBaseType (void) 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 >
virtual ConfigurationTypeGetConfiguration (void) const
 
virtual ElastixTypeGetElastix (void) const
 
virtual RegistrationPointer GetRegistration (void) const
 
virtual void SetConfiguration (ConfigurationType *_arg)
 
virtual void SetElastix (ElastixType *_arg)
 
- Public Member Functions inherited from elastix::BaseComponent
virtual void AfterEachIterationBase (void)
 
virtual void AfterEachResolutionBase (void)
 
virtual int BeforeAll (void)
 
virtual int BeforeAllBase (void)
 
virtual void BeforeRegistrationBase (void)
 
std::string ConvertSecondsToDHMS (const double totalSeconds, const unsigned int precision) const
 
virtual const char * elxGetClassName (void) const
 
virtual const char * GetComponentLabel (void) const
 
virtual void SetComponentLabel (const char *label, unsigned int idx)
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::StandardGradientDescentOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::GradientDescentOptimizer2
static Pointer New ()
 
- Static Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
static Pointer New ()
 

Protected Member Functions

 StandardGradientDescent ()
 
virtual ~StandardGradientDescent ()
 
- Protected Member Functions inherited from itk::StandardGradientDescentOptimizer
virtual double Compute_a (double k) const
 
 StandardGradientDescentOptimizer ()
 
virtual void UpdateCurrentTime (void)
 
virtual ~StandardGradientDescentOptimizer ()
 
- Protected Member Functions inherited from itk::GradientDescentOptimizer2
 GradientDescentOptimizer2 ()
 
void PrintSelf (std::ostream &os, Indent indent) const
 
virtual ~GradientDescentOptimizer2 ()
 
- 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
 
 ScaledSingleValuedNonLinearOptimizer ()
 
virtual void SetCurrentPosition (const ParametersType &param)
 
virtual void SetScaledCurrentPosition (const ParametersType &parameters)
 
virtual ~ScaledSingleValuedNonLinearOptimizer ()
 
- Protected Member Functions inherited from elastix::OptimizerBase< TElastix >
virtual bool GetNewSamplesEveryIteration (void) const
 
 OptimizerBase ()
 
virtual void SelectNewSamples (void)
 
virtual ~OptimizerBase ()
 
- Protected Member Functions inherited from elastix::BaseComponentSE< TElastix >
 BaseComponentSE ()
 
virtual ~BaseComponentSE ()
 
- Protected Member Functions inherited from elastix::BaseComponent
 BaseComponent ()
 
virtual ~BaseComponent ()
 

Private Member Functions

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

Private Attributes

unsigned long m_CurrentNumberOfSamplingAttempts
 
unsigned long m_MaximumNumberOfSamplingAttempts
 
unsigned long m_PreviousErrorAtIteration
 

Additional Inherited Members

- Protected Types inherited from itk::GradientDescentOptimizer2
typedef itk::MultiThreader ThreaderType
 
typedef ThreaderType::ThreadInfoStruct ThreadInfoType
 
- Protected Attributes inherited from itk::StandardGradientDescentOptimizer
double m_CurrentTime
 
- Protected Attributes inherited from itk::GradientDescentOptimizer2
unsigned long m_CurrentIteration
 
DerivativeType m_Gradient
 
double m_LearningRate
 
unsigned long m_NumberOfIterations
 
bool m_Stop
 
StopConditionType m_StopCondition
 
ThreaderType::Pointer m_Threader
 
double m_Value
 
- 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
 

Member Typedef Documentation

Definition at line 104 of file elxStandardGradientDescent.h.

Definition at line 103 of file elxStandardGradientDescent.h.

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

Definition at line 81 of file elxStandardGradientDescent.h.

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

Definition at line 97 of file elxStandardGradientDescent.h.

Typedef's inherited from Superclass1, the StandardGradientDescentOptimizer.

Definition at line 96 of file elxStandardGradientDescent.h.

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

Definition at line 102 of file elxStandardGradientDescent.h.

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

Typedef's inherited from Superclass2, the elastix OptimizerBase .

Definition at line 101 of file elxStandardGradientDescent.h.

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

Definition at line 107 of file elxStandardGradientDescent.h.

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

Typedef for the ParametersType.

Definition at line 110 of file elxStandardGradientDescent.h.

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

Definition at line 80 of file elxStandardGradientDescent.h.

Definition at line 106 of file elxStandardGradientDescent.h.

Definition at line 105 of file elxStandardGradientDescent.h.

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

Standard ITK.

Definition at line 77 of file elxStandardGradientDescent.h.

Definition at line 98 of file elxStandardGradientDescent.h.

template<class TElastix >
typedef StandardGradientDescentOptimizer elastix::StandardGradientDescent< TElastix >::Superclass1

Definition at line 78 of file elxStandardGradientDescent.h.

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

Definition at line 79 of file elxStandardGradientDescent.h.

Constructor & Destructor Documentation

template<class TElastix >
elastix::StandardGradientDescent< TElastix >::StandardGradientDescent ( )
protected
template<class TElastix >
virtual elastix::StandardGradientDescent< TElastix >::~StandardGradientDescent ( )
inlineprotectedvirtual

Definition at line 149 of file elxStandardGradientDescent.h.

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

Member Function Documentation

template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::AfterEachIteration ( void  )
virtual

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::AfterEachResolution ( void  )
virtual

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::AfterRegistration ( void  )
virtual

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::BeforeEachResolution ( void  )
virtual

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::BeforeRegistration ( void  )
virtual

Methods invoked by elastix, in which parameters can be set and progress information can be printed.

Reimplemented from elastix::BaseComponent.

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

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

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

Run-time type information (and related methods).

Reimplemented from itk::StandardGradientDescentOptimizer.

template<class TElastix >
virtual const unsigned long& elastix::StandardGradientDescent< TElastix >::GetMaximumNumberOfSamplingAttempts ( )
virtual

Get the MaximumNumberOfSamplingAttempts.

template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::MetricErrorResponse ( itk::ExceptionObject &  err)
virtual

Stop optimisation and pass on exception.

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

Method for creation through the object factory.

template<class TElastix >
void elastix::StandardGradientDescent< TElastix >::operator= ( const Self )
private
template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::SetCurrentPositionPublic ( const ParametersType param)
inlinevirtual

Add SetCurrentPositionPublic, which calls the protected SetCurrentPosition of the itkStandardGradientDescentOptimizer class.

Definition at line 134 of file elxStandardGradientDescent.h.

template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::SetMaximumNumberOfSamplingAttempts ( unsigned long  _arg)
virtual

Set the MaximumNumberOfSamplingAttempts.

template<class TElastix >
virtual void elastix::StandardGradientDescent< TElastix >::StartOptimization ( void  )
virtual

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

Reimplemented from itk::StandardGradientDescentOptimizer.

Field Documentation

template<class TElastix >
unsigned long elastix::StandardGradientDescent< TElastix >::m_CurrentNumberOfSamplingAttempts
private

Definition at line 158 of file elxStandardGradientDescent.h.

template<class TElastix >
unsigned long elastix::StandardGradientDescent< TElastix >::m_MaximumNumberOfSamplingAttempts
private

Private variables for the sampling attempts.

Definition at line 157 of file elxStandardGradientDescent.h.

template<class TElastix >
unsigned long elastix::StandardGradientDescent< TElastix >::m_PreviousErrorAtIteration
private

Definition at line 159 of file elxStandardGradientDescent.h.



Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo