go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itk::FullSearchOptimizer Class Reference

#include <itkFullSearchOptimizer.h>

Detailed Description

An optimizer based on full search.

Optimizer that scans a subspace of the parameter space and searches for the best parameters.

Todo
This optimizer has similar functionality as the recently added itkExhaustiveOptimizer. See if we can replace it by that optimizer, or inherit from it.
See also
FullSearch

Definition at line 46 of file itkFullSearchOptimizer.h.

Inheritance diagram for itk::FullSearchOptimizer:

Public Types

using ConstPointer = SmartPointer<const Self>
 
using ParameterValueType = ParametersType::ValueType
 
using Pointer = SmartPointer<Self>
 
using RangeType = FixedArray<RangeValueType, 3>
 
using RangeValueType = ParameterValueType
 
using SearchSpaceIndexType = Array<IndexValueType>
 
using SearchSpaceIteratorType = SearchSpaceType::ConstIterator
 
using SearchSpacePointer = SearchSpaceType::Pointer
 
using SearchSpacePointType = Array<ParameterValueType>
 
using SearchSpaceSizeType = Array<SizeValueType>
 
using SearchSpaceType = MapContainer<unsigned int, RangeType>
 
using Self = FullSearchOptimizer
 
enum  StopConditionType { FullRangeSearched , MetricError }
 
using Superclass = SingleValuedNonLinearOptimizer
 

Public Member Functions

virtual void AddSearchDimension (unsigned int param_nr, RangeValueType minimum, RangeValueType maximum, RangeValueType step)
 
virtual const SearchSpaceIndexTypeGetBestIndexInSearchSpace ()
 
virtual const SearchSpacePointTypeGetBestPointInSearchSpace ()
 
virtual double GetBestValue () const
 
virtual const char * GetClassName () const
 
virtual const SearchSpaceIndexTypeGetCurrentIndexInSearchSpace ()
 
virtual unsigned long GetCurrentIteration () const
 
virtual const SearchSpacePointTypeGetCurrentPointInSearchSpace ()
 
virtual bool GetMaximize () const
 
bool GetMinimize () const
 
virtual unsigned long GetNumberOfIterations ()
 
virtual unsigned int GetNumberOfSearchSpaceDimensions ()
 
virtual const SearchSpaceSizeTypeGetSearchSpaceSize ()
 
virtual StopConditionType GetStopCondition () const
 
virtual double GetValue () const
 
virtual SearchSpacePointType IndexToPoint (const SearchSpaceIndexType &index)
 
virtual ParametersType IndexToPosition (const SearchSpaceIndexType &index)
 
 ITK_DISALLOW_COPY_AND_MOVE (FullSearchOptimizer)
 
 itkGetModifiableObjectMacro (SearchSpace, SearchSpaceType)
 
virtual void MaximizeOff ()
 
virtual void MaximizeOn ()
 
void MinimizeOff ()
 
void MinimizeOn ()
 
virtual ParametersType PointToPosition (const SearchSpacePointType &point)
 
virtual void RemoveSearchDimension (unsigned int param_nr)
 
virtual void ResumeOptimization ()
 
virtual void SetMaximize (bool _arg)
 
void SetMinimize (bool v)
 
virtual void SetSearchSpace (SearchSpaceType *_arg)
 
void StartOptimization () override
 
virtual void StopOptimization ()
 
virtual void UpdateCurrentPosition ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 FullSearchOptimizer ()
 
virtual void ProcessSearchSpaceChanges ()
 
 ~FullSearchOptimizer () override=default
 

Protected Attributes

SearchSpaceIndexType m_BestIndexInSearchSpace {}
 
SearchSpacePointType m_BestPointInSearchSpace {}
 
double m_BestValue { 0.0 }
 
SearchSpaceIndexType m_CurrentIndexInSearchSpace {}
 
SearchSpacePointType m_CurrentPointInSearchSpace {}
 
unsigned long m_LastSearchSpaceChanges { 0 }
 
bool m_Maximize { false }
 
unsigned int m_NumberOfSearchSpaceDimensions { 0 }
 
SearchSpacePointer m_SearchSpace { nullptr }
 
SearchSpaceSizeType m_SearchSpaceSize {}
 
bool m_Stop { false }
 
StopConditionType m_StopCondition { FullRangeSearched }
 
double m_Value { 0.0 }
 

Private Attributes

unsigned long m_CurrentIteration { 0 }
 

Member Typedef Documentation

◆ ConstPointer

using itk::FullSearchOptimizer::ConstPointer = SmartPointer<const Self>

Definition at line 55 of file itkFullSearchOptimizer.h.

◆ ParameterValueType

using itk::FullSearchOptimizer::ParameterValueType = ParametersType::ValueType

Definition at line 76 of file itkFullSearchOptimizer.h.

◆ Pointer

using itk::FullSearchOptimizer::Pointer = SmartPointer<Self>

Definition at line 54 of file itkFullSearchOptimizer.h.

◆ RangeType

Definition at line 78 of file itkFullSearchOptimizer.h.

◆ RangeValueType

◆ SearchSpaceIndexType

using itk::FullSearchOptimizer::SearchSpaceIndexType = Array<IndexValueType>

The same values, but transformed to integer indices. These can be used to create an image visualizing the search space.

Definition at line 89 of file itkFullSearchOptimizer.h.

◆ SearchSpaceIteratorType

using itk::FullSearchOptimizer::SearchSpaceIteratorType = SearchSpaceType::ConstIterator

Definition at line 81 of file itkFullSearchOptimizer.h.

◆ SearchSpacePointer

using itk::FullSearchOptimizer::SearchSpacePointer = SearchSpaceType::Pointer

Definition at line 80 of file itkFullSearchOptimizer.h.

◆ SearchSpacePointType

Type that stores the parameter values of the parameters to be optimized. Updated every iteration.

Definition at line 85 of file itkFullSearchOptimizer.h.

◆ SearchSpaceSizeType

using itk::FullSearchOptimizer::SearchSpaceSizeType = Array<SizeValueType>

The size of each dimension to be searched ((max-min)/step))

Definition at line 92 of file itkFullSearchOptimizer.h.

◆ SearchSpaceType

using itk::FullSearchOptimizer::SearchSpaceType = MapContainer<unsigned int, RangeType>

Definition at line 79 of file itkFullSearchOptimizer.h.

◆ Self

Standard class typedefs.

Definition at line 52 of file itkFullSearchOptimizer.h.

◆ Superclass

Member Enumeration Documentation

◆ StopConditionType

Codes of stopping conditions

Enumerator
FullRangeSearched 
MetricError 

Definition at line 64 of file itkFullSearchOptimizer.h.

Constructor & Destructor Documentation

◆ FullSearchOptimizer()

itk::FullSearchOptimizer::FullSearchOptimizer ( )
protected

◆ ~FullSearchOptimizer()

itk::FullSearchOptimizer::~FullSearchOptimizer ( )
overrideprotecteddefault

Member Function Documentation

◆ AddSearchDimension()

virtual void itk::FullSearchOptimizer::AddSearchDimension ( unsigned int param_nr,
RangeValueType minimum,
RangeValueType maximum,
RangeValueType step )
virtual

Add/Remove a dimension to/from the SearchSpace

◆ GetBestIndexInSearchSpace()

virtual const SearchSpaceIndexType & itk::FullSearchOptimizer::GetBestIndexInSearchSpace ( )
virtual

◆ GetBestPointInSearchSpace()

virtual const SearchSpacePointType & itk::FullSearchOptimizer::GetBestPointInSearchSpace ( )
virtual

Get the point in SearchSpace that is currently the most optimal

◆ GetBestValue()

virtual double itk::FullSearchOptimizer::GetBestValue ( ) const
virtual

Get the best value.

◆ GetClassName()

virtual const char * itk::FullSearchOptimizer::GetClassName ( ) const
virtual

Run-time type information (and related methods).

Reimplemented in elastix::FullSearch< TElastix >.

◆ GetCurrentIndexInSearchSpace()

virtual const SearchSpaceIndexType & itk::FullSearchOptimizer::GetCurrentIndexInSearchSpace ( )
virtual

◆ GetCurrentIteration()

virtual unsigned long itk::FullSearchOptimizer::GetCurrentIteration ( ) const
virtual

Get the current iteration number.

◆ GetCurrentPointInSearchSpace()

virtual const SearchSpacePointType & itk::FullSearchOptimizer::GetCurrentPointInSearchSpace ( )
virtual

Get the point in SearchSpace that is currently evaluated

◆ GetMaximize()

virtual bool itk::FullSearchOptimizer::GetMaximize ( ) const
virtual

NB: The methods SetScales has no influence! Methods to configure the cost function.

◆ GetMinimize()

bool itk::FullSearchOptimizer::GetMinimize ( ) const
inline

Definition at line 101 of file itkFullSearchOptimizer.h.

◆ GetNumberOfIterations()

virtual unsigned long itk::FullSearchOptimizer::GetNumberOfIterations ( )
virtual

Get the total number of iterations = sizes[0]*sizes[1]*sizes[2]* etc.....

◆ GetNumberOfSearchSpaceDimensions()

virtual unsigned int itk::FullSearchOptimizer::GetNumberOfSearchSpaceDimensions ( )
virtual

Get the Dimension of the SearchSpace. Calculated from the SearchSpace.

◆ GetSearchSpaceSize()

virtual const SearchSpaceSizeType & itk::FullSearchOptimizer::GetSearchSpaceSize ( )
virtual

Returns an array containing trunc((max-min)/step) for each SearchSpaceDimension)

◆ GetStopCondition()

virtual StopConditionType itk::FullSearchOptimizer::GetStopCondition ( ) const
virtual

Get Stop condition.

◆ GetValue()

virtual double itk::FullSearchOptimizer::GetValue ( ) const
virtual

Get the current value.

◆ IndexToPoint()

virtual SearchSpacePointType itk::FullSearchOptimizer::IndexToPoint ( const SearchSpaceIndexType & index)
virtual

Convert an index to a point

◆ IndexToPosition()

virtual ParametersType itk::FullSearchOptimizer::IndexToPosition ( const SearchSpaceIndexType & index)
virtual

◆ ITK_DISALLOW_COPY_AND_MOVE()

itk::FullSearchOptimizer::ITK_DISALLOW_COPY_AND_MOVE ( FullSearchOptimizer )

◆ itkGetModifiableObjectMacro()

itk::FullSearchOptimizer::itkGetModifiableObjectMacro ( SearchSpace ,
SearchSpaceType  )

◆ MaximizeOff()

virtual void itk::FullSearchOptimizer::MaximizeOff ( )
virtual

◆ MaximizeOn()

virtual void itk::FullSearchOptimizer::MaximizeOn ( )
virtual

◆ MinimizeOff()

void itk::FullSearchOptimizer::MinimizeOff ( )
inline

Definition at line 116 of file itkFullSearchOptimizer.h.

◆ MinimizeOn()

void itk::FullSearchOptimizer::MinimizeOn ( )
inline

Definition at line 111 of file itkFullSearchOptimizer.h.

◆ New()

static Pointer itk::FullSearchOptimizer::New ( )
static

Method for creation through the object factory.

◆ PointToPosition()

virtual ParametersType itk::FullSearchOptimizer::PointToPosition ( const SearchSpacePointType & point)
virtual

Convert an index to a full parameter array. Requires a valid InitialPosition!

◆ ProcessSearchSpaceChanges()

virtual void itk::FullSearchOptimizer::ProcessSearchSpaceChanges ( )
protectedvirtual

◆ RemoveSearchDimension()

virtual void itk::FullSearchOptimizer::RemoveSearchDimension ( unsigned int param_nr)
virtual

◆ ResumeOptimization()

virtual void itk::FullSearchOptimizer::ResumeOptimization ( )
virtual

Resume previously stopped optimization with current parameters

See also
StopOptimization.

◆ SetMaximize()

virtual void itk::FullSearchOptimizer::SetMaximize ( bool _arg)
virtual

◆ SetMinimize()

void itk::FullSearchOptimizer::SetMinimize ( bool v)
inline

Definition at line 106 of file itkFullSearchOptimizer.h.

◆ SetSearchSpace()

virtual void itk::FullSearchOptimizer::SetSearchSpace ( SearchSpaceType * _arg)
virtual

Set/Get the SearchSpace, which is defined by a pointer to an itkMapContainer<unsigned int, FixedArray(double,3)> The unsigned int is the number of a parameter to be investigated. The FixedArray contains its range and the resolution of the search (min, max, step).

Instead of using this function, the Add/RemoveSearchDimension methods can be used, to define a search space.

◆ StartOptimization()

void itk::FullSearchOptimizer::StartOptimization ( )
override

Start optimization. Make sure to set the initial position before starting the optimization

◆ StopOptimization()

virtual void itk::FullSearchOptimizer::StopOptimization ( )
virtual

Stop optimization.

See also
ResumeOptimization

◆ UpdateCurrentPosition()

virtual void itk::FullSearchOptimizer::UpdateCurrentPosition ( )
virtual

Set the CurrentPosition, CurrentPoint and CurrentIndex to the next point in the search space.

example of sequence of indices in a 3d search space:

dim1: 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 dim2: 0 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 dim3: 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2

The indices are transformed to points in search space with the formula: point[i] = min[i] + stepsize[i]*index[i] for all i.

Then the appropriate parameters in the ParameterArray are updated.

Field Documentation

◆ m_BestIndexInSearchSpace

SearchSpaceIndexType itk::FullSearchOptimizer::m_BestIndexInSearchSpace {}
protected

Definition at line 235 of file itkFullSearchOptimizer.h.

◆ m_BestPointInSearchSpace

SearchSpacePointType itk::FullSearchOptimizer::m_BestPointInSearchSpace {}
protected

Definition at line 234 of file itkFullSearchOptimizer.h.

◆ m_BestValue

double itk::FullSearchOptimizer::m_BestValue { 0.0 }
protected

Definition at line 228 of file itkFullSearchOptimizer.h.

◆ m_CurrentIndexInSearchSpace

SearchSpaceIndexType itk::FullSearchOptimizer::m_CurrentIndexInSearchSpace {}
protected

Definition at line 233 of file itkFullSearchOptimizer.h.

◆ m_CurrentIteration

unsigned long itk::FullSearchOptimizer::m_CurrentIteration { 0 }
private

Definition at line 244 of file itkFullSearchOptimizer.h.

◆ m_CurrentPointInSearchSpace

SearchSpacePointType itk::FullSearchOptimizer::m_CurrentPointInSearchSpace {}
protected

Definition at line 232 of file itkFullSearchOptimizer.h.

◆ m_LastSearchSpaceChanges

unsigned long itk::FullSearchOptimizer::m_LastSearchSpaceChanges { 0 }
protected

Definition at line 239 of file itkFullSearchOptimizer.h.

◆ m_Maximize

bool itk::FullSearchOptimizer::m_Maximize { false }
protected

Definition at line 225 of file itkFullSearchOptimizer.h.

◆ m_NumberOfSearchSpaceDimensions

unsigned int itk::FullSearchOptimizer::m_NumberOfSearchSpaceDimensions { 0 }
protected

Definition at line 237 of file itkFullSearchOptimizer.h.

◆ m_SearchSpace

SearchSpacePointer itk::FullSearchOptimizer::m_SearchSpace { nullptr }
protected

Definition at line 231 of file itkFullSearchOptimizer.h.

◆ m_SearchSpaceSize

SearchSpaceSizeType itk::FullSearchOptimizer::m_SearchSpaceSize {}
protected

Definition at line 236 of file itkFullSearchOptimizer.h.

◆ m_Stop

bool itk::FullSearchOptimizer::m_Stop { false }
protected

Definition at line 226 of file itkFullSearchOptimizer.h.

◆ m_StopCondition

StopConditionType itk::FullSearchOptimizer::m_StopCondition { FullRangeSearched }
protected

Definition at line 229 of file itkFullSearchOptimizer.h.

◆ m_Value

double itk::FullSearchOptimizer::m_Value { 0.0 }
protected

Definition at line 227 of file itkFullSearchOptimizer.h.



Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo