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 | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
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

typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::CostFunctionPointer CostFunctionPointer
 
typedef Superclass::CostFunctionType CostFunctionType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::ParametersType ParametersType
 
typedef ParametersType::ValueType ParameterValueType
 
typedef SmartPointer< SelfPointer
 
typedef FixedArray< RangeValueType, 3 > RangeType
 
typedef ParameterValueType RangeValueType
 
typedef Array< IndexValueType > SearchSpaceIndexType
 
typedef SearchSpaceType::ConstIterator SearchSpaceIteratorType
 
typedef SearchSpaceType::Pointer SearchSpacePointer
 
typedef Array< ParameterValueTypeSearchSpacePointType
 
typedef Array< SizeValueType > SearchSpaceSizeType
 
typedef MapContainer< unsigned int, RangeTypeSearchSpaceType
 
typedef FullSearchOptimizer Self
 
enum  StopConditionType { FullRangeSearched , MetricError }
 
typedef SingleValuedNonLinearOptimizer Superclass
 

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 (void)
 
virtual unsigned int GetNumberOfSearchSpaceDimensions (void)
 
virtual const SearchSpaceSizeTypeGetSearchSpaceSize (void)
 
virtual StopConditionType GetStopCondition () const
 
virtual double GetValue () const
 
virtual SearchSpacePointType IndexToPoint (const SearchSpaceIndexType &index)
 
virtual ParametersType IndexToPosition (const SearchSpaceIndexType &index)
 
 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 (void)
 
virtual void SetMaximize (bool _arg)
 
void SetMinimize (bool v)
 
virtual void SetSearchSpace (SearchSpaceType *_arg)
 
void StartOptimization (void) override
 
virtual void StopOptimization (void)
 
virtual void UpdateCurrentPosition (void)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

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

Protected Attributes

SearchSpaceIndexType m_BestIndexInSearchSpace
 
SearchSpacePointType m_BestPointInSearchSpace
 
double m_BestValue
 
SearchSpaceIndexType m_CurrentIndexInSearchSpace
 
SearchSpacePointType m_CurrentPointInSearchSpace
 
unsigned long m_LastSearchSpaceChanges
 
bool m_Maximize
 
unsigned int m_NumberOfSearchSpaceDimensions
 
SearchSpacePointer m_SearchSpace
 
SearchSpaceSizeType m_SearchSpaceSize
 
bool m_Stop
 
StopConditionType m_StopCondition
 
double m_Value
 

Private Member Functions

 FullSearchOptimizer (const Self &)
 
void operator= (const Self &)
 

Private Attributes

unsigned long m_CurrentIteration
 

Member Typedef Documentation

◆ ConstPointer

typedef SmartPointer< const Self > itk::FullSearchOptimizer::ConstPointer

Definition at line 54 of file itkFullSearchOptimizer.h.

◆ CostFunctionPointer

typedef Superclass::CostFunctionPointer itk::FullSearchOptimizer::CostFunctionPointer

Definition at line 71 of file itkFullSearchOptimizer.h.

◆ CostFunctionType

typedef Superclass::CostFunctionType itk::FullSearchOptimizer::CostFunctionType

Definition at line 70 of file itkFullSearchOptimizer.h.

◆ MeasureType

typedef Superclass::MeasureType itk::FullSearchOptimizer::MeasureType

Definition at line 72 of file itkFullSearchOptimizer.h.

◆ ParametersType

typedef Superclass::ParametersType itk::FullSearchOptimizer::ParametersType

Definition at line 69 of file itkFullSearchOptimizer.h.

◆ ParameterValueType

typedef ParametersType::ValueType itk::FullSearchOptimizer::ParameterValueType

Definition at line 74 of file itkFullSearchOptimizer.h.

◆ Pointer

typedef SmartPointer< Self > itk::FullSearchOptimizer::Pointer

Definition at line 53 of file itkFullSearchOptimizer.h.

◆ RangeType

Definition at line 76 of file itkFullSearchOptimizer.h.

◆ RangeValueType

Definition at line 75 of file itkFullSearchOptimizer.h.

◆ SearchSpaceIndexType

typedef Array< IndexValueType > itk::FullSearchOptimizer::SearchSpaceIndexType

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

Definition at line 87 of file itkFullSearchOptimizer.h.

◆ SearchSpaceIteratorType

typedef SearchSpaceType::ConstIterator itk::FullSearchOptimizer::SearchSpaceIteratorType

Definition at line 79 of file itkFullSearchOptimizer.h.

◆ SearchSpacePointer

typedef SearchSpaceType::Pointer itk::FullSearchOptimizer::SearchSpacePointer

Definition at line 78 of file itkFullSearchOptimizer.h.

◆ SearchSpacePointType

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

Definition at line 83 of file itkFullSearchOptimizer.h.

◆ SearchSpaceSizeType

typedef Array< SizeValueType > itk::FullSearchOptimizer::SearchSpaceSizeType

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

Definition at line 90 of file itkFullSearchOptimizer.h.

◆ SearchSpaceType

typedef MapContainer< unsigned int, RangeType > itk::FullSearchOptimizer::SearchSpaceType

Definition at line 77 of file itkFullSearchOptimizer.h.

◆ Self

Standard class typedefs.

Definition at line 51 of file itkFullSearchOptimizer.h.

◆ Superclass

Definition at line 52 of file itkFullSearchOptimizer.h.

Member Enumeration Documentation

◆ StopConditionType

Codes of stopping conditions

Enumerator
FullRangeSearched 
MetricError 

Definition at line 63 of file itkFullSearchOptimizer.h.

Constructor & Destructor Documentation

◆ FullSearchOptimizer() [1/2]

itk::FullSearchOptimizer::FullSearchOptimizer ( )
protected

◆ ~FullSearchOptimizer()

itk::FullSearchOptimizer::~FullSearchOptimizer ( )
inlineoverrideprotected

Definition at line 197 of file itkFullSearchOptimizer.h.

◆ FullSearchOptimizer() [2/2]

itk::FullSearchOptimizer::FullSearchOptimizer ( const Self )
private

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 98 of file itkFullSearchOptimizer.h.

◆ GetNumberOfIterations()

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

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

◆ GetNumberOfSearchSpaceDimensions()

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

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

◆ GetSearchSpaceSize()

virtual const SearchSpaceSizeType & itk::FullSearchOptimizer::GetSearchSpaceSize ( void  )
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

◆ 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 104 of file itkFullSearchOptimizer.h.

◆ MinimizeOn()

void itk::FullSearchOptimizer::MinimizeOn ( )
inline

Definition at line 102 of file itkFullSearchOptimizer.h.

◆ New()

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

Method for creation through the object factory.

◆ operator=()

void itk::FullSearchOptimizer::operator= ( const Self )
private

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

◆ RemoveSearchDimension()

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

◆ ResumeOptimization()

virtual void itk::FullSearchOptimizer::ResumeOptimization ( void  )
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 100 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 ( void  )
override

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

◆ StopOptimization()

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

Stop optimization.

See also
ResumeOptimization

◆ UpdateCurrentPosition()

virtual void itk::FullSearchOptimizer::UpdateCurrentPosition ( void  )
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 211 of file itkFullSearchOptimizer.h.

◆ m_BestPointInSearchSpace

SearchSpacePointType itk::FullSearchOptimizer::m_BestPointInSearchSpace
protected

Definition at line 210 of file itkFullSearchOptimizer.h.

◆ m_BestValue

double itk::FullSearchOptimizer::m_BestValue
protected

Definition at line 204 of file itkFullSearchOptimizer.h.

◆ m_CurrentIndexInSearchSpace

SearchSpaceIndexType itk::FullSearchOptimizer::m_CurrentIndexInSearchSpace
protected

Definition at line 209 of file itkFullSearchOptimizer.h.

◆ m_CurrentIteration

unsigned long itk::FullSearchOptimizer::m_CurrentIteration
private

Definition at line 223 of file itkFullSearchOptimizer.h.

◆ m_CurrentPointInSearchSpace

SearchSpacePointType itk::FullSearchOptimizer::m_CurrentPointInSearchSpace
protected

Definition at line 208 of file itkFullSearchOptimizer.h.

◆ m_LastSearchSpaceChanges

unsigned long itk::FullSearchOptimizer::m_LastSearchSpaceChanges
protected

Definition at line 215 of file itkFullSearchOptimizer.h.

◆ m_Maximize

bool itk::FullSearchOptimizer::m_Maximize
protected

Definition at line 201 of file itkFullSearchOptimizer.h.

◆ m_NumberOfSearchSpaceDimensions

unsigned int itk::FullSearchOptimizer::m_NumberOfSearchSpaceDimensions
protected

Definition at line 213 of file itkFullSearchOptimizer.h.

◆ m_SearchSpace

SearchSpacePointer itk::FullSearchOptimizer::m_SearchSpace
protected

Definition at line 207 of file itkFullSearchOptimizer.h.

◆ m_SearchSpaceSize

SearchSpaceSizeType itk::FullSearchOptimizer::m_SearchSpaceSize
protected

Definition at line 212 of file itkFullSearchOptimizer.h.

◆ m_Stop

bool itk::FullSearchOptimizer::m_Stop
protected

Definition at line 202 of file itkFullSearchOptimizer.h.

◆ m_StopCondition

StopConditionType itk::FullSearchOptimizer::m_StopCondition
protected

Definition at line 205 of file itkFullSearchOptimizer.h.

◆ m_Value

double itk::FullSearchOptimizer::m_Value
protected

Definition at line 203 of file itkFullSearchOptimizer.h.



Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo