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 | Protected Member Functions | Private Member Functions | Private Attributes
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 >:
Inheritance graph
[legend]

Public Types

using ElastixType = TElastix
 
using ITKBaseType = itk::Optimizer
 
using ParametersType = typename ITKBaseType::ParametersType
 
using RegistrationType = typename ElastixType::RegistrationBaseType
 
using Self = OptimizerBase
 
using Superclass = BaseComponentSE< TElastix >
 
- Public Types inherited from elastix::BaseComponentSE< TElastix >
using ConfigurationPointer = Configuration::Pointer
 
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)
 
ConfigurationGetConfiguration () const
 
ElastixTypeGetElastix () const
 
xl::xoutbaseGetIterationInfoAt (const char *const name)
 
RegistrationTypeGetRegistration () const
 
 ITK_DISALLOW_COPY_AND_MOVE (BaseComponentSE)
 
int RemoveTargetCellFromIterationInfo (const char *const name)
 
void SetConfiguration (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 void AfterRegistrationBase ()
 
virtual int BeforeAll ()
 
virtual int BeforeAllBase ()
 
virtual void BeforeEachResolution ()
 
virtual void BeforeEachResolutionBase ()
 
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 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
 

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 >
ConfigurationPointer m_Configuration {}
 
itk::WeakPointer< TElastix > m_Elastix {}
 
RegistrationTypem_Registration {}
 

Member Typedef Documentation

◆ ElastixType

template<class TElastix >
using elastix::BaseComponentSE< TElastix >::ElastixType = TElastix

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 = typename ElastixType::RegistrationBaseType

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

Definition at line 65 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.

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

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

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

◆ 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::PreconditionedGradientDescent< TElastix >, and 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 135 of file elxOptimizerBase.h.



Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo