ITK  4.8.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType > Class Template Reference

#include <itkLBFGSOptimizerBasev4.h>

+ Inheritance diagram for itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >:
+ Collaboration diagram for itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >:

Detailed Description

template<typename TInternalVnlOptimizerType>
class itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >

Abstract base for vnl lbfgs algorithm optimizers in ITKv4 registration framework.

Note
The StopConditionDescription returned by this class is directly from the vnl optimizer by calling m_VnlOptimizer->get_failure_code() . This seems to return "Failure" even when no error has occured. The same behavior is observed in the ITKv3 version of this optimizer.
Local-support (high-density) transforms. Local-support transforms are not supported. To add support for these, the class must be modified thusly:
1) Parameter updates: In SingleValuedNonLinearCostFunctionAdaptor, the handling of the gradient must be changed to accomodate the fact that local-support transforms expect a gradient to be added to the transform parameters using the UpdateTransformParameters method of the local support transform. Other optimizers in the v4 framework use this method, but the use of the vnl optimizers here complicates it.
2) Efficiency To work efficiently with local-support transforms, this class should be modified to use a single parameter object to avoid the multiple parameter copies that are currently performed. It should work to use the transform parameters pointer.

This code has been adapted for the ITKv4 registration framework from the v3 version, itkLBFGSOptimizer.

Definition at line 73 of file itkLBFGSOptimizerBasev4.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef
LBFGSOptimizerBaseHelperv4
< TInternalVnlOptimizerType > 
InternalOptimizerType
 
typedef Superclass::MetricType MetricType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Superclass::ScalesType ScalesType
 
typedef LBFGSOptimizerBasev4 Self
 
typedef
Superclass::StopConditionDescriptionType 
StopConditionDescriptionType
 
typedef
Superclass::StopConditionReturnStringType 
StopConditionReturnStringType
 
typedef
SingleValuedNonLinearVnlOptimizerv4 
Superclass
 
- Public Types inherited from itk::SingleValuedNonLinearVnlOptimizerv4
typedef ReceptorMemberCommand
< Self
CommandType
 
typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::DerivativeType DerivativeType
 
typedef Superclass::MetricType MetricType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Superclass::ScalesType ScalesType
 
typedef
SingleValuedNonLinearVnlOptimizerv4 
Self
 
typedef
Superclass::StopConditionDescriptionType 
StopConditionDescriptionType
 
typedef
Superclass::StopConditionReturnStringType 
StopConditionReturnStringType
 
typedef ObjectToObjectOptimizerBase Superclass
 
- Public Types inherited from itk::ObjectToObjectOptimizerBaseTemplate< double >
typedef SmartPointer< const SelfConstPointer
 
typedef MetricType::DerivativeType DerivativeType
 
typedef MetricType::MeasureType MeasureType
 
typedef
ObjectToObjectMetricBaseTemplate
< double > 
MetricType
 
typedef MetricType::Pointer MetricTypePointer
 
typedef
MetricType::NumberOfParametersType 
NumberOfParametersType
 
typedef OptimizerParameters
< double > 
ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef
OptimizerParameterScalesEstimatorTemplate
< double > 
ScalesEstimatorType
 
typedef OptimizerParameters
< double > 
ScalesType
 
typedef
ObjectToObjectOptimizerBaseTemplate 
Self
 
typedef std::ostringstream StopConditionDescriptionType
 
typedef std::string StopConditionReturnStringType
 
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 double GetGradientConvergenceTolerance () const
 
virtual unsigned int GetMaximumNumberOfFunctionEvaluations () const
 
virtual const char * GetNameOfClass () const
 
InternalOptimizerTypeGetOptimizer ()
 
virtual const
StopConditionReturnStringType 
GetStopConditionDescription () const override
 
virtual bool GetTrace () const
 
virtual void SetGradientConvergenceTolerance (double gtol)
 
virtual void SetMaximumNumberOfFunctionEvaluations (unsigned int n)
 
virtual void SetMetric (MetricType *metric) override
 
virtual void SetTrace (bool flag)
 
virtual void StartOptimization (bool doOnlyInitialization=false) override
 
virtual void TraceOff ()
 
virtual void TraceOn ()
 
- Public Member Functions inherited from itk::SingleValuedNonLinearVnlOptimizerv4
virtual const DerivativeTypeGetCachedDerivative () const
 
virtual const ParametersTypeGetCachedCurrentPosition () const
 
- Public Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< double >
virtual SizeValueType GetCurrentIteration () const
 
virtual const MeasureTypeGetCurrentMetricValue () const
 
virtual const ParametersTypeGetCurrentPosition () const
 
virtual SizeValueType GetNumberOfIterations () const
 
virtual const ThreadIdTypeGetNumberOfThreads () const
 
virtual const ScalesTypeGetScales () const
 
virtual const bool & GetScalesAreIdentity () const
 
bool GetScalesInitialized () const
 
virtual const MeasureTypeGetValue () const
 
virtual const ScalesTypeGetWeights () const
 
virtual const bool & GetWeightsAreIdentity () const
 
virtual void SetNumberOfIterations (SizeValueType _arg)
 
virtual void SetNumberOfThreads (ThreadIdType number)
 
virtual void SetScalesEstimator (ScalesEstimatorType *_arg)
 
virtual void SetWeights (ScalesType _arg)
 
virtual void SetMetric (MetricType *_arg)
 
virtual MetricTypeGetModifiableMetric ()
 
virtual const MetricTypeGetMetric () const
 
virtual void SetScales (const ScalesType &scales)
 
virtual void SetDoEstimateScales (bool _arg)
 
virtual const bool & GetDoEstimateScales () const
 
virtual void DoEstimateScalesOn ()
 
virtual void DoEstimateScalesOff ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual 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
 
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
 

Protected Types

typedef
Superclass::CostFunctionAdaptorType 
CostFunctionAdaptorType
 
typedef AutoPointer
< InternalOptimizerType
InternalOptimizerAutoPointer
 
- Protected Types inherited from itk::SingleValuedNonLinearVnlOptimizerv4
typedef
SingleValuedVnlCostFunctionAdaptorv4 
CostFunctionAdaptorType
 

Protected Member Functions

 LBFGSOptimizerBasev4 ()
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual ~LBFGSOptimizerBasev4 ()
 
- Protected Member Functions inherited from itk::SingleValuedNonLinearVnlOptimizerv4
const CostFunctionAdaptorTypeGetCostFunctionAdaptor () const
 
CostFunctionAdaptorTypeGetCostFunctionAdaptor ()
 
CostFunctionAdaptorTypeGetNonConstCostFunctionAdaptor () const
 
void SetCostFunctionAdaptor (CostFunctionAdaptorType *adaptor)
 
 SingleValuedNonLinearVnlOptimizerv4 ()
 
virtual ~SingleValuedNonLinearVnlOptimizerv4 ()
 
- Protected Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< double >
 ObjectToObjectOptimizerBaseTemplate ()
 
virtual ~ObjectToObjectOptimizerBaseTemplate ()
 
- 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

double m_CostFunctionConvergenceFactor
 
double m_GradientConvergenceTolerance
 
double m_InfinityNormOfProjectedGradient
 
unsigned int m_MaximumNumberOfFunctionEvaluations
 
bool m_OptimizerInitialized
 
std::ostringstream m_StopConditionDescription
 
bool m_Trace
 
InternalOptimizerAutoPointer m_VnlOptimizer
 
- Protected Attributes inherited from itk::ObjectToObjectOptimizerBaseTemplate< double >
SizeValueType m_CurrentIteration
 
MeasureType m_CurrentMetricValue
 
bool m_DoEstimateScales
 
MetricTypePointer m_Metric
 
SizeValueType m_NumberOfIterations
 
ThreadIdType m_NumberOfThreads
 
ScalesType m_Scales
 
bool m_ScalesAreIdentity
 
ScalesEstimatorType::Pointer m_ScalesEstimator
 
ScalesType m_Weights
 
bool m_WeightsAreIdentity
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Private Member Functions

 LBFGSOptimizerBasev4 (const Self &)
 
void operator= (const Self &)
 

Friends

class LBFGSBOptimizerHelperv4
 
class LBFGSOptimizerBaseHelperv4< TInternalVnlOptimizerType >
 

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 ()
 

Member Typedef Documentation

template<typename TInternalVnlOptimizerType>
typedef SmartPointer< const Self > itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::ConstPointer

Definition at line 81 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef Superclass::CostFunctionAdaptorType itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::CostFunctionAdaptorType
protected

Definition at line 138 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef AutoPointer<InternalOptimizerType> itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::InternalOptimizerAutoPointer
protected

Definition at line 142 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef LBFGSOptimizerBaseHelperv4<TInternalVnlOptimizerType> itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::InternalOptimizerType

The vnl optimizer

Definition at line 97 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef Superclass::MetricType itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::MetricType

Definition at line 84 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef Superclass::ParametersType itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::ParametersType

Definition at line 87 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef SmartPointer< Self > itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::Pointer

Definition at line 80 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef Superclass::ScalesType itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::ScalesType

Definition at line 88 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef LBFGSOptimizerBasev4 itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::Self

Standard "Self" typedef.

Definition at line 78 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef Superclass::StopConditionDescriptionType itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::StopConditionDescriptionType

Stop condition internal string type

Definition at line 94 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef Superclass::StopConditionReturnStringType itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::StopConditionReturnStringType

Stop condition return string type

Definition at line 91 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
typedef SingleValuedNonLinearVnlOptimizerv4 itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::Superclass

Definition at line 79 of file itkLBFGSOptimizerBasev4.h.

Constructor & Destructor Documentation

template<typename TInternalVnlOptimizerType>
itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::LBFGSOptimizerBasev4 ( )
protected
template<typename TInternalVnlOptimizerType>
virtual itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::~LBFGSOptimizerBasev4 ( )
protectedvirtual
template<typename TInternalVnlOptimizerType>
itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::LBFGSOptimizerBasev4 ( const Self )
private

Member Function Documentation

template<typename TInternalVnlOptimizerType>
virtual double itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::GetGradientConvergenceTolerance ( ) const
virtual
template<typename TInternalVnlOptimizerType>
virtual unsigned int itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::GetMaximumNumberOfFunctionEvaluations ( ) const
virtual
template<typename TInternalVnlOptimizerType>
virtual const char* itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::SingleValuedNonLinearVnlOptimizerv4.

Reimplemented in itk::LBFGSBOptimizerv4, and itk::LBFGSOptimizerv4.

template<typename TInternalVnlOptimizerType>
InternalOptimizerType* itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::GetOptimizer ( )

Method for getting access to the internal optimizer.

template<typename TInternalVnlOptimizerType>
virtual const StopConditionReturnStringType itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::GetStopConditionDescription ( ) const
overridevirtual

Get the reason for termination

Implements itk::SingleValuedNonLinearVnlOptimizerv4.

template<typename TInternalVnlOptimizerType>
virtual bool itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::GetTrace ( ) const
virtual
template<typename TInternalVnlOptimizerType>
void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::operator= ( const Self )
private
template<typename TInternalVnlOptimizerType>
virtual void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Print out internal state

Reimplemented from itk::SingleValuedNonLinearVnlOptimizerv4.

Reimplemented in itk::LBFGSBOptimizerv4, and itk::LBFGSOptimizerv4.

template<typename TInternalVnlOptimizerType>
virtual void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::SetGradientConvergenceTolerance ( double  gtol)
virtual

Set/Get the gradient convergence tolerance. This is a positive real number that determines the accuracy with which the solution is to be found. The optimization terminates when: ||G|| < gtol max(1,||X||) where ||.|| denotes the Euclidean norm.

template<typename TInternalVnlOptimizerType>
virtual void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::SetMaximumNumberOfFunctionEvaluations ( unsigned int  n)
virtual

Set/Get the maximum number of function evaluations allowed.

template<typename TInternalVnlOptimizerType>
virtual void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::SetMetric ( MetricType metric)
overridevirtual

Plug in a Cost Function into the optimizer

Implements itk::SingleValuedNonLinearVnlOptimizerv4.

Reimplemented in itk::LBFGSBOptimizerv4, and itk::LBFGSOptimizerv4.

template<typename TInternalVnlOptimizerType>
virtual void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::SetTrace ( bool  flag)
virtual

Set/Get the optimizer trace flag. If set to true, the optimizer prints out information every iteration.

template<typename TInternalVnlOptimizerType>
virtual void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::StartOptimization ( bool  doOnlyInitialization = false)
overridevirtual

Start optimization with an initial value.

Reimplemented from itk::SingleValuedNonLinearVnlOptimizerv4.

Reimplemented in itk::LBFGSBOptimizerv4, and itk::LBFGSOptimizerv4.

template<typename TInternalVnlOptimizerType>
virtual void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::TraceOff ( )
virtual
template<typename TInternalVnlOptimizerType>
virtual void itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::TraceOn ( )
virtual

Friends And Related Function Documentation

template<typename TInternalVnlOptimizerType>
friend class LBFGSBOptimizerHelperv4
friend

Definition at line 156 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
friend class LBFGSOptimizerBaseHelperv4< TInternalVnlOptimizerType >
friend

Definition at line 155 of file itkLBFGSOptimizerBasev4.h.

Member Data Documentation

template<typename TInternalVnlOptimizerType>
double itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::m_CostFunctionConvergenceFactor
protected

Definition at line 151 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
double itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::m_GradientConvergenceTolerance
protected

Definition at line 149 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
double itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::m_InfinityNormOfProjectedGradient
protected

Definition at line 150 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
unsigned int itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::m_MaximumNumberOfFunctionEvaluations
protected

Definition at line 148 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
bool itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::m_OptimizerInitialized
protected

Definition at line 140 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
std::ostringstream itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::m_StopConditionDescription
mutableprotected

Definition at line 145 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
bool itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::m_Trace
protected

Definition at line 147 of file itkLBFGSOptimizerBasev4.h.

template<typename TInternalVnlOptimizerType>
InternalOptimizerAutoPointer itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >::m_VnlOptimizer
protected

Definition at line 143 of file itkLBFGSOptimizerBasev4.h.


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