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::PreconditionedGradientDescent< TElastix > Class Template Reference

#include <elxPreconditionedGradientDescent.h>

Detailed Description

template<class TElastix>
class elastix::PreconditionedGradientDescent< TElastix >

A gradient descent optimizer with a decaying gain.

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

The parameters used in this class are:

Parameters:

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

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
StochasticPreconditionedGradientOptimizer

Definition at line 72 of file elxPreconditionedGradientDescent.h.

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

Data Structures

struct  SettingsType
 

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 Superclass1::PreconditionType PreconditionType
 
typedef Superclass1::PreconditionValueType PreconditionValueType
 
typedef Superclass2::RegistrationPointer RegistrationPointer
 
typedef Superclass2::RegistrationType RegistrationType
 
typedef PreconditionedGradientDescent Self
 
typedef Superclass1::StopConditionType StopConditionType
 
typedef AdaptiveStochasticPreconditionedGradientDescentOptimizer Superclass1
 
typedef OptimizerBase< TElastix > Superclass2
 
- Public Types inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
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::PreconditionType PreconditionType
 
typedef Superclass::PreconditionValueType PreconditionValueType
 
typedef Superclass::ScaledCostFunctionPointer ScaledCostFunctionPointer
 
typedef Superclass::ScaledCostFunctionType ScaledCostFunctionType
 
typedef Superclass::ScalesType ScalesType
 
typedef AdaptiveStochasticPreconditionedGradientDescentOptimizer Self
 
typedef Superclass::StopConditionType StopConditionType
 
typedef StochasticPreconditionedGradientDescentOptimizer Superclass
 
- Public Types inherited from itk::StochasticPreconditionedGradientDescentOptimizer
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::PreconditionType PreconditionType
 
typedef Superclass::PreconditionValueType PreconditionValueType
 
typedef Superclass::ScaledCostFunctionPointer ScaledCostFunctionPointer
 
typedef Superclass::ScaledCostFunctionType ScaledCostFunctionType
 
typedef Superclass::ScalesType ScalesType
 
typedef StochasticPreconditionedGradientDescentOptimizer Self
 
typedef Superclass::StopConditionType StopConditionType
 
typedef PreconditionedGradientDescentOptimizer Superclass
 
- Public Types inherited from itk::PreconditionedGradientDescentOptimizer
typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::CostFunctionType CostFunctionType
 
typedef Superclass::DerivativeType DerivativeType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef vnl_sparse_matrix< PreconditionValueTypePreconditionType
 
typedef DerivativeType::ValueType PreconditionValueType
 
typedef Superclass::ScaledCostFunctionPointer ScaledCostFunctionPointer
 
typedef Superclass::ScaledCostFunctionType ScaledCostFunctionType
 
typedef Superclass::ScalesType ScalesType
 
typedef PreconditionedGradientDescentOptimizer 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 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

virtual void AfterEachIteration (void)
 
virtual void AfterEachResolution (void)
 
virtual void AfterRegistration (void)
 
virtual void BeforeEachResolution (void)
 
virtual void BeforeRegistration (void)
 
 elxClassNameMacro ("PreconditionedGradientDescent")
 
virtual bool GetAutomaticParameterEstimation () const
 
virtual const char * GetClassName () const
 
virtual const unsigned long & GetMaximumNumberOfSamplingAttempts ()
 
virtual void MetricErrorResponse (itk::ExceptionObject &err)
 
virtual void ResumeOptimization (void)
 
virtual void SetAutomaticParameterEstimation (bool _arg)
 
virtual void SetCurrentPositionPublic (const ParametersType &param)
 
virtual void SetMaximumNumberOfSamplingAttempts (unsigned long _arg)
 
virtual void StartOptimization (void)
 
- Public Member Functions inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
virtual const char * GetClassName () const
 
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::StochasticPreconditionedGradientDescentOptimizer
virtual void AdvanceOneStep (void)
 
virtual const char * GetClassName () const
 
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 SetInitialTime (double _arg)
 
virtual void SetParam_a (double _arg)
 
virtual void SetParam_A (double _arg)
 
virtual void SetParam_alpha (double _arg)
 
virtual void StartOptimization (void)
 
- Public Member Functions inherited from itk::PreconditionedGradientDescentOptimizer
virtual void AdvanceOneStep (void)
 
const cholmod_common * GetCholmodCommon (void) const
 
const cholmod_factor * GetCholmodFactor (void) const
 
virtual const char * GetClassName () const
 
virtual double GetConditionNumber () const
 
virtual unsigned int GetCurrentIteration () const
 
virtual double GetDiagonalWeight () const
 
virtual const DerivativeTypeGetGradient ()
 
virtual double GetLargestEigenValue () const
 
virtual const doubleGetLearningRate ()
 
virtual double GetMinimumGradientElementMagnitude () const
 
virtual const unsigned long & GetNumberOfIterations ()
 
virtual const DerivativeTypeGetSearchDirection ()
 
virtual double GetSparsity () const
 
virtual const StopConditionTypeGetStopCondition ()
 
virtual const doubleGetValue ()
 
virtual void MetricErrorResponse (ExceptionObject &err)
 
virtual void ResumeOptimization (void)
 
virtual void SetDiagonalWeight (double _arg)
 
virtual void SetLearningRate (double _arg)
 
virtual void SetMinimumGradientElementMagnitude (double _arg)
 
virtual void SetNumberOfIterations (unsigned long _arg)
 
virtual void SetPreconditionMatrix (PreconditionType &precondition)
 
virtual void StartOptimization (void)
 
virtual 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::AdaptiveStochasticPreconditionedGradientDescentOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::StochasticPreconditionedGradientDescentOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::PreconditionedGradientDescentOptimizer
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 Types

typedef RegistrationType::FixedImageType FixedImageType
 
typedef ImageGridSamplerType::Pointer ImageGridSamplerPointer
 
typedef itk::ImageGridSampler< FixedImageTypeImageGridSamplerType
 
typedef ImageRandomCoordinateSamplerType::Pointer ImageRandomCoordinateSamplerPointer
 
typedef itk::ImageRandomCoordinateSampler< FixedImageTypeImageRandomCoordinateSamplerType
 
typedef ImageRandomSamplerBaseType::Pointer ImageRandomSamplerBasePointer
 
typedef itk::ImageRandomSamplerBase< FixedImageTypeImageRandomSamplerBaseType
 
typedef ImageSamplerBaseType::Pointer ImageSamplerBasePointer
 
typedef itk::ImageSamplerBase< FixedImageTypeImageSamplerBaseType
 
typedef RegistrationType::MovingImageType MovingImageType
 
typedef ProgressCommand::Pointer ProgressCommandPointer
 
typedef ProgressCommand ProgressCommandType
 
typedef RandomGeneratorType::Pointer RandomGeneratorPointer
 
typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
 
typedef std::vector< SettingsTypeSettingsVectorType
 
- Protected Types inherited from itk::PreconditionedGradientDescentOptimizer
typedef int CInt
 

Protected Member Functions

virtual void AddRandomPerturbation (const ParametersType &initialParameters, ParametersType &perturbedParameters, double sigma)
 
virtual void AutomaticParameterEstimation (void)
 
virtual void GetScaledDerivativeWithExceptionHandling (const ParametersType &parameters, DerivativeType &derivative)
 
 PreconditionedGradientDescent ()
 
virtual void PrintSettingsVector (const SettingsVectorType &settings) const
 
virtual void SampleGradients (const ParametersType &mu0, double &sigma1, double &sigma2)
 
virtual void SetSelfHessian (void)
 
virtual ~PreconditionedGradientDescent ()
 
- Protected Member Functions inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
 AdaptiveStochasticPreconditionedGradientDescentOptimizer ()
 
virtual void UpdateCurrentTime (void)
 
virtual ~AdaptiveStochasticPreconditionedGradientDescentOptimizer ()
 
- Protected Member Functions inherited from itk::StochasticPreconditionedGradientDescentOptimizer
virtual double Compute_a (double k) const
 
 StochasticPreconditionedGradientDescentOptimizer ()
 
virtual void UpdateCurrentTime (void)
 
virtual ~StochasticPreconditionedGradientDescentOptimizer ()
 
- Protected Member Functions inherited from itk::PreconditionedGradientDescentOptimizer
virtual void CholmodSolve (const DerivativeType &gradient, DerivativeType &searchDirection, int solveType=CHOLMOD_A)
 
 PreconditionedGradientDescentOptimizer ()
 
void PrintSelf (std::ostream &os, Indent indent) const
 
virtual ~PreconditionedGradientDescentOptimizer ()
 
- 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

unsigned int m_NumberOfGradientMeasurements
 
unsigned int m_NumberOfSamplesForExactGradient
 
RandomGeneratorPointer m_RandomGenerator
 
SettingsVectorType m_SettingsVector
 
double m_SigmoidScaleFactor
 
- Protected Attributes inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
DerivativeType m_PreviousSearchDirection
 
- Protected Attributes inherited from itk::StochasticPreconditionedGradientDescentOptimizer
double m_CurrentTime
 
- Protected Attributes inherited from itk::PreconditionedGradientDescentOptimizer
cholmod_common * m_CholmodCommon
 
cholmod_factor * m_CholmodFactor
 
cholmod_sparse * m_CholmodGradient
 
double m_ConditionNumber
 
DerivativeType m_Gradient
 
double m_LargestEigenValue
 
double m_LearningRate
 
DerivativeType m_SearchDirection
 
double m_Sparsity
 
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

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

Private Attributes

bool m_AutomaticParameterEstimation
 
bool m_AutomaticParameterEstimationDone
 
unsigned long m_CurrentNumberOfSamplingAttempts
 
unsigned long m_MaximumNumberOfSamplingAttempts
 
bool m_PreconditionMatrixSet
 
unsigned long m_PreviousErrorAtIteration
 

Member Typedef Documentation

◆ ConfigurationPointer

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

Definition at line 107 of file elxPreconditionedGradientDescent.h.

◆ ConfigurationType

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

Definition at line 106 of file elxPreconditionedGradientDescent.h.

◆ ConstPointer

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

Definition at line 83 of file elxPreconditionedGradientDescent.h.

◆ CostFunctionPointer

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

Definition at line 100 of file elxPreconditionedGradientDescent.h.

◆ CostFunctionType

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

Typedef's inherited from Superclass1, the AdaptiveStochasticPreconditionedGradientDescentOptimizer.

Definition at line 99 of file elxPreconditionedGradientDescent.h.

◆ ElastixPointer

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

Definition at line 105 of file elxPreconditionedGradientDescent.h.

◆ ElastixType

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

Typedef's inherited from Superclass2, the elastix OptimizerBase.

Definition at line 104 of file elxPreconditionedGradientDescent.h.

◆ FixedImageType

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

Samplers:

Definition at line 183 of file elxPreconditionedGradientDescent.h.

◆ ImageGridSamplerPointer

template<class TElastix >
typedef ImageGridSamplerType::Pointer elastix::PreconditionedGradientDescent< TElastix >::ImageGridSamplerPointer
protected

Definition at line 195 of file elxPreconditionedGradientDescent.h.

◆ ImageGridSamplerType

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

Definition at line 194 of file elxPreconditionedGradientDescent.h.

◆ ImageRandomCoordinateSamplerPointer

template<class TElastix >
typedef ImageRandomCoordinateSamplerType::Pointer elastix::PreconditionedGradientDescent< TElastix >::ImageRandomCoordinateSamplerPointer
protected

Definition at line 193 of file elxPreconditionedGradientDescent.h.

◆ ImageRandomCoordinateSamplerType

template<class TElastix >
typedef itk::ImageRandomCoordinateSampler< FixedImageType > elastix::PreconditionedGradientDescent< TElastix >::ImageRandomCoordinateSamplerType
protected

Definition at line 191 of file elxPreconditionedGradientDescent.h.

◆ ImageRandomSamplerBasePointer

template<class TElastix >
typedef ImageRandomSamplerBaseType::Pointer elastix::PreconditionedGradientDescent< TElastix >::ImageRandomSamplerBasePointer
protected

Definition at line 189 of file elxPreconditionedGradientDescent.h.

◆ ImageRandomSamplerBaseType

template<class TElastix >
typedef itk::ImageRandomSamplerBase<FixedImageType> elastix::PreconditionedGradientDescent< TElastix >::ImageRandomSamplerBaseType
protected

Definition at line 187 of file elxPreconditionedGradientDescent.h.

◆ ImageSamplerBasePointer

template<class TElastix >
typedef ImageSamplerBaseType::Pointer elastix::PreconditionedGradientDescent< TElastix >::ImageSamplerBasePointer
protected

Definition at line 186 of file elxPreconditionedGradientDescent.h.

◆ ImageSamplerBaseType

template<class TElastix >
typedef itk::ImageSamplerBase<FixedImageType> elastix::PreconditionedGradientDescent< TElastix >::ImageSamplerBaseType
protected

Definition at line 185 of file elxPreconditionedGradientDescent.h.

◆ ITKBaseType

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

Definition at line 110 of file elxPreconditionedGradientDescent.h.

◆ MovingImageType

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

Definition at line 184 of file elxPreconditionedGradientDescent.h.

◆ ParametersType

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

Typedef for the ParametersType.

Definition at line 113 of file elxPreconditionedGradientDescent.h.

◆ Pointer

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

Definition at line 82 of file elxPreconditionedGradientDescent.h.

◆ PreconditionType

template<class TElastix >
typedef Superclass1::PreconditionType elastix::PreconditionedGradientDescent< TElastix >::PreconditionType

Definition at line 117 of file elxPreconditionedGradientDescent.h.

◆ PreconditionValueType

template<class TElastix >
typedef Superclass1::PreconditionValueType elastix::PreconditionedGradientDescent< TElastix >::PreconditionValueType

Some typedefs for computing the SelfHessian

Definition at line 116 of file elxPreconditionedGradientDescent.h.

◆ ProgressCommandPointer

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

Definition at line 180 of file elxPreconditionedGradientDescent.h.

◆ ProgressCommandType

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

Definition at line 179 of file elxPreconditionedGradientDescent.h.

◆ RandomGeneratorPointer

template<class TElastix >
typedef RandomGeneratorType::Pointer elastix::PreconditionedGradientDescent< TElastix >::RandomGeneratorPointer
protected

Definition at line 178 of file elxPreconditionedGradientDescent.h.

◆ RandomGeneratorType

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

Other protected typedefs

Definition at line 177 of file elxPreconditionedGradientDescent.h.

◆ RegistrationPointer

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

Definition at line 109 of file elxPreconditionedGradientDescent.h.

◆ RegistrationType

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

Definition at line 108 of file elxPreconditionedGradientDescent.h.

◆ Self

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

Standard ITK.

Definition at line 79 of file elxPreconditionedGradientDescent.h.

◆ SettingsVectorType

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

Definition at line 174 of file elxPreconditionedGradientDescent.h.

◆ StopConditionType

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

Definition at line 101 of file elxPreconditionedGradientDescent.h.

◆ Superclass1

Definition at line 80 of file elxPreconditionedGradientDescent.h.

◆ Superclass2

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

Definition at line 81 of file elxPreconditionedGradientDescent.h.

Constructor & Destructor Documentation

◆ PreconditionedGradientDescent() [1/2]

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

◆ ~PreconditionedGradientDescent()

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

Definition at line 198 of file elxPreconditionedGradientDescent.h.

◆ PreconditionedGradientDescent() [2/2]

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

Member Function Documentation

◆ AddRandomPerturbation()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::AddRandomPerturbation ( const ParametersType initialParameters,
ParametersType perturbedParameters,
double  sigma 
)
protectedvirtual

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

◆ AfterEachIteration()

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

Reimplemented from elastix::BaseComponent.

◆ AfterEachResolution()

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

Reimplemented from elastix::BaseComponent.

◆ AfterRegistration()

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

Reimplemented from elastix::BaseComponent.

◆ AutomaticParameterEstimation()

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

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

◆ BeforeEachResolution()

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

Reimplemented from elastix::BaseComponent.

◆ BeforeRegistration()

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

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

Reimplemented from elastix::BaseComponent.

◆ elxClassNameMacro()

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

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

◆ GetAutomaticParameterEstimation()

template<class TElastix >
virtual bool elastix::PreconditionedGradientDescent< TElastix >::GetAutomaticParameterEstimation ( ) const
virtual

◆ GetClassName()

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

Run-time type information (and related methods).

Reimplemented from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer.

◆ GetMaximumNumberOfSamplingAttempts()

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

Get the MaximumNumberOfSamplingAttempts.

◆ GetScaledDerivativeWithExceptionHandling()

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

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

◆ MetricErrorResponse()

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

Stop optimization and pass on exception.

◆ New()

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

Method for creation through the object factory.

◆ operator=()

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

◆ PrintSettingsVector()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::PrintSettingsVector ( const SettingsVectorType settings) const
protectedvirtual

Print the contents of the settings vector to elxout.

◆ ResumeOptimization()

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

Set the SelfHessian as a preconditioning matrix and call Superclass' implementation. Only done when m_PreconditionMatrixSet == false; If automatic gain estimation is desired, then estimate SP_a, SP_alpha SigmoidScale, SigmoidMax, SigmoidMin. After that call Superclass' implementation.

Reimplemented from itk::PreconditionedGradientDescentOptimizer.

◆ SampleGradients()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::SampleGradients ( const ParametersType mu0,
double sigma1,
double sigma2 
)
protectedvirtual

Measure some derivatives, exact and approximated. Returns the sigma1 and sigma2. 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 P ); perturbationSigma = sigma1 = 1/N g_0' P g_0, where g_0 is the exact gradient at mu_0, and N the number of parameters. sigma2 = 1/N sum_n g_n' P g_n / (sum_n n), where g_n is the approximated gradient at mu_0. NB: sigma1 = sqr(sigma_1), sigma2 = sqr(sigma_2), compared to my notes.

◆ SetAutomaticParameterEstimation()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< 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 = 2*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.

◆ SetCurrentPositionPublic()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::SetCurrentPositionPublic ( const ParametersType param)
inlinevirtual

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

Definition at line 140 of file elxPreconditionedGradientDescent.h.

◆ SetMaximumNumberOfSamplingAttempts()

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

Set the MaximumNumberOfSamplingAttempts.

◆ SetSelfHessian()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::SetSelfHessian ( void  )
protectedvirtual

Get the SelfHessian from the metric and submit as Precondition matrix

◆ StartOptimization()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< 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::StochasticPreconditionedGradientDescentOptimizer.

Field Documentation

◆ m_AutomaticParameterEstimation

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

Definition at line 261 of file elxPreconditionedGradientDescent.h.

◆ m_AutomaticParameterEstimationDone

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

Definition at line 262 of file elxPreconditionedGradientDescent.h.

◆ m_CurrentNumberOfSamplingAttempts

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

Definition at line 255 of file elxPreconditionedGradientDescent.h.

◆ m_MaximumNumberOfSamplingAttempts

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

Private variables for the sampling attempts.

Definition at line 254 of file elxPreconditionedGradientDescent.h.

◆ m_NumberOfGradientMeasurements

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

Definition at line 203 of file elxPreconditionedGradientDescent.h.

◆ m_NumberOfSamplesForExactGradient

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

Definition at line 204 of file elxPreconditionedGradientDescent.h.

◆ m_PreconditionMatrixSet

template<class TElastix >
bool elastix::PreconditionedGradientDescent< TElastix >::m_PreconditionMatrixSet
private

Private variables for self Hessian support.

Definition at line 259 of file elxPreconditionedGradientDescent.h.

◆ m_PreviousErrorAtIteration

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

Definition at line 256 of file elxPreconditionedGradientDescent.h.

◆ m_RandomGenerator

template<class TElastix >
RandomGeneratorPointer elastix::PreconditionedGradientDescent< TElastix >::m_RandomGenerator
protected

RandomGenerator for AddRandomPerturbation.

Definition at line 208 of file elxPreconditionedGradientDescent.h.

◆ m_SettingsVector

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

Variable to store the automatically determined settings for each resolution.

Definition at line 201 of file elxPreconditionedGradientDescent.h.

◆ m_SigmoidScaleFactor

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

Definition at line 205 of file elxPreconditionedGradientDescent.h.



Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo