18#ifndef elxPreconditionedGradientDescent_h
19#define elxPreconditionedGradientDescent_h
27#include "itkMersenneTwisterRandomVariateGenerator.h"
71template <
class TElastix>
99 using Superclass1::CostFunctionType;
100 using Superclass1::CostFunctionPointer;
109 using typename Superclass1::ParametersType;
146 this->Superclass1::SetCurrentPosition(param);
158 itkSetMacro(AutomaticParameterEstimation,
bool);
159 itkGetConstMacro(AutomaticParameterEstimation,
bool);
162 itkSetMacro(MaximumNumberOfSamplingAttempts,
unsigned long);
165 itkGetConstReferenceMacro(MaximumNumberOfSamplingAttempts,
unsigned long);
179 double a, A, alpha, fmax, fmin, omega;
273#ifndef ITK_MANUAL_INSTANTIATION
274# include "elxPreconditionedGradientDescent.hxx"
This class is the elastix base class for all Optimizers.
typename ElastixType::RegistrationBaseType RegistrationType
itk::Optimizer ITKBaseType
typename ITKBaseType::ParametersType ParametersType
A gradient descent optimizer with a decaying gain.
virtual void AutomaticParameterEstimation()
typename ImageRandomSamplerBaseType::Pointer ImageRandomSamplerBasePointer
typename ImageGridSamplerType::Pointer ImageGridSamplerPointer
virtual ~PreconditionedGradientDescent()
virtual void StartOptimization()
typename ImageRandomCoordinateSamplerType::Pointer ImageRandomCoordinateSamplerPointer
typename ProgressCommand::Pointer ProgressCommandPointer
unsigned int m_NumberOfSamplesForExactGradient
typename RandomGeneratorType::Pointer RandomGeneratorPointer
typename std::vector< SettingsType > SettingsVectorType
virtual void AddRandomPerturbation(const ParametersType &initialParameters, ParametersType &perturbedParameters, double sigma)
virtual void SetCurrentPositionPublic(const ParametersType ¶m)
typename ImageSamplerBaseType::Pointer ImageSamplerBasePointer
typename RegistrationType::MovingImageType MovingImageType
unsigned long m_MaximumNumberOfSamplingAttempts
typename RegistrationType::FixedImageType FixedImageType
virtual void AfterEachResolution()
elxClassNameMacro("PreconditionedGradientDescent")
virtual void MetricErrorResponse(itk::ExceptionObject &err)
RandomGeneratorPointer m_RandomGenerator
double m_SigmoidScaleFactor
SettingsVectorType m_SettingsVector
virtual void AfterRegistration()
bool m_PreconditionMatrixSet
typename Superclass2::ITKBaseType ITKBaseType
ITK_DISALLOW_COPY_AND_MOVE(PreconditionedGradientDescent)
PreconditionedGradientDescent()
virtual void SampleGradients(const ParametersType &mu0, double &sigma1, double &sigma2)
virtual void PrintSettingsVector(const SettingsVectorType &settings) const
itk::SmartPointer< const Self > ConstPointer
bool m_AutomaticParameterEstimation
virtual void BeforeRegistration()
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
bool m_AutomaticParameterEstimationDone
virtual void SetSelfHessian()
virtual void AfterEachIteration()
virtual void BeforeEachResolution()
unsigned long m_PreviousErrorAtIteration
unsigned int m_NumberOfGradientMeasurements
unsigned long m_CurrentNumberOfSamplingAttempts
itk::SmartPointer< Self > Pointer
virtual void GetScaledDerivativeWithExceptionHandling(const ParametersType ¶meters, DerivativeType &derivative)
virtual void ResumeOptimization()
A specialized Command object for updating the progress of a filter.
itk::SmartPointer< Self > Pointer
This class implements a gradient descent optimizer with adaptive gain.
Samples image voxels on a regular grid.
Samples an image by randomly composing a set of physical coordinates.
This class is a base class for any image sampler that randomly picks samples.
This class is a base class for any image sampler.
DerivativeType::ValueType PreconditionValueType
vnl_sparse_matrix< PreconditionValueType > PreconditionType