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

#include <elxQuasiNewtonLBFGS.h>

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

Public Types

typedef
Superclass2::ConfigurationPointer 
ConfigurationPointer
typedef
Superclass2::ConfigurationType 
ConfigurationType
typedef SmartPointer< const SelfConstPointer
typedef
Superclass1::CostFunctionPointer 
CostFunctionPointer
typedef
Superclass1::CostFunctionType 
CostFunctionType
typedef Superclass1::DerivativeType DerivativeType
typedef Superclass2::ElastixPointer ElastixPointer
typedef Superclass2::ElastixType ElastixType
typedef
EventPassThroughType::Pointer 
EventPassThroughPointer
typedef ReceptorMemberCommand
< Self
EventPassThroughType
typedef Superclass2::ITKBaseType ITKBaseType
typedef LineOptimizerType::Pointer LineOptimizerPointer
typedef
MoreThuenteLineSearchOptimizer 
LineOptimizerType
typedef Superclass1::ParametersType ParametersType
typedef SmartPointer< SelfPointer
typedef
Superclass2::RegistrationPointer 
RegistrationPointer
typedef
Superclass2::RegistrationType 
RegistrationType
typedef Superclass1::ScalesType ScalesType
typedef QuasiNewtonLBFGS Self
typedef
Superclass1::StopConditionType 
StopConditionType
typedef QuasiNewtonLBFGSOptimizer Superclass1
typedef OptimizerBase< TElastix > Superclass2
- Public Types inherited from itk::QuasiNewtonLBFGSOptimizer
typedef SmartPointer< const SelfConstPointer
typedef
Superclass::CostFunctionType 
CostFunctionType
typedef Superclass::DerivativeType DerivativeType
typedef Array< doubleDiagonalMatrixType
typedef
LineSearchOptimizerType::Pointer 
LineSearchOptimizerPointer
typedef LineSearchOptimizer LineSearchOptimizerType
typedef Superclass::MeasureType MeasureType
typedef Superclass::ParametersType ParametersType
typedef SmartPointer< SelfPointer
typedef Array< doubleRhoType
typedef
Superclass::ScaledCostFunctionType 
ScaledCostFunctionType
typedef Superclass::ScalesType ScalesType
typedef QuasiNewtonLBFGSOptimizer Self
enum  StopConditionType {
  MetricError, LineSearchError, MaximumNumberOfIterations, InvalidDiagonalMatrix,
  GradientMagnitudeTolerance, ZeroStep, Unknown
}
typedef std::vector
< ParametersType
SType
typedef
ScaledSingleValuedNonLinearOptimizer 
Superclass
typedef std::vector
< DerivativeType
YType
- 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 ("QuasiNewtonLBFGS")
virtual const char * GetClassName () const
virtual bool GetStartLineSearch () const
virtual void StartOptimization (void)
- Public Member Functions inherited from itk::QuasiNewtonLBFGSOptimizer
virtual const DerivativeTypeGetCurrentGradient ()
virtual unsigned long GetCurrentIteration () const
virtual double GetCurrentStepLength () const
virtual MeasureType GetCurrentValue () const
virtual double GetGradientMagnitudeTolerance () const
virtual bool GetInLineSearch () const
virtual LineSearchOptimizerTypeGetLineSearchOptimizer ()
virtual unsigned long GetMaximumNumberOfIterations () const
virtual unsigned int GetMemory () const
virtual const StopConditionTypeGetStopCondition ()
virtual void ResumeOptimization (void)
virtual void SetGradientMagnitudeTolerance (double _arg)
virtual void SetLineSearchOptimizer (LineSearchOptimizerType *_arg)
virtual void SetMaximumNumberOfIterations (unsigned long _arg)
virtual void SetMemory (unsigned int _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 ()

Protected Member Functions

virtual std::string DeterminePhase (void) const
virtual std::string GetLineSearchStopCondition (void) const
virtual void LineSearch (const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g)
 QuasiNewtonLBFGS ()
virtual bool TestConvergence (bool firstLineSearchDone)
virtual ~QuasiNewtonLBFGS ()
- Protected Member Functions inherited from itk::QuasiNewtonLBFGSOptimizer
virtual void ComputeDiagonalMatrix (DiagonalMatrixType &diag_H0)
virtual void ComputeSearchDirection (const DerivativeType &gradient, ParametersType &searchDir)
void PrintSelf (std::ostream &os, Indent indent) const
 QuasiNewtonLBFGSOptimizer ()
virtual void SetInLineSearch (bool _arg)
virtual void StoreCurrentPoint (const ParametersType &step, const DerivativeType &grad_dif)
virtual ~QuasiNewtonLBFGSOptimizer ()
- 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
 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

LineOptimizerPointer m_LineOptimizer
- Protected Attributes inherited from itk::QuasiNewtonLBFGSOptimizer
unsigned int m_Bound
DerivativeType m_CurrentGradient
unsigned long m_CurrentIteration
double m_CurrentStepLength
MeasureType m_CurrentValue
bool m_InLineSearch
unsigned int m_Point
unsigned int m_PreviousPoint
RhoType m_Rho
SType m_S
bool m_Stop
StopConditionType m_StopCondition
YType m_Y
- Protected Attributes inherited from itk::ScaledSingleValuedNonLinearOptimizer
ScaledCostFunctionPointer m_ScaledCostFunction
ParametersType m_ScaledCurrentPosition

Private Member Functions

void InvokeIterationEvent (const EventObject &event)
void operator= (const Self &)
 QuasiNewtonLBFGS (const Self &)

Private Attributes

EventPassThroughPointer m_EventPasser
bool m_GenerateLineSearchIterations
double m_SearchDirectionMagnitude
bool m_StartLineSearch
bool m_StopIfWolfeNotSatisfied
bool m_WolfeIsStopCondition

Detailed Description

template<class TElastix>
class elastix::QuasiNewtonLBFGS< TElastix >

An optimizer based on the itk::QuasiNewtonLBFGSOptimizer.

The QuasiNewtonLBFGS class is a wrap around the QuasiNewtonLBFGSOptimizer. It uses the itk::MoreThuenteLineSearchOptimizer. Please read the documentation of these classes to find out more about it.

This optimizer supports the NewSamplesEveryIteration option. It requests new samples for the computation of each search direction (not during the line search). Actually this makes no sense for a QuasiNewton optimizer. So, think twice before using the NewSamplesEveryIteration option.

The parameters used in this class are:

Parameters:
Optimizer: Select this optimizer as follows:
(Optimizer "QuasiNewtonLBFGS")
Parameters:
GenerateLineSearchIterations: Whether line search iteration should be counted as elastix-iterations.
example: (GenerateLineSearchIterations "true")
Can only be specified for all resolutions at once.
Default value: "false".
Parameters:
MaximumNumberOfIterations: The maximum number of iterations in each resolution.
example: (MaximumNumberOfIterations 100 100 50)
Default value: 100.
Parameters:
MaximumNumberOfLineSearchIterations: The maximum number of line search iterations in each resolution.
example: (MaximumNumberOfLineSearchIterations 10 10 5)
Default value: 20.
Parameters:
StepLength: Set the length of the initial step tried by the itk::MoreThuenteLineSearchOptimizer.
example: (StepLength 2.0 1.0 0.5)
Default value: 1.0.
Parameters:
LineSearchValueTolerance: Determine the Wolfe conditions that the itk::MoreThuenteLineSearchOptimizer tries to satisfy.
example: (LineSearchValueTolerance 0.0001 0.0001 0.0001)
Default value: 0.0001.
Parameters:
LineSearchGradientTolerance: Determine the Wolfe conditions that the itk::MoreThuenteLineSearchOptimizer tries to satisfy.
example: (LineSearchGradientTolerance 0.9 0.9 0.9)
Default value: 0.9.
Parameters:
GradientMagnitudeTolerance: Stopping criterion. See the documentation of the itk::QuasiNewtonLBFGSOptimizer for more information.
example: (GradientMagnitudeTolerance 0.001 0.0001 0.000001)
Default value: 0.000001.
Parameters:
LBFGSUpdateAccuracy: The "memory" of the optimizer. This determines how many past iterations are used to construct the Hessian approximation. The higher, the more memory is used, but the better the Hessian approximation. If set to zero, The QuasiNewtonLBFGS equals a gradient descent method with line search.
example: (LBFGSUpdateAccuracy 5 10 20)
Default value: 5.
Parameters:
StopIfWolfeNotSatisfied: Whether to stop the optimisation if in one iteration the Wolfe conditions can not be satisfied by the itk::MoreThuenteLineSearchOptimizer.
In general it is wise to do so.
example: (StopIfWolfeNotSatisfied "true" "false")
Default value: "true".

Definition at line 87 of file elxQuasiNewtonLBFGS.h.

Member Typedef Documentation

Definition at line 126 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 125 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 100 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 116 of file elxQuasiNewtonLBFGS.h.

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

Typedef's inherited from Superclass1.

Definition at line 115 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
typedef Superclass1::DerivativeType elastix::QuasiNewtonLBFGS< TElastix >::DerivativeType

Definition at line 119 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 124 of file elxQuasiNewtonLBFGS.h.

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

Typedef's inherited from Elastix.

Definition at line 123 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
typedef EventPassThroughType::Pointer elastix::QuasiNewtonLBFGS< TElastix >::EventPassThroughPointer

Definition at line 135 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
typedef ReceptorMemberCommand<Self> elastix::QuasiNewtonLBFGS< TElastix >::EventPassThroughType

Definition at line 134 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 129 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
typedef LineOptimizerType::Pointer elastix::QuasiNewtonLBFGS< TElastix >::LineOptimizerPointer

Definition at line 133 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
typedef MoreThuenteLineSearchOptimizer elastix::QuasiNewtonLBFGS< TElastix >::LineOptimizerType

Extra typedefs

Definition at line 132 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 118 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 99 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 128 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 127 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
typedef Superclass1::ScalesType elastix::QuasiNewtonLBFGS< TElastix >::ScalesType

Definition at line 120 of file elxQuasiNewtonLBFGS.h.

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

Standard ITK.

Definition at line 96 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 117 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
typedef QuasiNewtonLBFGSOptimizer elastix::QuasiNewtonLBFGS< TElastix >::Superclass1

Definition at line 97 of file elxQuasiNewtonLBFGS.h.

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

Definition at line 98 of file elxQuasiNewtonLBFGS.h.

Constructor & Destructor Documentation

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

Definition at line 155 of file elxQuasiNewtonLBFGS.h.

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

Member Function Documentation

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

Reimplemented from elastix::BaseComponent.

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

Reimplemented from elastix::BaseComponent.

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

Reimplemented from elastix::BaseComponent.

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

Reimplemented from elastix::BaseComponent.

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

Methods to set parameters and print output at different stages in the registration process.

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual std::string elastix::QuasiNewtonLBFGS< TElastix >::DeterminePhase ( void  ) const
protectedvirtual

Generate a string, representing the phase of optimisation (line search, main)

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

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

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

Run-time type information (and related methods).

Reimplemented from itk::QuasiNewtonLBFGSOptimizer.

template<class TElastix >
virtual std::string elastix::QuasiNewtonLBFGS< TElastix >::GetLineSearchStopCondition ( void  ) const
protectedvirtual

Convert the line search stop condition to a string

template<class TElastix >
virtual bool elastix::QuasiNewtonLBFGS< TElastix >::GetStartLineSearch ( ) const
virtual
template<class TElastix >
void elastix::QuasiNewtonLBFGS< TElastix >::InvokeIterationEvent ( const EventObject &  event)
private
template<class TElastix >
virtual void elastix::QuasiNewtonLBFGS< TElastix >::LineSearch ( const ParametersType  searchDir,
double step,
ParametersType x,
MeasureType f,
DerivativeType g 
)
protectedvirtual

Call the superclass' implementation. If an ExceptionObject is caught, because the line search optimizer tried a too big step, the exception is printed, but ignored further. The optimizer stops, but elastix just goes on to the next resolution.

Reimplemented from itk::QuasiNewtonLBFGSOptimizer.

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

Method for creation through the object factory.

Reimplemented from itk::QuasiNewtonLBFGSOptimizer.

template<class TElastix >
void elastix::QuasiNewtonLBFGS< TElastix >::operator= ( const Self )
private
template<class TElastix >
virtual void elastix::QuasiNewtonLBFGS< 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::QuasiNewtonLBFGSOptimizer.

template<class TElastix >
virtual bool elastix::QuasiNewtonLBFGS< TElastix >::TestConvergence ( bool  firstLineSearchDone)
protectedvirtual

Reimplement the superclass. Calls the superclass' implementation and checks if the MoreThuente line search routine has stopped with Wolfe conditions satisfied.

Reimplemented from itk::QuasiNewtonLBFGSOptimizer.

Field Documentation

template<class TElastix >
EventPassThroughPointer elastix::QuasiNewtonLBFGS< TElastix >::m_EventPasser
private

Definition at line 189 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
bool elastix::QuasiNewtonLBFGS< TElastix >::m_GenerateLineSearchIterations
private

Definition at line 192 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
LineOptimizerPointer elastix::QuasiNewtonLBFGS< TElastix >::m_LineOptimizer
protected

Definition at line 155 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
double elastix::QuasiNewtonLBFGS< TElastix >::m_SearchDirectionMagnitude
private

Definition at line 190 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
bool elastix::QuasiNewtonLBFGS< TElastix >::m_StartLineSearch
private

Definition at line 191 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
bool elastix::QuasiNewtonLBFGS< TElastix >::m_StopIfWolfeNotSatisfied
private

Definition at line 193 of file elxQuasiNewtonLBFGS.h.

template<class TElastix >
bool elastix::QuasiNewtonLBFGS< TElastix >::m_WolfeIsStopCondition
private

Definition at line 194 of file elxQuasiNewtonLBFGS.h.



Generated on 21-03-2014 for elastix by doxygen 1.8.1.2 elastix logo