ITK
6.0.0
Insight Toolkit
|
#include <itkSingleValuedNonLinearVnlOptimizerv4.h>
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 40 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
Public Member Functions | |
const char * | GetNameOfClass () const override |
StopConditionReturnStringType | GetStopConditionDescription () const override=0 |
void | SetMetric (MetricType *metric) override=0 |
void | StartOptimization (bool doOnlyInitialization=false) override |
virtual const DerivativeType & | GetCachedDerivative () const |
virtual const ParametersType & | GetCachedCurrentPosition () const |
Public Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< double > | |
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 |
Protected Types | |
using | CostFunctionAdaptorType = SingleValuedVnlCostFunctionAdaptorv4 |
Protected Member Functions | |
CostFunctionAdaptorType * | GetCostFunctionAdaptor () |
const CostFunctionAdaptorType * | GetCostFunctionAdaptor () const |
CostFunctionAdaptorType * | GetNonConstCostFunctionAdaptor () const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
void | SetCostFunctionAdaptor (CostFunctionAdaptorType *adaptor) |
SingleValuedNonLinearVnlOptimizerv4 () | |
~SingleValuedNonLinearVnlOptimizerv4 () override | |
Protected Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< double > | |
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 () |
Private Member Functions | |
void | IterationReport (const EventObject &event) |
Private Attributes | |
ParametersType | m_CachedCurrentPosition {} |
DerivativeType | m_CachedDerivative {} |
CommandType::Pointer | m_Command {} |
std::unique_ptr< CostFunctionAdaptorType > | m_CostFunctionAdaptor |
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 val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Attributes inherited from itk::ObjectToObjectOptimizerBaseTemplate< double > | |
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 {} |
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 58 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
Definition at line 49 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
|
protected |
Definition at line 100 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
using itk::SingleValuedNonLinearVnlOptimizerv4::DerivativeType = Superclass::DerivativeType |
Definition at line 61 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
using itk::SingleValuedNonLinearVnlOptimizerv4::MetricType = Superclass::MetricType |
Definition at line 60 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
using itk::SingleValuedNonLinearVnlOptimizerv4::ParametersType = Superclass::ParametersType |
Definition at line 62 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
Definition at line 48 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
using itk::SingleValuedNonLinearVnlOptimizerv4::ScalesType = Superclass::ScalesType |
Definition at line 63 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
Standard class type aliases.
Definition at line 46 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
using itk::SingleValuedNonLinearVnlOptimizerv4::StopConditionDescriptionType = Superclass::StopConditionDescriptionType |
Stop condition internal string type
Definition at line 69 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
using itk::SingleValuedNonLinearVnlOptimizerv4::StopConditionReturnStringType = Superclass::StopConditionReturnStringType |
Stop condition return string type
Definition at line 66 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
Definition at line 47 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
|
protected |
|
overrideprotected |
|
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.
|
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.
|
protected |
|
protected |
|
overridevirtual |
Reimplemented from itk::Object.
Reimplemented in itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, and itk::LBFGSOptimizerBasev4< vnl_lbfgs >.
|
protected |
The purpose of this method is to get around the lack of const-correctness in VNL cost-functions and optimizers
|
overridepure virtual |
Get the reason for termination
Implements itk::ObjectToObjectOptimizerBaseTemplate< double >.
Implemented in itk::AmoebaOptimizerv4, itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >, itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, and itk::LBFGSOptimizerBasev4< vnl_lbfgs >.
|
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.
|
overrideprotectedvirtual |
Print out internal state
Reimplemented from itk::Object.
Reimplemented in itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, and itk::LBFGSOptimizerBasev4< vnl_lbfgs >.
|
protected |
|
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::AmoebaOptimizerv4, itk::LBFGSBOptimizerv4, itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >, itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, itk::LBFGSOptimizerBasev4< vnl_lbfgs >, and itk::LBFGSOptimizerv4.
|
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< double >.
Reimplemented in itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, and itk::LBFGSOptimizerBasev4< vnl_lbfgs >.
|
mutableprivate |
Definition at line 134 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
|
mutableprivate |
Definition at line 135 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
|
private |
Definition at line 132 of file itkSingleValuedNonLinearVnlOptimizerv4.h.
|
private |
Definition at line 130 of file itkSingleValuedNonLinearVnlOptimizerv4.h.