ITK  4.9.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
itk::ExhaustiveOptimizer Class Reference

#include <itkExhaustiveOptimizer.h>

+ Inheritance diagram for itk::ExhaustiveOptimizer:
+ Collaboration diagram for itk::ExhaustiveOptimizer:

Detailed Description

Optimizer that fully samples a grid on the parametric space.

This optimizer is equivalent to an exahaustive search in a discrete grid defined over the parametric space. The grid is centered on the initial position. The subdivisions of the grid along each one of the dimensions of the parametric space is defined by an array of number of steps.

A typical use is to plot the metric space to get an idea of how noisy it is. An example is given below, where it is desired to plot the metric space with respect to translations along x, y and z in a 3D registration application: Here it is assumed that the transform is Euler3DTransform.

* OptimizerType::StepsType steps( m_Transform->GetNumberOfParameters() );
* steps[0] = 10;
* steps[1] = 10;
* steps[2] = 10;
* m_Optimizer->SetNumberOfSteps( steps );
* m_Optimizer->SetStepLength( 2 );
*

The optimizer throws IterationEvents after every iteration. We use this to plot the metric space in an image as follows:

* if( itk::IterationEvent().CheckEvent(& event ) )
* {
* IndexType index;
* index[0] = m_Optimizer->GetCurrentIndex()[0];
* index[1] = m_Optimizer->GetCurrentIndex()[1];
* index[2] = m_Optimizer->GetCurrentIndex()[2];
* image->SetPixel( index, m_Optimizer->GetCurrentValue() );
* }
*

The image size is expected to be 11 x 11 x 11.

If you wish to use different step lengths along each parametric axis, you can use the SetScales() method. This accepts an array, each element represents the number of subdivisions per step length. For instance scales of [0.5 1 4] along with a step length of 2 will cause the optimizer to search the metric space on a grid with x,y,z spacing of [1 2 8].

Physical dimensions of the grid are influenced by both the scales and the number of steps along each dimension, a side of the region is stepLength*(2*numberOfSteps[d]+1)*scaling[d].

Definition at line 79 of file itkExhaustiveOptimizer.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef ExhaustiveOptimizer Self
 
typedef Array< SizeValueTypeStepsType
 
typedef
SingleValuedNonLinearOptimizer 
Superclass
 
- Public Types inherited from itk::SingleValuedNonLinearOptimizer
typedef SmartPointer< const SelfConstPointer
 
typedef CostFunctionType::Pointer CostFunctionPointer
 
typedef SingleValuedCostFunction CostFunctionType
 
typedef
CostFunctionType::DerivativeType 
DerivativeType
 
typedef
CostFunctionType::MeasureType 
MeasureType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef
SingleValuedNonLinearOptimizer 
Self
 
typedef NonLinearOptimizer Superclass
 
- Public Types inherited from itk::NonLinearOptimizer
typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Superclass::ScalesType ScalesType
 
typedef NonLinearOptimizer Self
 
typedef Optimizer Superclass
 
- Public Types inherited from itk::Optimizer
typedef SmartPointer< const SelfConstPointer
 
typedef OptimizerParameters
< double > 
ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Array< double > ScalesType
 
typedef Optimizer Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const ParametersTypeGetCurrentIndex () const
 
virtual const MeasureTypeGetCurrentValue () const
 
virtual const MeasureTypeGetMaximumMetricValue () const
 
virtual const ParametersTypeGetMaximumMetricValuePosition () const
 
virtual const SizeValueTypeGetMaximumNumberOfIterations () const
 
virtual const MeasureTypeGetMinimumMetricValue () const
 
virtual const ParametersTypeGetMinimumMetricValuePosition () const
 
virtual const char * GetNameOfClass () const
 
virtual const StepsTypeGetNumberOfSteps () const
 
virtual const double & GetStepLength () const
 
virtual const std::string GetStopConditionDescription () const override
 
void ResumeWalking ()
 
virtual void SetNumberOfSteps (StepsType _arg)
 
virtual void SetStepLength (double _arg)
 
virtual void StartOptimization (void) override
 
void StartWalking ()
 
void StopWalking ()
 
- Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer
virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const CostFunctionTypeGetCostFunction () const
 
virtual CostFunctionTypeGetModifiableCostFunction ()
 
MeasureType GetValue (const ParametersType &parameters) const
 
virtual void SetCostFunction (CostFunctionType *costFunction)
 
- Public Member Functions inherited from itk::Optimizer
virtual const ParametersTypeGetCurrentPosition () const
 
virtual const ParametersTypeGetInitialPosition () const
 
virtual void SetInitialPosition (const ParametersType &param)
 
void SetScales (const ScalesType &scales)
 
virtual const ScalesTypeGetScales () const
 
virtual const ScalesTypeGetInverseScales () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::NonLinearOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::Optimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

void AdvanceOneStep ()
 
 ExhaustiveOptimizer ()
 
void IncrementIndex (ParametersType &param)
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual ~ExhaustiveOptimizer ()
 
- Protected Member Functions inherited from itk::SingleValuedNonLinearOptimizer
 SingleValuedNonLinearOptimizer ()
 
virtual ~SingleValuedNonLinearOptimizer ()
 
- Protected Member Functions inherited from itk::NonLinearOptimizer
 NonLinearOptimizer ()
 
virtual ~NonLinearOptimizer ()
 
- Protected Member Functions inherited from itk::Optimizer
 Optimizer ()
 
virtual void SetCurrentPosition (const ParametersType &param)
 
virtual ~Optimizer ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Protected Attributes

ParametersType m_CurrentIndex
 
SizeValueType m_CurrentIteration
 
unsigned int m_CurrentParameter
 
MeasureType m_CurrentValue
 
MeasureType m_MaximumMetricValue
 
ParametersType m_MaximumMetricValuePosition
 
SizeValueType m_MaximumNumberOfIterations
 
MeasureType m_MinimumMetricValue
 
ParametersType m_MinimumMetricValuePosition
 
StepsType m_NumberOfSteps
 
double m_StepLength
 
bool m_Stop
 
- Protected Attributes inherited from itk::SingleValuedNonLinearOptimizer
CostFunctionPointer m_CostFunction
 
- Protected Attributes inherited from itk::Optimizer
ParametersType m_CurrentPosition
 
bool m_ScalesInitialized
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Private Member Functions

 ExhaustiveOptimizer (const Self &) ITK_DELETE_FUNCTION
 
void operator= (const Self &) ITK_DELETE_FUNCTION
 

Private Attributes

std::ostringstream m_StopConditionDescription
 

Member Typedef Documentation

Definition at line 87 of file itkExhaustiveOptimizer.h.

Definition at line 86 of file itkExhaustiveOptimizer.h.

Standard "Self" typedef.

Definition at line 84 of file itkExhaustiveOptimizer.h.

Definition at line 89 of file itkExhaustiveOptimizer.h.

Definition at line 85 of file itkExhaustiveOptimizer.h.

Constructor & Destructor Documentation

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

Definition at line 121 of file itkExhaustiveOptimizer.h.

itk::ExhaustiveOptimizer::ExhaustiveOptimizer ( const Self )
private

Member Function Documentation

void itk::ExhaustiveOptimizer::AdvanceOneStep ( )
protected

Advance to the next grid position.

virtual::itk::LightObject::Pointer itk::ExhaustiveOptimizer::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

virtual const ParametersType& itk::ExhaustiveOptimizer::GetCurrentIndex ( ) const
virtual
virtual const MeasureType& itk::ExhaustiveOptimizer::GetCurrentValue ( ) const
virtual
virtual const MeasureType& itk::ExhaustiveOptimizer::GetMaximumMetricValue ( ) const
virtual
virtual const ParametersType& itk::ExhaustiveOptimizer::GetMaximumMetricValuePosition ( ) const
virtual
virtual const SizeValueType& itk::ExhaustiveOptimizer::GetMaximumNumberOfIterations ( ) const
virtual
virtual const MeasureType& itk::ExhaustiveOptimizer::GetMinimumMetricValue ( ) const
virtual
virtual const ParametersType& itk::ExhaustiveOptimizer::GetMinimumMetricValuePosition ( ) const
virtual
virtual const char* itk::ExhaustiveOptimizer::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::SingleValuedNonLinearOptimizer.

virtual const StepsType& itk::ExhaustiveOptimizer::GetNumberOfSteps ( ) const
virtual
virtual const double& itk::ExhaustiveOptimizer::GetStepLength ( ) const
virtual
virtual const std::string itk::ExhaustiveOptimizer::GetStopConditionDescription ( ) const
overridevirtual

Get the reason for termination

Reimplemented from itk::Optimizer.

void itk::ExhaustiveOptimizer::IncrementIndex ( ParametersType param)
protected
static Pointer itk::ExhaustiveOptimizer::New ( )
static

Method for creation through the object factory.

void itk::ExhaustiveOptimizer::operator= ( const Self )
private
virtual void itk::ExhaustiveOptimizer::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::SingleValuedNonLinearOptimizer.

void itk::ExhaustiveOptimizer::ResumeWalking ( )
virtual void itk::ExhaustiveOptimizer::SetNumberOfSteps ( StepsType  _arg)
virtual
virtual void itk::ExhaustiveOptimizer::SetStepLength ( double  _arg)
virtual
virtual void itk::ExhaustiveOptimizer::StartOptimization ( void  )
overridevirtual

Start optimization.

Reimplemented from itk::Optimizer.

void itk::ExhaustiveOptimizer::StartWalking ( )
void itk::ExhaustiveOptimizer::StopWalking ( )

Member Data Documentation

ParametersType itk::ExhaustiveOptimizer::m_CurrentIndex
protected

Definition at line 142 of file itkExhaustiveOptimizer.h.

SizeValueType itk::ExhaustiveOptimizer::m_CurrentIteration
protected

Definition at line 134 of file itkExhaustiveOptimizer.h.

unsigned int itk::ExhaustiveOptimizer::m_CurrentParameter
protected

Definition at line 138 of file itkExhaustiveOptimizer.h.

MeasureType itk::ExhaustiveOptimizer::m_CurrentValue
protected

Definition at line 130 of file itkExhaustiveOptimizer.h.

MeasureType itk::ExhaustiveOptimizer::m_MaximumMetricValue
protected

Definition at line 146 of file itkExhaustiveOptimizer.h.

ParametersType itk::ExhaustiveOptimizer::m_MaximumMetricValuePosition
protected

Definition at line 152 of file itkExhaustiveOptimizer.h.

SizeValueType itk::ExhaustiveOptimizer::m_MaximumNumberOfIterations
protected

Definition at line 144 of file itkExhaustiveOptimizer.h.

MeasureType itk::ExhaustiveOptimizer::m_MinimumMetricValue
protected

Definition at line 148 of file itkExhaustiveOptimizer.h.

ParametersType itk::ExhaustiveOptimizer::m_MinimumMetricValuePosition
protected

Definition at line 150 of file itkExhaustiveOptimizer.h.

StepsType itk::ExhaustiveOptimizer::m_NumberOfSteps
protected

Definition at line 132 of file itkExhaustiveOptimizer.h.

double itk::ExhaustiveOptimizer::m_StepLength
protected

Definition at line 140 of file itkExhaustiveOptimizer.h.

bool itk::ExhaustiveOptimizer::m_Stop
protected

Definition at line 136 of file itkExhaustiveOptimizer.h.

std::ostringstream itk::ExhaustiveOptimizer::m_StopConditionDescription
private

Definition at line 158 of file itkExhaustiveOptimizer.h.


The documentation for this class was generated from the following file: