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

#include <elxAdaptiveStochasticGradientDescent.h>

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

Data Structures

struct  SettingsType
 

Public Types

typedef
Superclass2::ConfigurationPointer 
ConfigurationPointer
 
typedef
Superclass2::ConfigurationType 
ConfigurationType
 
typedef 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 SmartPointer< SelfPointer
 
typedef
Superclass2::RegistrationPointer 
RegistrationPointer
 
typedef
Superclass2::RegistrationType 
RegistrationType
 
typedef
AdaptiveStochasticGradientDescent 
Self
 
typedef
Superclass1::StopConditionType 
StopConditionType
 
typedef
AdaptiveStochasticGradientDescentOptimizer 
Superclass1
 
typedef OptimizerBase< TElastix > Superclass2
 
- Public Types inherited from itk::AdaptiveStochasticGradientDescentOptimizer
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
AdaptiveStochasticGradientDescentOptimizer 
Self
 
typedef
Superclass::StopConditionType 
StopConditionType
 
typedef
StandardGradientDescentOptimizer 
Superclass
 
- 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 ("AdaptiveStochasticGradientDescent")
 
virtual bool GetAutomaticParameterEstimation () const
 
virtual const char * GetClassName () const
 
virtual const unsigned long & GetMaximumNumberOfSamplingAttempts ()
 
virtual double GetMaximumStepLength () const
 
virtual void MetricErrorResponse (ExceptionObject &err)
 
virtual void ResumeOptimization (void)
 
virtual void SetAutomaticParameterEstimation (bool _arg)
 
virtual void SetMaximumNumberOfSamplingAttempts (unsigned long _arg)
 
virtual void SetMaximumStepLength (double _arg)
 
virtual void StartOptimization (void)
 
- Public Member Functions inherited from itk::AdaptiveStochasticGradientDescentOptimizer
virtual double GetSigmoidMax () const
 
virtual double GetSigmoidMin () const
 
virtual double GetSigmoidScale () const
 
virtual bool GetUseAdaptiveStepSizes () const
 
virtual void SetSigmoidMax (double _arg)
 
virtual void SetSigmoidMin (double _arg)
 
virtual void SetSigmoidScale (double _arg)
 
virtual void SetUseAdaptiveStepSizes (bool _arg)
 
- 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 SetLearningRate (double _arg)
 
virtual void SetNumberOfIterations (unsigned long _arg)
 
virtual void StopOptimization (void)
 
- Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
virtual const ParametersTypeGetCurrentPosition (void) const
 
virtual bool GetMaximize () const
 
virtual const
ScaledCostFunctionType
GetScaledCostFunction ()
 
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 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 void AfterRegistrationBase (void)
 
virtual int BeforeAll (void)
 
virtual int BeforeAllBase (void)
 
virtual void BeforeRegistrationBase (void)
 
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::AdaptiveStochasticGradientDescentOptimizer
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 Types

typedef AdvancedTransform
< CoordinateRepresentationType,
itkGetStaticConstMacro(FixedImageDimension),
itkGetStaticConstMacro(MovingImageDimension) > 
AdvancedTransformType
 
typedef TransformType::ScalarType CoordinateRepresentationType
 
typedef FixedImageType::IndexType FixedImageIndexType
 
typedef FixedImageType::PointType FixedImagePointType
 
typedef FixedImageType::RegionType FixedImageRegionType
 
typedef
RegistrationType::FixedImageType 
FixedImageType
 
typedef
ImageGridSamplerType::Pointer 
ImageGridSamplerPointer
 
typedef ImageGridSampler
< FixedImageType
ImageGridSamplerType
 
typedef
ImageRandomCoordinateSamplerType::Pointer 
ImageRandomCoordinateSamplerPointer
 
typedef
itk::ImageRandomCoordinateSampler
< FixedImageType
ImageRandomCoordinateSamplerType
 
typedef
ImageRandomSamplerBaseType::Pointer 
ImageRandomSamplerBasePointer
 
typedef
itk::ImageRandomSamplerBase
< FixedImageType
ImageRandomSamplerBaseType
 
typedef
ImageSampleContainerType::Pointer 
ImageSampleContainerPointer
 
typedef
ImageGridSamplerType::ImageSampleContainerType 
ImageSampleContainerType
 
typedef
ImageSamplerBaseType::Pointer 
ImageSamplerBasePointer
 
typedef itk::ImageSamplerBase
< FixedImageType
ImageSamplerBaseType
 
typedef
RegistrationType::ITKBaseType 
itkRegistrationType
 
typedef TransformType::JacobianType JacobianType
 
typedef JacobianType::ValueType JacobianValueType
 
typedef
RegistrationType::MovingImageType 
MovingImageType
 
typedef
AdvancedTransformType::NonZeroJacobianIndicesType 
NonZeroJacobianIndicesType
 
typedef ProgressCommand::Pointer ProgressCommandPointer
 
typedef ProgressCommand ProgressCommandType
 
typedef
itk::Statistics::MersenneTwisterRandomVariateGenerator 
RandomGeneratorType
 
typedef std::vector< SettingsType > SettingsVectorType
 
typedef JacobianType TransformJacobianType
 
typedef
itkRegistrationType::TransformType 
TransformType
 

Protected Member Functions

 AdaptiveStochasticGradientDescent ()
 
virtual void AddRandomPerturbation (ParametersType &parameters, double sigma)
 
virtual void AutomaticParameterEstimation (void)
 
virtual void CheckForAdvancedTransform (void)
 
virtual void ComputeJacobianTerms (double &TrC, double &TrCC, double &maxJJ, double &maxJCJ)
 
virtual void GetScaledDerivativeWithExceptionHandling (const ParametersType &parameters, DerivativeType &derivative)
 
 itkStaticConstMacro (FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
 
 itkStaticConstMacro (MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
 
virtual void PrintSettingsVector (const SettingsVectorType &settings) const
 
virtual void SampleFixedImageForJacobianTerms (ImageSampleContainerPointer &sampleContainer)
 
virtual void SampleGradients (const ParametersType &mu0, double perturbationSigma, double &gg, double &ee)
 
virtual ~AdaptiveStochasticGradientDescent ()
 
- Protected Member Functions inherited from itk::AdaptiveStochasticGradientDescentOptimizer
 AdaptiveStochasticGradientDescentOptimizer ()
 
virtual void UpdateCurrentTime (void)
 
virtual ~AdaptiveStochasticGradientDescentOptimizer ()
 
- Protected Member Functions inherited from itk::StandardGradientDescentOptimizer
virtual double Compute_a (double k) const
 
 StandardGradientDescentOptimizer ()
 
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 ()
 

Protected Attributes

AdvancedTransformType::Pointer m_AdvancedTransform
 
unsigned int m_NumberOfGradientMeasurements
 
unsigned int m_NumberOfJacobianMeasurements
 
unsigned int m_NumberOfSamplesForExactGradient
 
RandomGeneratorType::Pointer m_RandomGenerator
 
SettingsVectorType m_SettingsVector
 
double m_SigmoidScaleFactor
 
- Protected Attributes inherited from itk::AdaptiveStochasticGradientDescentOptimizer
DerivativeType m_PreviousGradient
 
- Protected Attributes inherited from itk::StandardGradientDescentOptimizer
double m_CurrentTime
 
- Protected Attributes inherited from itk::GradientDescentOptimizer2
DerivativeType m_Gradient
 
double m_LearningRate
 
StopConditionType m_StopCondition
 
- 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

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

Private Attributes

bool m_AutomaticParameterEstimation
 
bool m_AutomaticParameterEstimationDone
 
unsigned long m_CurrentNumberOfSamplingAttempts
 
unsigned long m_MaxBandCovSize
 
unsigned long m_MaximumNumberOfSamplingAttempts
 
double m_MaximumStepLength
 
unsigned long m_NumberOfBandStructureSamples
 
unsigned long m_PreviousErrorAtIteration
 

Detailed Description

template<class TElastix>
class elastix::AdaptiveStochasticGradientDescent< TElastix >

A gradient descent optimizer with an adaptive gain.

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

This optimizer is very suitable to be used in combination with the Random image sampler, or with the RandomCoordinate image sampler, with the setting (NewSamplesEveryIteration "true"). Much effort has been spent on providing reasonable default values for all parameters, to simplify usage. In most registration problems, good results should be obtained without specifying any of the parameters described below (except the first of course, which defines the optimizer to use).

This optimization method is described in the following references:

[1] P. Cruz, "Almost sure convergence and asymptotical normality of a generalization of Kesten's stochastic approximation algorithm for multidimensional case." Technical Report, 2005. http://hdl.handle.net/2052/74

[2] S. Klein, J.P.W. Pluim, and M. Staring, M.A. Viergever, "Adaptive stochastic gradient descent optimisation for image registration," International Journal of Computer Vision, vol. 81, no. 3, pp. 227-239, 2009. http://dx.doi.org/10.1007/s11263-008-0168-y

The parameters used in this class are:

Parameters:

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

MaximumNumberOfIterations: The maximum number of iterations in each resolution.
example: (MaximumNumberOfIterations 100 100 50)
Default/recommended value: 500. When you are in a hurry, you may go down to 250 for example. When you have plenty of time, and want to be absolutely sure of the best results, a setting of 2000 is reasonable. In general, 500 gives satisfactory results.

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.

AutomaticParameterEstimation: When this parameter is set to "true", many other parameters are calculated automatically: SP_a, SP_alpha, SigmoidMax, SigmoidMin, and SigmoidScale. In the elastix.log file the actually chosen values for these parameters can be found.
example: (AutomaticParameterEstimation "true")
Default/recommended value: "true". The parameter can be specified for each resolution, or for all resolutions at once.

UseAdaptiveStepSizes: When this parameter is set to "true", the adaptive step size mechanism described in the documentation of itk::AdaptiveStochasticGradientDescentOptimizer is used. The parameter can be specified for each resolution, or for all resolutions at once.
example: (UseAdaptiveStepSizes "true")
Default/recommend value: "true", because it makes the registration more robust. In case of using a RandomCoordinate sampler, with (UseRandomSampleRegion "true"), the adaptive step size mechanism is turned off, no matter the user setting.

MaximumStepLength: Also called $\delta$. This parameter can be considered as the maximum voxel displacement between two iterations. The larger this parameter, the more agressive the optimization. The parameter can be specified for each resolution, or for all resolutions at once.
example: (MaximumStepLength 1.0)
Default: mean voxel spacing of fixed and moving image. This seems to work well in general. This parameter only has influence when AutomaticParameterEstimation is used.

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. Alternatively set the AutomaticParameterEstimation to "true". In that case, you do not need to specify SP_a. SP_a has no influence when AutomaticParameterEstimation is used.

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 for this particular optimizer is 20.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 for this particular optimizer is 1.0. Alternatively set the AutomaticParameterEstimation to "true". In that case, you do not need to specify SP_alpha. SP_alpha has no influence when AutomaticParameterEstimation is used.

SigmoidMax: The maximum of the sigmoid function ( $f_{max}$). Must be larger than 0. The parameter can be specified for each resolution, or for all resolutions at once.
example: (SigmoidMax 1.0)
Default/recommended value: 1.0. This parameter has no influence when AutomaticParameterEstimation is used. In that case, always a value 1.0 is used.

SigmoidMin: The minimum of the sigmoid function ( $f_{min}$). Must be smaller than 0. The parameter can be specified for each resolution, or for all resolutions at once.
example: (SigmoidMin -0.8)
Default value: -0.8. This parameter has no influence when AutomaticParameterEstimation is used. In that case, the value is automatically determined, depending on the images, metric etc.

SigmoidScale: The scale/width of the sigmoid function ( $\omega$). The parameter can be specified for each resolution, or for all resolutions at once.
example: (SigmoidScale 0.00001)
Default value: 1e-8. This parameter has no influence when AutomaticParameterEstimation is used. In that case, the value is automatically determined, depending on the images, metric etc.

SigmoidInitialTime: the initial time input for the sigmoid ( $t_0$). Must be larger than 0.0. The parameter can be specified for each resolution, or for all resolutions at once.
example: (SigmoidInitialTime 0.0 5.0 5.0)
Default value: 0.0. When increased, the optimization starts with smaller steps, leaving the possibility to increase the steps when necessary. If set to 0.0, the method starts with with the largest step allowed.

NumberOfGradientMeasurements: Number of gradients N to estimate the average square magnitudes of the exact gradient and the approximation error. The parameter can be specified for each resolution, or for all resolutions at once.
example: (NumberOfGradientMeasurements 10)
Default value: 0, which means that the value is automatically estimated. In principle, the more the better, but the slower. In practice N=10 is usually sufficient. But the automatic estimation achieved by N=0 also works good. The parameter has only influence when AutomaticParameterEstimation is used.

NumberOfJacobianMeasurements: The number of voxels M where the Jacobian is measured, which is used to estimate the covariance matrix. The parameter can be specified for each resolution, or for all resolutions at once.
example: (NumberOfJacobianMeasurements 5000 10000 20000)
Default value: M = max( 1000, nrofparams ), with nrofparams the number of transform parameters. This is a rather crude rule of thumb, which seems to work in practice. In principle, the more the better, but the slower. The parameter has only influence when AutomaticParameterEstimation is used.

NumberOfSamplesForExactGradient: The number of image samples used to compute the 'exact' gradient. The samples are chosen on a uniform grid. The parameter can be specified for each resolution, or for all resolutions at once.
example: (NumberOfSamplesForExactGradient 100000)
Default/recommended: 100000. This works in general. If the image is smaller, the number of samples is automatically reduced. In principle, the more the better, but the slower. The parameter has only influence when AutomaticParameterEstimation is used.

Todo:
: this class contains a lot of functional code, which actually does not belong here.
See Also
AdaptiveStochasticGradientDescentOptimizer

Definition at line 169 of file elxAdaptiveStochasticGradientDescent.h.

Member Typedef Documentation

template<class TElastix >
typedef AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedImageDimension), itkGetStaticConstMacro(MovingImageDimension) > elastix::AdaptiveStochasticGradientDescent< TElastix >::AdvancedTransformType
protected

Definition at line 301 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 204 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 203 of file elxAdaptiveStochasticGradientDescent.h.

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

Definition at line 180 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef TransformType::ScalarType elastix::AdaptiveStochasticGradientDescent< TElastix >::CoordinateRepresentationType
protected

Definition at line 297 of file elxAdaptiveStochasticGradientDescent.h.

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

Definition at line 197 of file elxAdaptiveStochasticGradientDescent.h.

Typedef's inherited from Superclass1.

Definition at line 196 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 202 of file elxAdaptiveStochasticGradientDescent.h.

Typedef's inherited from Superclass2.

Definition at line 201 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef FixedImageType::IndexType elastix::AdaptiveStochasticGradientDescent< TElastix >::FixedImageIndexType
protected

Definition at line 263 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef FixedImageType::PointType elastix::AdaptiveStochasticGradientDescent< TElastix >::FixedImagePointType
protected

Definition at line 264 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef FixedImageType::RegionType elastix::AdaptiveStochasticGradientDescent< TElastix >::FixedImageRegionType
protected

Definition at line 262 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef RegistrationType::FixedImageType elastix::AdaptiveStochasticGradientDescent< TElastix >::FixedImageType
protected

Protected typedefs

Definition at line 255 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 283 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef ImageGridSampler< FixedImageType > elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageGridSamplerType
protected

Definition at line 282 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 281 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 279 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 277 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 275 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 286 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 285 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 274 of file elxAdaptiveStochasticGradientDescent.h.

Samplers:

Definition at line 273 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 207 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef RegistrationType::ITKBaseType elastix::AdaptiveStochasticGradientDescent< TElastix >::itkRegistrationType
protected

Definition at line 265 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef TransformType::JacobianType elastix::AdaptiveStochasticGradientDescent< TElastix >::JacobianType
protected

Definition at line 267 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef JacobianType::ValueType elastix::AdaptiveStochasticGradientDescent< TElastix >::JacobianValueType
protected

Definition at line 268 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef RegistrationType::MovingImageType elastix::AdaptiveStochasticGradientDescent< TElastix >::MovingImageType
protected

Definition at line 261 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 303 of file elxAdaptiveStochasticGradientDescent.h.

Typedef for the ParametersType.

Definition at line 210 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef SmartPointer<Self> elastix::AdaptiveStochasticGradientDescent< TElastix >::Pointer

Definition at line 179 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef ProgressCommand::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ProgressCommandPointer
protected

Definition at line 291 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef ProgressCommand elastix::AdaptiveStochasticGradientDescent< TElastix >::ProgressCommandType
protected

Definition at line 290 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef itk::Statistics::MersenneTwisterRandomVariateGenerator elastix::AdaptiveStochasticGradientDescent< TElastix >::RandomGeneratorType
protected

Other protected typedefs

Definition at line 289 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 206 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 205 of file elxAdaptiveStochasticGradientDescent.h.

Standard ITK.

Definition at line 176 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef std::vector<SettingsType> elastix::AdaptiveStochasticGradientDescent< TElastix >::SettingsVectorType
protected

Definition at line 270 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 198 of file elxAdaptiveStochasticGradientDescent.h.

Definition at line 177 of file elxAdaptiveStochasticGradientDescent.h.

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

Definition at line 178 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef JacobianType elastix::AdaptiveStochasticGradientDescent< TElastix >::TransformJacobianType
protected

Typedefs for support of sparse Jacobians and AdvancedTransforms.

Definition at line 294 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
typedef itkRegistrationType::TransformType elastix::AdaptiveStochasticGradientDescent< TElastix >::TransformType
protected

Definition at line 266 of file elxAdaptiveStochasticGradientDescent.h.

Constructor & Destructor Documentation

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

Definition at line 306 of file elxAdaptiveStochasticGradientDescent.h.

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

Member Function Documentation

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::AddRandomPerturbation ( ParametersType parameters,
double  sigma 
)
protectedvirtual

Helper function that adds a random perturbation delta to the input parameters, with delta ~ sigma * N(0,I). Used by SampleGradients.

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

Reimplemented from elastix::BaseComponent.

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

Reimplemented from elastix::BaseComponent.

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

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::AutomaticParameterEstimation ( void  )
protectedvirtual

Estimates some reasonable values for the parameters SP_a, SP_alpha (=1), SigmoidMin, SigmoidMax (=1), and SigmoidScale.

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

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< 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 >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::CheckForAdvancedTransform ( void  )
protectedvirtual

Check if the transform is an advanced transform. Called by Initialize.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::ComputeJacobianTerms ( double TrC,
double TrCC,
double maxJJ,
double maxJCJ 
)
protectedvirtual

Functions to compute the Jacobian terms needed for the automatic parameter estimation.

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

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

template<class TElastix >
virtual bool elastix::AdaptiveStochasticGradientDescent< TElastix >::GetAutomaticParameterEstimation ( ) const
virtual
template<class TElastix >
virtual const char* elastix::AdaptiveStochasticGradientDescent< TElastix >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.

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

Get the MaximumNumberOfSamplingAttempts.

template<class TElastix >
virtual double elastix::AdaptiveStochasticGradientDescent< TElastix >::GetMaximumStepLength ( ) const
virtual
template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::GetScaledDerivativeWithExceptionHandling ( const ParametersType parameters,
DerivativeType derivative 
)
protectedvirtual

Helper function, which calls GetScaledValueAndDerivative and does some exception handling. Used by SampleGradients.

template<class TElastix >
elastix::AdaptiveStochasticGradientDescent< TElastix >::itkStaticConstMacro ( FixedImageDimension  ,
unsigned  int,
FixedImageType::ImageDimension   
)
protected
template<class TElastix >
elastix::AdaptiveStochasticGradientDescent< TElastix >::itkStaticConstMacro ( MovingImageDimension  ,
unsigned  int,
MovingImageType::ImageDimension   
)
protected
template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::MetricErrorResponse ( ExceptionObject &  err)
virtual

Stop optimization and pass on exception.

Reimplemented from itk::GradientDescentOptimizer2.

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

Method for creation through the object factory.

template<class TElastix >
void elastix::AdaptiveStochasticGradientDescent< TElastix >::operator= ( const Self )
private
template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::PrintSettingsVector ( const SettingsVectorType settings) const
protectedvirtual

Print the contents of the settings vector to elxout.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::ResumeOptimization ( void  )
virtual

If automatic gain estimation is desired, then estimate SP_a, SP_alpha SigmoidScale, SigmoidMax, SigmoidMin. After that call Superclass' implementation.

Reimplemented from itk::GradientDescentOptimizer2.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::SampleFixedImageForJacobianTerms ( ImageSampleContainerPointer sampleContainer)
protectedvirtual

Returns a container of fixed image samples, sampled using a grid sampler The grid size is determined from the user entered number of Jacobian measurements, or a default value of 200 is used. The actual number of samples depends on the presence of masks, and the restriction that the grid spacing of the grid sampler must be integer. The samples input variable contains the sample container after execution. It does not have to be initialized/allocated before.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::SampleGradients ( const ParametersType mu0,
double  perturbationSigma,
double gg,
double ee 
)
protectedvirtual

Measure some derivatives, exact and approximated. Returns the squared magnitude of the gradient and approximation error. Needed for the automatic parameter estimation. Gradients are measured at position mu_n, which are generated according to: mu_n - mu_0 ~ N(0, perturbationSigma^2 I ); gg = g^T g, etc.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::SetAutomaticParameterEstimation ( bool  _arg)
virtual

Set/Get whether automatic parameter estimation is desired. If true, make sure to set the maximum step length.

The following parameters are automatically determined: SP_a, SP_alpha (=1), SigmoidMin, SigmoidMax (=1), SigmoidScale. A usually suitable value for SP_A is 20, which is the default setting, if not specified by the user.

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

Set the MaximumNumberOfSamplingAttempts.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::SetMaximumStepLength ( double  _arg)
virtual

Set/Get maximum step length.

template<class TElastix >
virtual void elastix::AdaptiveStochasticGradientDescent< 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 >
AdvancedTransformType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::m_AdvancedTransform
protected

The transform stored as AdvancedTransform

Definition at line 317 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
bool elastix::AdaptiveStochasticGradientDescent< TElastix >::m_AutomaticParameterEstimation
private

Definition at line 379 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
bool elastix::AdaptiveStochasticGradientDescent< TElastix >::m_AutomaticParameterEstimationDone
private

Definition at line 386 of file elxAdaptiveStochasticGradientDescent.h.

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

Definition at line 384 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
unsigned long elastix::AdaptiveStochasticGradientDescent< TElastix >::m_MaxBandCovSize
private

Private variables for band size estimation of covariance matrix.

Definition at line 389 of file elxAdaptiveStochasticGradientDescent.h.

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

Private variables for the sampling attempts.

Definition at line 383 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
double elastix::AdaptiveStochasticGradientDescent< TElastix >::m_MaximumStepLength
private

Definition at line 380 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
unsigned long elastix::AdaptiveStochasticGradientDescent< TElastix >::m_NumberOfBandStructureSamples
private

Definition at line 390 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
unsigned int elastix::AdaptiveStochasticGradientDescent< TElastix >::m_NumberOfGradientMeasurements
protected

Some options for automatic parameter estimation.

Definition at line 312 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
unsigned int elastix::AdaptiveStochasticGradientDescent< TElastix >::m_NumberOfJacobianMeasurements
protected

Definition at line 313 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
unsigned int elastix::AdaptiveStochasticGradientDescent< TElastix >::m_NumberOfSamplesForExactGradient
protected

Definition at line 314 of file elxAdaptiveStochasticGradientDescent.h.

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

Definition at line 385 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
RandomGeneratorType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::m_RandomGenerator
protected

RandomGenerator for AddRandomPerturbation.

Definition at line 320 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
SettingsVectorType elastix::AdaptiveStochasticGradientDescent< TElastix >::m_SettingsVector
protected

Variable to store the automatically determined settings for each resolution.

Definition at line 306 of file elxAdaptiveStochasticGradientDescent.h.

template<class TElastix >
double elastix::AdaptiveStochasticGradientDescent< TElastix >::m_SigmoidScaleFactor
protected

Definition at line 322 of file elxAdaptiveStochasticGradientDescent.h.



Generated on 05-12-2013 for elastix by doxygen 1.8.5 elastix logo