ITK
6.0.0
Insight Toolkit
|
#include <itkExhaustiveOptimizerv4.h>
Optimizer that fully samples a grid on the parametric space.
This optimizer is equivalent to an exhaustive 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 TranslationTransform.
The optimizer throws IterationEvents after every iteration. We use this to plot the metric space in an image as follows:
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].
The number of samples for each dimension of the parameter grid are influenced by both the scales and the number of steps along each dimension:
parameter_samples[d] = stepLength*(2*numberOfSteps[d]+1)*scaling[d]
start_parameter[d] = - stepLength * scaling[d] * numberOfSteps[d] end_parameter[d] = + stepLength * scaling[d] * numberOfSteps[d]
Definition at line 84 of file itkExhaustiveOptimizerv4.h.
Public Member Functions | |
virtual const ParametersType & | GetCurrentIndex () const |
virtual const MeasureType & | GetCurrentValue () const |
ParametersType & | GetInitialPosition () |
virtual const MeasureType & | GetMaximumMetricValue () const |
virtual const ParametersType & | GetMaximumMetricValuePosition () const |
virtual const MeasureType & | GetMinimumMetricValue () const |
virtual const ParametersType & | GetMinimumMetricValuePosition () const |
const char * | GetNameOfClass () const override |
virtual const StepsType & | GetNumberOfSteps () const |
virtual const double & | GetStepLength () const |
std::string | GetStopConditionDescription () const override |
void | ResumeWalking () |
void | SetInitialPosition (const ParametersType ¶m) |
virtual void | SetNumberOfSteps (StepsType _arg) |
virtual void | SetStepLength (double _arg) |
void | StartOptimization (bool doOnlyInitialization=false) override |
void | StartWalking () |
void | StopWalking () |
Public Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > | |
virtual bool | CanUseScales () const |
virtual SizeValueType | GetCurrentIteration () const |
virtual const MeasureType & | GetCurrentMetricValue () const |
virtual const ParametersType & | GetCurrentPosition () const |
const char * | GetNameOfClass () const override |
virtual SizeValueType | GetNumberOfIterations () const |
virtual const ThreadIdType & | GetNumberOfWorkUnits () const |
virtual const ScalesType & | GetScales () const |
virtual const bool & | GetScalesAreIdentity () const |
bool | GetScalesInitialized () const |
virtual StopConditionReturnStringType | GetStopConditionDescription () const=0 |
virtual const MeasureType & | GetValue () const |
virtual const ScalesType & | GetWeights () const |
virtual const bool & | GetWeightsAreIdentity () const |
virtual void | SetNumberOfIterations (SizeValueType _arg) |
virtual void | SetNumberOfWorkUnits (ThreadIdType number) |
virtual void | SetScalesEstimator (ScalesEstimatorType *_arg) |
virtual void | SetWeights (ScalesType _arg) |
virtual void | StartOptimization (bool doOnlyInitialization=false) |
virtual void | SetMetric (MetricType *_arg) |
virtual MetricType * | GetModifiableMetric () |
virtual void | SetScales (const ScalesType &scales) |
virtual void | SetDoEstimateScales (bool _arg) |
virtual const bool & | GetDoEstimateScales () const |
virtual void | DoEstimateScalesOn () |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
LightObject::Pointer | CreateAnother () const override |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
const char * | GetNameOfClass () const override |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) const |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
Pointer | Clone () const |
virtual Pointer | CreateAnother () const |
virtual void | Delete () |
virtual const char * | GetNameOfClass () const |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
virtual void | Register () const |
virtual void | SetReferenceCount (int) |
virtual void | UnRegister () const noexcept |
Static Public Member Functions | |
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 val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
void | AdvanceOneStep () |
ExhaustiveOptimizerv4 () | |
void | IncrementIndex (ParametersType &newPosition) |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~ExhaustiveOptimizerv4 () override=default | |
Protected Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
ObjectToObjectOptimizerBaseTemplate () | |
~ObjectToObjectOptimizerBaseTemplate () override | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
~Object () override | |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintSelf (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Protected Attributes | |
ParametersType | m_CurrentIndex { 0 } |
MeasureType | m_CurrentValue { 0 } |
ParametersType | m_InitialPosition {} |
MeasureType | m_MaximumMetricValue { 0.0 } |
ParametersType | m_MaximumMetricValuePosition {} |
MeasureType | m_MinimumMetricValue { 0.0 } |
ParametersType | m_MinimumMetricValuePosition {} |
StepsType | m_NumberOfSteps { 0 } |
double | m_StepLength { 1.0 } |
bool | m_Stop { false } |
Protected Attributes inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > | |
SizeValueType | m_CurrentIteration |
MeasureType | m_CurrentMetricValue |
bool | m_DoEstimateScales |
MetricTypePointer | m_Metric |
SizeValueType | m_NumberOfIterations |
ThreadIdType | m_NumberOfWorkUnits |
ScalesType | m_Scales |
bool | m_ScalesAreIdentity |
ScalesEstimatorType::Pointer | m_ScalesEstimator |
ScalesType | m_Weights |
bool | m_WeightsAreIdentity |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount {} |
Private Attributes | |
std::ostringstream | m_StopConditionDescription { "" } |
using itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::ConstPointer = SmartPointer<const Self> |
Definition at line 95 of file itkExhaustiveOptimizerv4.h.
using itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::Pointer = SmartPointer<Self> |
Definition at line 94 of file itkExhaustiveOptimizerv4.h.
using itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::Self = ExhaustiveOptimizerv4 |
Standard "Self" type alias.
Definition at line 92 of file itkExhaustiveOptimizerv4.h.
using itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::StepsType = Array<SizeValueType> |
Steps type
Definition at line 104 of file itkExhaustiveOptimizerv4.h.
using itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::Superclass = ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType> |
Definition at line 93 of file itkExhaustiveOptimizerv4.h.
|
protected |
|
overrideprotecteddefault |
|
protected |
Advance to the next grid position.
|
virtual |
|
virtual |
|
inline |
Get the position to initialize the optimization.
Definition at line 151 of file itkExhaustiveOptimizerv4.h.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
overridevirtual |
Reimplemented from itk::Object.
|
virtual |
|
virtual |
|
overridevirtual |
Get the reason for termination
Implements itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >.
|
protected |
|
static |
Method for creation through the object factory.
|
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::Object.
void itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::ResumeWalking | ( | ) |
Resume the optimization
void itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::SetInitialPosition | ( | const ParametersType & | param | ) |
Set the position to initialize the optimization.
|
virtual |
|
virtual |
|
overridevirtual |
Run the optimization.
doOnlyInitialization | This is false by default. It should only be set to true for special cases when the class should be initialized to perform optimization, but no optimization should be run. For example, itkMultiGradientOptimizerv4 needs to do this. |
Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >.
void itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::StartWalking | ( | ) |
Start optimization
void itk::ExhaustiveOptimizerv4< TInternalComputationValueType >::StopWalking | ( | ) |
Stop optimization
|
protected |
Definition at line 175 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 171 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 170 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 176 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 179 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 177 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 178 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 172 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 174 of file itkExhaustiveOptimizerv4.h.
|
protected |
Definition at line 173 of file itkExhaustiveOptimizerv4.h.
|
private |
Definition at line 182 of file itkExhaustiveOptimizerv4.h.