go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elastix::OptimizerBase< TElastix > Class Template Reference

#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 >:

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
 
ITKBaseTypeGetAsITKBaseType ()
 
const ITKBaseTypeGetAsITKBaseType () 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 ConfigurationGetConfiguration () const
 
ElastixTypeGetElastix () const
 
auto & GetIterationInfoAt (const char *const name)
 
RegistrationTypeGetRegistration () 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 {}
 
RegistrationTypem_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 ( )
protecteddefault

The constructor.

◆ ~OptimizerBase()

template<class TElastix >
elastix::OptimizerBase< TElastix >::~OptimizerBase ( )
overrideprotecteddefault

The destructor.

Member Function Documentation

◆ AfterRegistrationBase()

template<class TElastix >
void elastix::OptimizerBase< TElastix >::AfterRegistrationBase ( )
overridevirtual

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 ( )
overridevirtual

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()

◆ GetNewSamplesEveryIteration()

template<class TElastix >
virtual bool elastix::OptimizerBase< TElastix >::GetNewSamplesEveryIteration ( ) const
protectedvirtual

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 >
static void elastix::OptimizerBase< TElastix >::PrintSettingsVector ( const SettingsVectorType & settings)
staticprotected

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

◆ SelectNewSamples()

template<class TElastix >
virtual void elastix::OptimizerBase< TElastix >::SelectNewSamples ( )
protectedvirtual

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 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo