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:
Inheritance graph
[legend]

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 SearchSpaceTypeGetSearchSpace ()
 
virtual const SearchSpaceSizeTypeGetSearchSpaceSize (void)
 
virtual StopConditionType GetStopCondition () const
 
virtual double GetValue () const
 
virtual SearchSpacePointType IndexToPoint (const SearchSpaceIndexType &index)
 
virtual ParametersType IndexToPosition (const SearchSpaceIndexType &index)
 
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)
 
virtual void StartOptimization (void)
 
virtual void StopOptimization (void)
 
virtual void UpdateCurrentPosition (void)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

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

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

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

Definition at line 54 of file itkFullSearchOptimizer.h.

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

Definition at line 71 of file itkFullSearchOptimizer.h.

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

Definition at line 70 of file itkFullSearchOptimizer.h.

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

Definition at line 72 of file itkFullSearchOptimizer.h.

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

Definition at line 69 of file itkFullSearchOptimizer.h.

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

Definition at line 74 of file itkFullSearchOptimizer.h.

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

Definition at line 53 of file itkFullSearchOptimizer.h.

Definition at line 76 of file itkFullSearchOptimizer.h.

Definition at line 75 of file itkFullSearchOptimizer.h.

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.

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

Definition at line 79 of file itkFullSearchOptimizer.h.

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

Definition at line 78 of file itkFullSearchOptimizer.h.

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

Definition at line 83 of file itkFullSearchOptimizer.h.

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.

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

Definition at line 77 of file itkFullSearchOptimizer.h.

Standard class typedefs.

Definition at line 51 of file itkFullSearchOptimizer.h.

Definition at line 52 of file itkFullSearchOptimizer.h.

Member Enumeration Documentation

Codes of stopping conditions

Enumerator
FullRangeSearched 
MetricError 

Definition at line 63 of file itkFullSearchOptimizer.h.

Constructor & Destructor Documentation

itk::FullSearchOptimizer::FullSearchOptimizer ( )
protected
virtual itk::FullSearchOptimizer::~FullSearchOptimizer ( )
inlineprotectedvirtual

Definition at line 197 of file itkFullSearchOptimizer.h.

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

Member Function Documentation

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

Add/Remove a dimension to/from the SearchSpace

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

Get the point in SearchSpace that is currently the most optimal

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

Get the best value.

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

Run-time type information (and related methods).

Reimplemented in elastix::FullSearch< TElastix >.

virtual const SearchSpaceIndexType& itk::FullSearchOptimizer::GetCurrentIndexInSearchSpace ( )
virtual
virtual unsigned long itk::FullSearchOptimizer::GetCurrentIteration ( ) const
virtual

Get the current iteration number.

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

Get the point in SearchSpace that is currently evaluated

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

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

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

Definition at line 98 of file itkFullSearchOptimizer.h.

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

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

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

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

virtual SearchSpaceType* itk::FullSearchOptimizer::GetSearchSpace ( )
virtual
virtual const SearchSpaceSizeType& itk::FullSearchOptimizer::GetSearchSpaceSize ( void  )
virtual

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

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

Get Stop condition.

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

Get the current value.

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

Convert an index to a point

virtual ParametersType itk::FullSearchOptimizer::IndexToPosition ( const SearchSpaceIndexType index)
virtual
virtual void itk::FullSearchOptimizer::MaximizeOff ( )
virtual
virtual void itk::FullSearchOptimizer::MaximizeOn ( )
virtual
void itk::FullSearchOptimizer::MinimizeOff ( )
inline

Definition at line 104 of file itkFullSearchOptimizer.h.

void itk::FullSearchOptimizer::MinimizeOn ( )
inline

Definition at line 102 of file itkFullSearchOptimizer.h.

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

Method for creation through the object factory.

void itk::FullSearchOptimizer::operator= ( const Self )
private
virtual ParametersType itk::FullSearchOptimizer::PointToPosition ( const SearchSpacePointType point)
virtual

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

virtual void itk::FullSearchOptimizer::ProcessSearchSpaceChanges ( void  )
protectedvirtual
virtual void itk::FullSearchOptimizer::RemoveSearchDimension ( unsigned int  param_nr)
virtual
virtual void itk::FullSearchOptimizer::ResumeOptimization ( void  )
virtual

Resume previously stopped optimization with current parameters

See also
StopOptimization.
virtual void itk::FullSearchOptimizer::SetMaximize ( bool  _arg)
virtual
void itk::FullSearchOptimizer::SetMinimize ( bool  v)
inline

Definition at line 100 of file itkFullSearchOptimizer.h.

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.

virtual void itk::FullSearchOptimizer::StartOptimization ( void  )
virtual

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

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

Stop optimization.

See also
ResumeOptimization
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

SearchSpaceIndexType itk::FullSearchOptimizer::m_BestIndexInSearchSpace
protected

Definition at line 211 of file itkFullSearchOptimizer.h.

SearchSpacePointType itk::FullSearchOptimizer::m_BestPointInSearchSpace
protected

Definition at line 210 of file itkFullSearchOptimizer.h.

double itk::FullSearchOptimizer::m_BestValue
protected

Definition at line 204 of file itkFullSearchOptimizer.h.

SearchSpaceIndexType itk::FullSearchOptimizer::m_CurrentIndexInSearchSpace
protected

Definition at line 209 of file itkFullSearchOptimizer.h.

unsigned long itk::FullSearchOptimizer::m_CurrentIteration
private

Definition at line 223 of file itkFullSearchOptimizer.h.

SearchSpacePointType itk::FullSearchOptimizer::m_CurrentPointInSearchSpace
protected

Definition at line 208 of file itkFullSearchOptimizer.h.

unsigned long itk::FullSearchOptimizer::m_LastSearchSpaceChanges
protected

Definition at line 215 of file itkFullSearchOptimizer.h.

bool itk::FullSearchOptimizer::m_Maximize
protected

Definition at line 201 of file itkFullSearchOptimizer.h.

unsigned int itk::FullSearchOptimizer::m_NumberOfSearchSpaceDimensions
protected

Definition at line 213 of file itkFullSearchOptimizer.h.

SearchSpacePointer itk::FullSearchOptimizer::m_SearchSpace
protected

Definition at line 207 of file itkFullSearchOptimizer.h.

SearchSpaceSizeType itk::FullSearchOptimizer::m_SearchSpaceSize
protected

Definition at line 212 of file itkFullSearchOptimizer.h.

bool itk::FullSearchOptimizer::m_Stop
protected

Definition at line 202 of file itkFullSearchOptimizer.h.

StopConditionType itk::FullSearchOptimizer::m_StopCondition
protected

Definition at line 205 of file itkFullSearchOptimizer.h.

double itk::FullSearchOptimizer::m_Value
protected

Definition at line 203 of file itkFullSearchOptimizer.h.



Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo