Loading...
Searching...
No Matches
elastix::OptimizerBase< TElastix > Class Template Reference
Components » Optimizers | Core » Component Base Classes

`#include <elxOptimizerBase.h>`

## Detailed Description

template<class TElastix>
class elastix::OptimizerBase< TElastix >

This class is the elastix base class for all Optimizers.

This class contains all the common functionality for Optimizers.

The parameters used in this class are:

Parameters
  NewSamplesEveryIteration: if this flag is set to "true" some optimizers ask the metric to select a new set of spatial samples in every iteration. This, if used in combination with the correct optimizer (such as the StandardGradientDescent), and ImageSampler (Random, RandomCoordinate, or RandomSparseMask), allows for a very low number of spatial samples (around 2000), even with large images and transforms with a large number of parameters.
  Choose one from {"true", "false"} for every resolution.
  example: (NewSamplesEveryIteration "true" "true" "true")
  Default is "false" for every resolution.

Definition at line 53 of file elxOptimizerBase.h.

Inheritance diagram for elastix::OptimizerBase< TElastix >:
[legend]

## Data Structures

struct | SettingsType

## Public Types

using | ElastixType
using | ITKBaseType = itk::Optimizer
using | ParametersType = typename ITKBaseType::ParametersType
using | RegistrationType
using | Self = OptimizerBase
using | Superclass = BaseComponentSE<TElastix>
Public Types inherited from elastix::BaseComponentSE< TElastix >
using | ElastixType = TElastix
using | RegistrationType = typename ElastixType::RegistrationBaseType
using | Self = BaseComponentSE
using | Superclass = BaseComponent

## Public Member Functions

void | AfterRegistrationBase () override
void | BeforeEachResolutionBase () override
ITKBaseType * | GetAsITKBaseType ()
const ITKBaseType * | GetAsITKBaseType () const
virtual const char * | GetClassName () const
| ITK_DISALLOW_COPY_AND_MOVE (OptimizerBase)
virtual void | SetCurrentPositionPublic (const ParametersType &param)
virtual void | SetSinusScales (double amplitude, double frequency, unsigned long numberOfParameters)
Public Member Functions inherited from elastix::BaseComponentSE< TElastix >
void | AddTargetCellToIterationInfo (const char *const name)
const Configuration * | GetConfiguration () const
ElastixType * | GetElastix () const
auto & | GetIterationInfoAt (const char *const name)
RegistrationType * | GetRegistration () const
| ITK_DISALLOW_COPY_AND_MOVE (BaseComponentSE)
void | RemoveTargetCellFromIterationInfo (const char *const name)
void | SetConfiguration (const Configuration *_arg)
void | SetElastix (ElastixType *_arg)
Public Member Functions inherited from elastix::BaseComponent
virtual void | AfterEachIteration ()
virtual void | AfterEachIterationBase ()
virtual void | AfterEachResolution ()
virtual void | AfterEachResolutionBase ()
virtual void | AfterRegistration ()
virtual int | BeforeAll ()
virtual int | BeforeAllBase ()
virtual void | BeforeEachResolution ()
virtual void | BeforeRegistration ()
virtual void | BeforeRegistrationBase ()
virtual const char * | elxGetClassName () const
const char * | GetComponentLabel () const
| ITK_DISALLOW_COPY_AND_MOVE (BaseComponent)
| itkTypeMacroNoParent (BaseComponent)
void | SetComponentLabel (const char *label, unsigned int idx)

## Protected Types

using | SettingsVectorType = typename std::vector<SettingsType>

## Protected Member Functions

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

## Static Protected Member Functions

static void | PrintSettingsVector (const SettingsVectorType &settings)

## Private Member Functions

| elxDeclarePureVirtualGetSelfMacro (ITKBaseType)

## Private Attributes

bool | m_NewSamplesEveryIteration { false }

## Additional Inherited Members

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 Attributes inherited from elastix::BaseComponentSE< TElastix >
Configuration::ConstPointer | m_Configuration {}
itk::WeakPointer< TElastix > | m_Elastix {}
RegistrationType * | m_Registration {}

## Member Typedef Documentation

## ElastixType

template<class TElastix>

using elastix::BaseComponentSE< TElastix >::ElastixType

Elastix typedef.

Definition at line 57 of file elxBaseComponentSE.h.

## ITKBaseType

template<class TElastix>

using elastix::OptimizerBase< TElastix >::ITKBaseType = itk::Optimizer

ITKBaseType.

Definition at line 70 of file elxOptimizerBase.h.

## ParametersType

template<class TElastix>

using elastix::OptimizerBase< TElastix >::ParametersType = typename ITKBaseType::ParametersType

Typedef needed for the SetCurrentPositionPublic function.

Definition at line 73 of file elxOptimizerBase.h.

## RegistrationType

template<class TElastix>

using elastix::BaseComponentSE< TElastix >::RegistrationType

RegistrationType; NB: this is the elx::RegistrationBase not an itk::Object or something like that.

Definition at line 62 of file elxBaseComponentSE.h.

## Self

template<class TElastix>

using elastix::OptimizerBase< TElastix >::Self = OptimizerBase

Standard ITK-stuff.

Definition at line 59 of file elxOptimizerBase.h.

## SettingsVectorType

template<class TElastix>

using elastix::OptimizerBase< TElastix >::SettingsVectorType = typename std::vector<SettingsType>

protected

Definition at line 133 of file elxOptimizerBase.h.

## Superclass

template<class TElastix>

using elastix::OptimizerBase< TElastix >::Superclass = BaseComponentSE<TElastix>

Definition at line 60 of file elxOptimizerBase.h.

## Constructor & Destructor Documentation

## OptimizerBase()

template<class TElastix>

elastix::OptimizerBase< TElastix >::OptimizerBase | ( |  | ) |

protected default

The constructor.

## ~OptimizerBase()

template<class TElastix>

elastix::OptimizerBase< TElastix >::~OptimizerBase | ( |  | ) |

override protected default

The destructor.

## Member Function Documentation

## AfterRegistrationBase()

template<class TElastix>

void elastix::OptimizerBase< TElastix >::AfterRegistrationBase | ( |  | ) |

override virtual

Execute stuff after registration:

- Compute and print MD5 hash of the transform parameters.

Reimplemented from elastix::BaseComponent.

## BeforeEachResolutionBase()

template<class TElastix>

void elastix::OptimizerBase< TElastix >::BeforeEachResolutionBase | ( |  | ) |

override virtual

Execute stuff before each new pyramid resolution:

- Find out if new samples are used every new iteration in this resolution.

Reimplemented from elastix::BaseComponent.

## elxDeclarePureVirtualGetSelfMacro()

template<class TElastix>

elastix::OptimizerBase< TElastix >::elxDeclarePureVirtualGetSelfMacro | ( | ITKBaseType |  | ) |

private

## GetAsITKBaseType() [1/2]

template<class TElastix>

ITKBaseType * elastix::OptimizerBase< TElastix >::GetAsITKBaseType | ( |  | ) |

inline

Retrieves this object as ITKBaseType.

Definition at line 77 of file elxOptimizerBase.h.

## GetAsITKBaseType() [2/2]

template<class TElastix>

const ITKBaseType * elastix::OptimizerBase< TElastix >::GetAsITKBaseType | ( |  | ) | const

inline

Retrieves this object as ITKBaseType, to use in const functions.

Definition at line 85 of file elxOptimizerBase.h.

## GetClassName()

template<class TElastix>

virtual const char * elastix::OptimizerBase< TElastix >::GetClassName | ( |  | ) | const

virtual

Run-time type information (and related methods).

Reimplemented in elastix::AdaGrad< TElastix >, elastix::AdaptiveStochasticGradientDescent< TElastix >, elastix::AdaptiveStochasticLBFGS< TElastix >, elastix::AdaptiveStochasticVarianceReducedGradient< TElastix >, elastix::CMAEvolutionStrategy< TElastix >, elastix::ConjugateGradient< TElastix >, elastix::ConjugateGradientFRPR< TElastix >, elastix::FiniteDifferenceGradientDescent< TElastix >, elastix::FullSearch< TElastix >, elastix::Powell< TElastix >, elastix::PreconditionedStochasticGradientDescent< TElastix >, elastix::QuasiNewtonLBFGS< TElastix >, elastix::RegularStepGradientDescent< TElastix >, elastix::RSGDEachParameterApart< TElastix >, elastix::Simplex< TElastix >, elastix::SimultaneousPerturbation< TElastix >, and elastix::StandardGradientDescent< TElastix >.

## GetNewSamplesEveryIteration()

template<class TElastix>

virtual bool elastix::OptimizerBase< TElastix >::GetNewSamplesEveryIteration | ( |  | ) | const

protected virtual

Check whether the user asked to select new samples every iteration.

## ITK_DISALLOW_COPY_AND_MOVE()

template<class TElastix>

elastix::OptimizerBase< TElastix >::ITK_DISALLOW_COPY_AND_MOVE | ( | OptimizerBase< TElastix > |  | ) |

## PrintSettingsVector()

template<class TElastix>

void elastix::OptimizerBase< TElastix >::PrintSettingsVector | ( | const SettingsVectorType & | settings | ) |

static protected

Print the contents of the settings vector to log::info.

## SelectNewSamples()

template<class TElastix>

virtual void elastix::OptimizerBase< TElastix >::SelectNewSamples | ( |  | ) |

protected virtual

Force the metric to base its computation on a new subset of image samples. Not every metric may have implemented this.

## SetCurrentPositionPublic()

template<class TElastix>

virtual void elastix::OptimizerBase< TElastix >::SetCurrentPositionPublic | ( | const ParametersType & | param | ) |

virtual

Add empty SetCurrentPositionPublic, so this function is known in every inherited class.

Reimplemented in elastix::StandardGradientDescent< TElastix >.

## SetSinusScales()

template<class TElastix>

virtual void elastix::OptimizerBase< TElastix >::SetSinusScales | ( | double | amplitude,
|  | double | frequency,
|  | unsigned long | numberOfParameters )

virtual

Method that sets the scales defined by a sinus scale[i] = amplitude^( sin(i/nrofparam*2pi*frequency) )

## Field Documentation

## m_NewSamplesEveryIteration

template<class TElastix>

bool elastix::OptimizerBase< TElastix >::m_NewSamplesEveryIteration { false }

private

Member variable to store the user preference for using new samples each iteration.

Definition at line 145 of file elxOptimizerBase.h.

Generated on 1768596610 for elastix by 1.15.0 |