#include <elxConjugateGradient.h>
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:
Optimizer: Select this optimizer as follows:
(Optimizer "ConjugateGradient")
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".
MaximumNumberOfIterations: The maximum number of iterations in each resolution.
example: (MaximumNumberOfIterations 100 100 50)
Default value: 100.
MaximumNumberOfLineSearchIterations: The maximum number of iterations in each resolution.
example: (MaximumNumberOfIterations 10 10 5)
Default value: 10.
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.
LineSearchValueTolerance: Determine the Wolfe conditions that the itk::MoreThuenteLineSearchOptimizer tries to satisfy.
example: (LineSearchValueTolerance 0.0001 0.0001 0.0001)
Default value: 0.0001.
LineSearchGradientTolerance: Determine the Wolfe conditions that the itk::MoreThuenteLineSearchOptimizer tries to satisfy.
example: (LineSearchGradientTolerance 0.9 0.9 0.9)
Default value: 0.9.
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.
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.
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".
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 91 of file elxConjugateGradient.h.
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::GenericConjugateGradientOptimizer | |
static Pointer | New () |
Static Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
static Pointer | New () |
Static Public Member Functions inherited from elastix::BaseComponent | |
template<typename TBaseComponent > | |
static auto | AsITKBaseType (TBaseComponent *const baseComponent) -> decltype(baseComponent->GetAsITKBaseType()) |
static void | InitializeElastixExecutable () |
static bool | IsElastixLibrary () |
Protected Member Functions | |
ConjugateGradient () | |
virtual std::string | DeterminePhase () const |
virtual std::string | GetLineSearchStopCondition () const |
void | LineSearch (const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g) override |
bool | TestConvergence (bool firstLineSearchDone) override |
~ConjugateGradient () override=default | |
Protected Member Functions inherited from itk::GenericConjugateGradientOptimizer | |
void | AddBetaDefinition (const BetaDefinitionType &name, ComputeBetaFunctionType function) |
virtual double | ComputeBeta (const DerivativeType &previousGradient, const DerivativeType &gradient, const ParametersType &previousSearchDir) |
double | ComputeBetaDY (const DerivativeType &previousGradient, const DerivativeType &gradient, const ParametersType &previousSearchDir) |
double | ComputeBetaDYHS (const DerivativeType &previousGradient, const DerivativeType &gradient, const ParametersType &previousSearchDir) |
double | ComputeBetaFR (const DerivativeType &previousGradient, const DerivativeType &gradient, const ParametersType &previousSearchDir) |
double | ComputeBetaHS (const DerivativeType &previousGradient, const DerivativeType &gradient, const ParametersType &previousSearchDir) |
double | ComputeBetaPR (const DerivativeType &previousGradient, const DerivativeType &gradient, const ParametersType &previousSearchDir) |
double | ComputeBetaSD (const DerivativeType &previousGradient, const DerivativeType &gradient, const ParametersType &previousSearchDir) |
virtual void | ComputeSearchDirection (const DerivativeType &previousGradient, const DerivativeType &gradient, ParametersType &searchDir) |
GenericConjugateGradientOptimizer () | |
virtual void | LineSearch (const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g) |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | SetInLineSearch (bool _arg) |
~GenericConjugateGradientOptimizer () override=default | |
Protected Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
virtual void | GetScaledDerivative (const ParametersType ¶meters, DerivativeType &derivative) const |
virtual MeasureType | GetScaledValue (const ParametersType ¶meters) const |
virtual void | GetScaledValueAndDerivative (const ParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
ScaledSingleValuedNonLinearOptimizer () | |
void | SetCurrentPosition (const ParametersType ¶m) override |
virtual void | SetScaledCurrentPosition (const ParametersType ¶meters) |
~ScaledSingleValuedNonLinearOptimizer () override=default | |
Protected Member Functions inherited from elastix::OptimizerBase< TElastix > | |
virtual bool | GetNewSamplesEveryIteration () const |
OptimizerBase ()=default | |
virtual void | SelectNewSamples () |
~OptimizerBase () override=default | |
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 | |
LineOptimizerPointer | m_LineOptimizer |
Protected Attributes inherited from itk::GenericConjugateGradientOptimizer | |
BetaDefinitionType | m_BetaDefinition {} |
BetaDefinitionMapType | m_BetaDefinitionMap {} |
DerivativeType | m_CurrentGradient {} |
unsigned long | m_CurrentIteration { 0 } |
double | m_CurrentStepLength { 0.0 } |
MeasureType | m_CurrentValue { 0.0 } |
bool | m_InLineSearch { false } |
bool | m_PreviousGradientAndSearchDirValid { false } |
bool | m_Stop { false } |
StopConditionType | m_StopCondition { StopConditionType::Unknown } |
bool | m_UseDefaultMaxNrOfItWithoutImprovement { true } |
Protected Attributes inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
ScaledCostFunctionPointer | m_ScaledCostFunction {} |
ParametersType | m_ScaledCurrentPosition {} |
Protected Attributes inherited from elastix::BaseComponentSE< TElastix > | |
Configuration::ConstPointer | m_Configuration {} |
itk::WeakPointer< TElastix > | m_Elastix {} |
RegistrationType * | m_Registration {} |
Private Member Functions | |
void | InvokeIterationEvent (const itk::EventObject &event) |
Additional Inherited Members | |
Protected Types inherited from elastix::OptimizerBase< TElastix > | |
using | SettingsVectorType = typename std::vector<SettingsType> |
Static Protected Member Functions inherited from elastix::OptimizerBase< TElastix > | |
static void | PrintSettingsVector (const SettingsVectorType &settings) |
using elastix::ConjugateGradient< TElastix >::ConstPointer = itk::SmartPointer<const Self> |
Definition at line 103 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::EventPassThroughPointer = typename EventPassThroughType::Pointer |
Definition at line 134 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::EventPassThroughType = itk::ReceptorMemberCommand<Self> |
Definition at line 133 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::ITKBaseType = typename Superclass2::ITKBaseType |
Definition at line 128 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::LineOptimizerPointer = LineOptimizerType::Pointer |
Definition at line 132 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::LineOptimizerType = itk::MoreThuenteLineSearchOptimizer |
Extra typedefs
Definition at line 131 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::Pointer = itk::SmartPointer<Self> |
Definition at line 102 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::Self = ConjugateGradient |
Standard ITK.
Definition at line 99 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::Superclass1 = GenericConjugateGradientOptimizer |
Definition at line 100 of file elxConjugateGradient.h.
using elastix::ConjugateGradient< TElastix >::Superclass2 = OptimizerBase<TElastix> |
Definition at line 101 of file elxConjugateGradient.h.
|
strong |
Definition at line 71 of file itkGenericConjugateGradientOptimizer.h.
|
protected |
|
overrideprotecteddefault |
|
overridevirtual |
Reimplemented from elastix::BaseComponent.
|
overridevirtual |
Reimplemented from elastix::BaseComponent.
|
overridevirtual |
Reimplemented from elastix::BaseComponent.
|
overridevirtual |
Reimplemented from elastix::BaseComponent.
|
overridevirtual |
Methods to set parameters and print output at different stages in the registration process.
Reimplemented from elastix::BaseComponent.
|
protectedvirtual |
Generate a string, representing the phase of optimisation (line search, main)
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")
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::GenericConjugateGradientOptimizer.
|
protectedvirtual |
Convert the line search stop condition to a string
|
virtual |
|
private |
elastix::ConjugateGradient< TElastix >::ITK_DISALLOW_COPY_AND_MOVE | ( | ConjugateGradient< TElastix > | ) |
|
overrideprotected |
Call the superclass' implementation. If an itk::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.
|
static |
Method for creation through the object factory.
|
override |
Check if any scales are set, and set the UseScales flag on or off; after that call the superclass' implementation
|
overrideprotectedvirtual |
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.
|
private |
Definition at line 190 of file elxConjugateGradient.h.
|
private |
Definition at line 195 of file elxConjugateGradient.h.
|
private |
Definition at line 198 of file elxConjugateGradient.h.
|
protected |
Definition at line 164 of file elxConjugateGradient.h.
|
private |
Definition at line 196 of file elxConjugateGradient.h.
|
private |
Definition at line 197 of file elxConjugateGradient.h.
|
private |
Definition at line 199 of file elxConjugateGradient.h.
|
private |
Definition at line 200 of file elxConjugateGradient.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |