ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | List of all members
itk::SingleValuedNonLinearVnlOptimizerv4 Class Referenceabstract

#include <itkSingleValuedNonLinearVnlOptimizerv4.h>

+ Inheritance diagram for itk::SingleValuedNonLinearVnlOptimizerv4:
+ Collaboration diagram for itk::SingleValuedNonLinearVnlOptimizerv4:

Public Types

using CommandType = ReceptorMemberCommand< Self >
 
using ConstPointer = SmartPointer< const Self >
 
using DerivativeType = Superclass::DerivativeType
 
using MetricType = Superclass::MetricType
 
using ParametersType = Superclass::ParametersType
 
using Pointer = SmartPointer< Self >
 
using ScalesType = Superclass::ScalesType
 
using Self = SingleValuedNonLinearVnlOptimizerv4
 
using StopConditionDescriptionType = Superclass::StopConditionDescriptionType
 
using StopConditionReturnStringType = Superclass::StopConditionReturnStringType
 
using Superclass = ObjectToObjectOptimizerBase
 
- Public Types inherited from itk::ObjectToObjectOptimizerBaseTemplate< double >
using ConstPointer = SmartPointer< const Self >
 
using DerivativeType = typename MetricType::DerivativeType
 
using MeasureType = typename MetricType::MeasureType
 
using MetricType = ObjectToObjectMetricBaseTemplate< double >
 
using MetricTypePointer = typename MetricType::Pointer
 
using NumberOfParametersType = typename MetricType::NumberOfParametersType
 
using ParametersType = OptimizerParameters< double >
 
using Pointer = SmartPointer< Self >
 
using ScalesEstimatorType = OptimizerParameterScalesEstimatorTemplate< double >
 
using ScalesType = OptimizerParameters< double >
 
using Self = ObjectToObjectOptimizerBaseTemplate
 
using StopConditionDescriptionType = std::ostringstream
 
using StopConditionReturnStringType = std::string
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

virtual const char * GetNameOfClass () const
 
void SetMetric (MetricType *metric) override=0
 
void StartOptimization (bool doOnlyInitialization=false) override
 
- Public Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< double >
virtual void SetMetric (MetricType *_arg)
 
virtual MetricTypeGetModifiableMetric ()
 
virtual const MetricTypeGetMetric () const
 
virtual const MeasureTypeGetCurrentMetricValue () const
 
virtual const MeasureTypeGetValue () const
 
virtual void SetScales (const ScalesType &scales)
 
virtual const ScalesTypeGetScales () const
 
virtual const bool & GetScalesAreIdentity () const
 
virtual void SetWeights (ScalesType _arg)
 
virtual const ScalesTypeGetWeights () const
 
virtual const bool & GetWeightsAreIdentity () const
 
bool GetScalesInitialized () const
 
virtual void SetScalesEstimator (ScalesEstimatorType *_arg)
 
virtual void SetDoEstimateScales (bool _arg)
 
virtual const bool & GetDoEstimateScales () const
 
virtual void DoEstimateScalesOn ()
 
virtual void DoEstimateScalesOff ()
 
virtual void SetNumberOfWorkUnits (ThreadIdType number)
 
virtual const ThreadIdTypeGetNumberOfWorkUnits () const
 
virtual SizeValueType GetCurrentIteration () const
 
virtual void SetNumberOfIterations (SizeValueType _arg)
 
virtual SizeValueType GetNumberOfIterations () const
 
virtual const ParametersTypeGetCurrentPosition () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) 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
 
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
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
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
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 
using CostFunctionAdaptorType = SingleValuedVnlCostFunctionAdaptorv4
 
CostFunctionAdaptorTypem_CostFunctionAdaptor
 
CommandType::Pointer m_Command
 
ParametersType m_CachedCurrentPosition
 
DerivativeType m_CachedDerivative
 
virtual const DerivativeTypeGetCachedDerivative () const
 
virtual const ParametersTypeGetCachedCurrentPosition () const
 
const StopConditionReturnStringType GetStopConditionDescription () const override=0
 
 SingleValuedNonLinearVnlOptimizerv4 ()
 
 ~SingleValuedNonLinearVnlOptimizerv4 () override
 
void SetCostFunctionAdaptor (CostFunctionAdaptorType *adaptor)
 
const CostFunctionAdaptorTypeGetCostFunctionAdaptor () const
 
CostFunctionAdaptorTypeGetCostFunctionAdaptor ()
 
CostFunctionAdaptorTypeGetNonConstCostFunctionAdaptor () const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void IterationReport (const EventObject &event)
 

Additional Inherited Members

- 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 inherited from itk::ObjectToObjectOptimizerBaseTemplate< double >
 ObjectToObjectOptimizerBaseTemplate ()
 
 ~ObjectToObjectOptimizerBaseTemplate () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
- 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 inherited from itk::ObjectToObjectOptimizerBaseTemplate< double >
MetricTypePointer m_Metric
 
ThreadIdType m_NumberOfWorkUnits
 
SizeValueType m_CurrentIteration
 
SizeValueType m_NumberOfIterations
 
MeasureType m_CurrentMetricValue
 
ScalesType m_Scales
 
ScalesType m_Weights
 
bool m_ScalesAreIdentity
 
ScalesEstimatorType::Pointer m_ScalesEstimator
 
bool m_WeightsAreIdentity
 
bool m_DoEstimateScales
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

This is a base for the ITKv4 Optimization methods using the vnl library.

It is an Adaptor class for optimizers provided by the vnl library.

Definition at line 38 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

Member Typedef Documentation

◆ CommandType

Command observer that will interact with the ITKVNL cost-function adaptor in order to generate iteration events. This will allow to overcome the limitation of VNL optimizers not offering callbacks for every iteration

Definition at line 56 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ ConstPointer

Definition at line 47 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ CostFunctionAdaptorType

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

Definition at line 98 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ DerivativeType

Definition at line 59 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ MetricType

Definition at line 58 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ ParametersType

Definition at line 60 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ Pointer

Definition at line 46 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ ScalesType

Definition at line 61 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ Self

Standard class type aliases.

Definition at line 44 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ StopConditionDescriptionType

using itk::SingleValuedNonLinearVnlOptimizerv4::StopConditionDescriptionType = Superclass::StopConditionDescriptionType

Stop condition internal string type

Definition at line 67 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ StopConditionReturnStringType

using itk::SingleValuedNonLinearVnlOptimizerv4::StopConditionReturnStringType = Superclass::StopConditionReturnStringType

Stop condition return string type

Definition at line 64 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ Superclass

Definition at line 45 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

Constructor & Destructor Documentation

◆ SingleValuedNonLinearVnlOptimizerv4()

itk::SingleValuedNonLinearVnlOptimizerv4::SingleValuedNonLinearVnlOptimizerv4 ( )
protected

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

◆ ~SingleValuedNonLinearVnlOptimizerv4()

itk::SingleValuedNonLinearVnlOptimizerv4::~SingleValuedNonLinearVnlOptimizerv4 ( )
overrideprotected

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

Member Function Documentation

◆ GetCachedCurrentPosition()

virtual const ParametersType& itk::SingleValuedNonLinearVnlOptimizerv4::GetCachedCurrentPosition ( ) const
virtual

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

◆ GetCachedDerivative()

virtual const DerivativeType& itk::SingleValuedNonLinearVnlOptimizerv4::GetCachedDerivative ( ) const
virtual

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

◆ GetCostFunctionAdaptor() [1/2]

CostFunctionAdaptorType* itk::SingleValuedNonLinearVnlOptimizerv4::GetCostFunctionAdaptor ( )
protected

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

◆ GetCostFunctionAdaptor() [2/2]

const CostFunctionAdaptorType* itk::SingleValuedNonLinearVnlOptimizerv4::GetCostFunctionAdaptor ( ) const
protected

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

◆ GetNameOfClass()

virtual const char* itk::SingleValuedNonLinearVnlOptimizerv4::GetNameOfClass ( ) const
virtual

◆ GetNonConstCostFunctionAdaptor()

CostFunctionAdaptorType* itk::SingleValuedNonLinearVnlOptimizerv4::GetNonConstCostFunctionAdaptor ( ) const
protected

The purpose of this method is to get around the lack of const-correctness in VNL cost-functions and optimizers

◆ GetStopConditionDescription()

const StopConditionReturnStringType itk::SingleValuedNonLinearVnlOptimizerv4::GetStopConditionDescription ( ) const
overridepure virtual

◆ IterationReport()

void itk::SingleValuedNonLinearVnlOptimizerv4::IterationReport ( const EventObject event)
private

The purpose of this method is to get around the lack of iteration reporting in VNL optimizers. By interfacing directly with the ITK cost function adaptor we are generating here Iteration Events. Note the iteration events here are produce PER EVALUATION of the metric, not per real iteration of the vnl optimizer. Optimizers that evaluate the metric multiple times at each iteration will generate a lot more of Iteration events here.

◆ PrintSelf()

void itk::SingleValuedNonLinearVnlOptimizerv4::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Print out internal state

Reimplemented from itk::Object.

Reimplemented in itk::LBFGSOptimizerBasev4< vnl_lbfgs >, and itk::LBFGSOptimizerBasev4< vnl_lbfgsb >.

◆ SetCostFunctionAdaptor()

void itk::SingleValuedNonLinearVnlOptimizerv4::SetCostFunctionAdaptor ( CostFunctionAdaptorType adaptor)
protected

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

◆ SetMetric()

void itk::SingleValuedNonLinearVnlOptimizerv4::SetMetric ( MetricType metric)
overridepure virtual

Set the metric (cost function). This method has to be overloaded by derived classes because the CostFunctionAdaptor requires to know the number of parameters at construction time. This number of parameters is obtained at run-time from the itkObjectToObjectMetric. As a consequence each derived optimizer should construct its own CostFunctionAdaptor when overloading this method

Implemented in itk::LBFGSBOptimizerv4, itk::LBFGSOptimizerv4, itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >, itk::LBFGSOptimizerBasev4< vnl_lbfgs >, itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, and itk::AmoebaOptimizerv4.

◆ StartOptimization()

void itk::SingleValuedNonLinearVnlOptimizerv4::StartOptimization ( bool  doOnlyInitialization = false)
overridevirtual

Run the optimization.

Parameters
doOnlyInitializationThis 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.
Note
Derived classes must override and call this superclass method, then perform any additional initialization before performing optimization.

Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< double >.

Reimplemented in itk::LBFGSOptimizerBasev4< vnl_lbfgs >, and itk::LBFGSOptimizerBasev4< vnl_lbfgsb >.

Member Data Documentation

◆ m_CachedCurrentPosition

ParametersType itk::SingleValuedNonLinearVnlOptimizerv4::m_CachedCurrentPosition
mutableprivate

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

Definition at line 132 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ m_CachedDerivative

DerivativeType itk::SingleValuedNonLinearVnlOptimizerv4::m_CachedDerivative
mutableprivate

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

Definition at line 133 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ m_Command

CommandType::Pointer itk::SingleValuedNonLinearVnlOptimizerv4::m_Command
private

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

Definition at line 130 of file itkSingleValuedNonLinearVnlOptimizerv4.h.

◆ m_CostFunctionAdaptor

CostFunctionAdaptorType* itk::SingleValuedNonLinearVnlOptimizerv4::m_CostFunctionAdaptor
private

Return Cached Values. These method have the advantage of not triggering a recomputation of the metric value, but it has the disadvantage of returning a value that may not be the one corresponding to the current parameters. For GUI update purposes, this method is a good option.

Note
The metric value is cached in the base class, retrieved via GetValue().

Definition at line 128 of file itkSingleValuedNonLinearVnlOptimizerv4.h.


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