ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkExhaustiveOptimizer.h>
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[1] = 10; steps[2] = 10; steps[3] = 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 82 of file itkExhaustiveOptimizer.h.
typedef SmartPointer< const Self > itk::ExhaustiveOptimizer::ConstPointer |
Reimplemented from itk::SingleValuedNonLinearOptimizer.
Definition at line 90 of file itkExhaustiveOptimizer.h.
typedef SmartPointer< Self > itk::ExhaustiveOptimizer::Pointer |
Reimplemented from itk::SingleValuedNonLinearOptimizer.
Definition at line 89 of file itkExhaustiveOptimizer.h.
Standard "Self" typedef.
Reimplemented from itk::SingleValuedNonLinearOptimizer.
Definition at line 87 of file itkExhaustiveOptimizer.h.
Definition at line 92 of file itkExhaustiveOptimizer.h.
Reimplemented from itk::SingleValuedNonLinearOptimizer.
Definition at line 88 of file itkExhaustiveOptimizer.h.
itk::ExhaustiveOptimizer::ExhaustiveOptimizer | ( | ) | [protected] |
virtual itk::ExhaustiveOptimizer::~ExhaustiveOptimizer | ( | ) | [inline, protected, virtual] |
Definition at line 124 of file itkExhaustiveOptimizer.h.
itk::ExhaustiveOptimizer::ExhaustiveOptimizer | ( | const Self & | ) | [private] |
void itk::ExhaustiveOptimizer::AdvanceOneStep | ( | void | ) | [protected] |
Advance to the next grid position.
virtual::itk::LightObject::Pointer itk::ExhaustiveOptimizer::CreateAnother | ( | void | ) | 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::SingleValuedNonLinearOptimizer.
virtual const ParametersType& itk::ExhaustiveOptimizer::GetCurrentIndex | ( | ) | [virtual] |
virtual const MeasureType& itk::ExhaustiveOptimizer::GetCurrentValue | ( | ) | [virtual] |
virtual const MeasureType& itk::ExhaustiveOptimizer::GetMaximumMetricValue | ( | ) | [virtual] |
virtual const ParametersType& itk::ExhaustiveOptimizer::GetMaximumMetricValuePosition | ( | ) | [virtual] |
virtual const SizeValueType& itk::ExhaustiveOptimizer::GetMaximumNumberOfIterations | ( | ) | [virtual] |
virtual const MeasureType& itk::ExhaustiveOptimizer::GetMinimumMetricValue | ( | ) | [virtual] |
virtual const ParametersType& itk::ExhaustiveOptimizer::GetMinimumMetricValuePosition | ( | ) | [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 | ( | ) | [virtual] |
virtual const double& itk::ExhaustiveOptimizer::GetStepLength | ( | ) | [virtual] |
const std::string itk::ExhaustiveOptimizer::GetStopConditionDescription | ( | ) | const [virtual] |
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.
Reimplemented from itk::SingleValuedNonLinearOptimizer.
void itk::ExhaustiveOptimizer::operator= | ( | const Self & | ) | [private] |
Types inherited from the superclass
Reimplemented from itk::SingleValuedNonLinearOptimizer.
void itk::ExhaustiveOptimizer::PrintSelf | ( | std::ostream & | os, |
Indent | indent | ||
) | const [protected, virtual] |
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 | ( | void | ) |
virtual void itk::ExhaustiveOptimizer::SetNumberOfSteps | ( | StepsType | _arg | ) | [virtual] |
virtual void itk::ExhaustiveOptimizer::SetStepLength | ( | double | _arg | ) | [virtual] |
virtual void itk::ExhaustiveOptimizer::StartOptimization | ( | void | ) | [virtual] |
Start optimization.
Reimplemented from itk::Optimizer.
void itk::ExhaustiveOptimizer::StartWalking | ( | void | ) |
void itk::ExhaustiveOptimizer::StopWalking | ( | void | ) |
Definition at line 145 of file itkExhaustiveOptimizer.h.
Definition at line 137 of file itkExhaustiveOptimizer.h.
unsigned int itk::ExhaustiveOptimizer::m_CurrentParameter [protected] |
Definition at line 141 of file itkExhaustiveOptimizer.h.
MeasureType itk::ExhaustiveOptimizer::m_CurrentValue [protected] |
Definition at line 133 of file itkExhaustiveOptimizer.h.
Definition at line 149 of file itkExhaustiveOptimizer.h.
Definition at line 155 of file itkExhaustiveOptimizer.h.
Definition at line 147 of file itkExhaustiveOptimizer.h.
Definition at line 151 of file itkExhaustiveOptimizer.h.
Definition at line 153 of file itkExhaustiveOptimizer.h.
StepsType itk::ExhaustiveOptimizer::m_NumberOfSteps [protected] |
Definition at line 135 of file itkExhaustiveOptimizer.h.
double itk::ExhaustiveOptimizer::m_StepLength [protected] |
Definition at line 143 of file itkExhaustiveOptimizer.h.
bool itk::ExhaustiveOptimizer::m_Stop [protected] |
Definition at line 139 of file itkExhaustiveOptimizer.h.
std::ostringstream itk::ExhaustiveOptimizer::m_StopConditionDescription [private] |
Definition at line 161 of file itkExhaustiveOptimizer.h.