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

#include <elxConjugateGradient.h>

Inheritance diagram for elastix::ConjugateGradient< TElastix >:
Inheritance graph
[legend]
Collaboration diagram for elastix::ConjugateGradient< 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 ConjugateGradient Self
typedef
Superclass1::StopConditionType 
StopConditionType
typedef
GenericConjugateGradientOptimizer 
Superclass1
typedef OptimizerBase< TElastix > Superclass2

Public Member Functions

virtual void AfterEachIteration (void)
virtual void AfterEachResolution (void)
virtual void AfterRegistration (void)
virtual void BeforeEachResolution (void)
virtual void BeforeRegistration (void)
 elxClassNameMacro ("ConjugateGradient")
virtual const char * GetClassName () const
virtual bool GetStartLineSearch () const
virtual void StartOptimization (void)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 ConjugateGradient ()
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)
virtual bool TestConvergence (bool firstLineSearchDone)
virtual ~ConjugateGradient ()

Protected Attributes

LineOptimizerPointer m_LineOptimizer

Private Member Functions

 ConjugateGradient (const Self &)
void InvokeIterationEvent (const EventObject &event)
void operator= (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::ConjugateGradient< TElastix >

An optimizer based on the itk::GenericConjugateGradientOptimizer.

A ConjugateGradient optimizer, using the itk::MoreThuenteLineSearchOptimizer. Different conjugate gradient methods can be selected with this optimizer.

This optimizer support 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 conjugate gradient optimizer. So, think twice before using the NewSamplesEveryIteration option.

The parameters used in this class are:

Parameters:
Optimizer: Select this optimizer as follows:
(Optimizer "ConjugateGradient")
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 iterations in each resolution.
example: (MaximumNumberOfIterations 10 10 5)
Default value: 10.
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:
ValueTolerance: Stopping criterion. See the documentation of the itk::GenericConjugateGradientOptimizer for more information.
example: (ValueTolerance 0.001 0.0001 0.000001)
Default value: 0.00001.
Parameters:
GradientMagnitudeTolerance: Stopping criterion. See the documentation of the itk::GenericConjugateGradientOptimizer for more information.
example: (GradientMagnitudeTolerance 0.001 0.0001 0.000001)
Default value: 0.000001.
Parameters:
ConjugateGradientType: a string that defines how 'beta' is computed in each resolution. The following methods are implemented: "SteepestDescent", "FletcherReeves", "PolakRibiere", "DaiYuan", "HestenesStiefel", and "DaiYuanHestenesStiefel". "SteepestDescent" simply sets beta=0. See the source code of the GenericConjugateGradientOptimizer for more information.
example: (ConjugateGradientType "FletcherReeves" "PolakRibiere")
Default value: "DaiYuanHestenesStiefel".
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 90 of file elxConjugateGradient.h.


Member Typedef Documentation

Reimplemented from elastix::OptimizerBase< TElastix >.

Definition at line 129 of file elxConjugateGradient.h.

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

Reimplemented from elastix::OptimizerBase< TElastix >.

Definition at line 128 of file elxConjugateGradient.h.

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

Reimplemented from itk::GenericConjugateGradientOptimizer.

Definition at line 103 of file elxConjugateGradient.h.

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

Definition at line 119 of file elxConjugateGradient.h.

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

Typedef's inherited from Superclass1.

Reimplemented from itk::GenericConjugateGradientOptimizer.

Definition at line 118 of file elxConjugateGradient.h.

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

Reimplemented from itk::GenericConjugateGradientOptimizer.

Definition at line 122 of file elxConjugateGradient.h.

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

Reimplemented from elastix::OptimizerBase< TElastix >.

Definition at line 127 of file elxConjugateGradient.h.

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

Typedef's inherited from Elastix.

Reimplemented from elastix::OptimizerBase< TElastix >.

Definition at line 126 of file elxConjugateGradient.h.

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

Definition at line 138 of file elxConjugateGradient.h.

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

Definition at line 137 of file elxConjugateGradient.h.

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

Reimplemented from elastix::OptimizerBase< TElastix >.

Definition at line 132 of file elxConjugateGradient.h.

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

Definition at line 136 of file elxConjugateGradient.h.

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

Extra typedefs

Definition at line 135 of file elxConjugateGradient.h.

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

Reimplemented from itk::GenericConjugateGradientOptimizer.

Definition at line 121 of file elxConjugateGradient.h.

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

Reimplemented from itk::GenericConjugateGradientOptimizer.

Definition at line 102 of file elxConjugateGradient.h.

Reimplemented from elastix::OptimizerBase< TElastix >.

Definition at line 131 of file elxConjugateGradient.h.

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

Reimplemented from elastix::OptimizerBase< TElastix >.

Definition at line 130 of file elxConjugateGradient.h.

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

Reimplemented from itk::GenericConjugateGradientOptimizer.

Definition at line 123 of file elxConjugateGradient.h.

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

Standard ITK.

Reimplemented from itk::GenericConjugateGradientOptimizer.

Definition at line 99 of file elxConjugateGradient.h.

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

Reimplemented from itk::GenericConjugateGradientOptimizer.

Definition at line 120 of file elxConjugateGradient.h.

template<class TElastix >
typedef GenericConjugateGradientOptimizer elastix::ConjugateGradient< TElastix >::Superclass1

Definition at line 100 of file elxConjugateGradient.h.

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

Definition at line 101 of file elxConjugateGradient.h.


Constructor & Destructor Documentation

template<class TElastix >
elastix::ConjugateGradient< TElastix >::ConjugateGradient ( ) [protected]
template<class TElastix >
virtual elastix::ConjugateGradient< TElastix >::~ConjugateGradient ( ) [inline, protected, virtual]

Definition at line 158 of file elxConjugateGradient.h.

template<class TElastix >
elastix::ConjugateGradient< TElastix >::ConjugateGradient ( const Self ) [private]

Member Function Documentation

template<class TElastix >
virtual void elastix::ConjugateGradient< TElastix >::AfterEachIteration ( void  ) [virtual]

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::ConjugateGradient< TElastix >::AfterEachResolution ( void  ) [virtual]

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::ConjugateGradient< TElastix >::AfterRegistration ( void  ) [virtual]

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::ConjugateGradient< TElastix >::BeforeEachResolution ( void  ) [virtual]

Reimplemented from elastix::BaseComponent.

template<class TElastix >
virtual void elastix::ConjugateGradient< 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::ConjugateGradient< TElastix >::DeterminePhase ( void  ) const [protected, virtual]

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

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

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

template<class TElastix >
virtual const char* elastix::ConjugateGradient< TElastix >::GetClassName ( ) const [virtual]

Run-time type information (and related methods).

Reimplemented from itk::GenericConjugateGradientOptimizer.

template<class TElastix >
virtual std::string elastix::ConjugateGradient< TElastix >::GetLineSearchStopCondition ( void  ) const [protected, virtual]

Convert the line search stop condition to a string

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

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::GenericConjugateGradientOptimizer.

template<class TElastix >
static Pointer elastix::ConjugateGradient< TElastix >::New ( ) [static]

Method for creation through the object factory.

Reimplemented from itk::GenericConjugateGradientOptimizer.

template<class TElastix >
void elastix::ConjugateGradient< TElastix >::operator= ( const Self ) [private]
template<class TElastix >
virtual void elastix::ConjugateGradient< 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::GenericConjugateGradientOptimizer.

template<class TElastix >
virtual bool elastix::ConjugateGradient< TElastix >::TestConvergence ( bool  firstLineSearchDone) [protected, virtual]

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

Reimplemented from itk::GenericConjugateGradientOptimizer.


Field Documentation

template<class TElastix >
EventPassThroughPointer elastix::ConjugateGradient< TElastix >::m_EventPasser [private]

Definition at line 192 of file elxConjugateGradient.h.

template<class TElastix >
bool elastix::ConjugateGradient< TElastix >::m_GenerateLineSearchIterations [private]

Definition at line 195 of file elxConjugateGradient.h.

template<class TElastix >
LineOptimizerPointer elastix::ConjugateGradient< TElastix >::m_LineOptimizer [protected]

Definition at line 158 of file elxConjugateGradient.h.

template<class TElastix >
double elastix::ConjugateGradient< TElastix >::m_SearchDirectionMagnitude [private]

Definition at line 193 of file elxConjugateGradient.h.

template<class TElastix >
bool elastix::ConjugateGradient< TElastix >::m_StartLineSearch [private]

Definition at line 194 of file elxConjugateGradient.h.

template<class TElastix >
bool elastix::ConjugateGradient< TElastix >::m_StopIfWolfeNotSatisfied [private]

Definition at line 196 of file elxConjugateGradient.h.

template<class TElastix >
bool elastix::ConjugateGradient< TElastix >::m_WolfeIsStopCondition [private]

Definition at line 197 of file elxConjugateGradient.h.



Generated on 11-05-2012 for elastix by doxygen 1.7.6.1 elastix logo