ITK  5.4.0
Insight Toolkit
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members

#include <itkMultipleValuedVnlCostFunctionAdaptor.h>

Detailed Description

This class is an Adaptor that allows to pass itk::MultipleValuedCostFunctions to vnl_optimizers expecting a vnl_cost_function.

This class returns a single valued.

Definition at line 37 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

+ Inheritance diagram for itk::MultipleValuedVnlCostFunctionAdaptor:
+ Collaboration diagram for itk::MultipleValuedVnlCostFunctionAdaptor:

Public Types

using DerivativeType = MultipleValuedCostFunction::DerivativeType
 
using InternalDerivativeType = vnl_matrix< double >
 
using InternalMeasureType = vnl_vector< double >
 
using InternalParametersType = vnl_vector< double >
 
using MeasureType = MultipleValuedCostFunction::MeasureType
 
using ParametersType = MultipleValuedCostFunction::ParametersType
 
using ScalesType = Array< double >
 

Public Member Functions

unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void compute (const InternalParametersType &x, InternalMeasureType *ff, InternalDerivativeType *g)
 
void ConvertExternalToInternalGradient (const DerivativeType &input, InternalDerivativeType &output)
 
void ConvertExternalToInternalMeasures (const MeasureType &input, InternalMeasureType &output)
 
void f (const InternalParametersType &inparameters, InternalMeasureType &measures) override
 
const ParametersTypeGetCachedCurrentParameters () const
 
const DerivativeTypeGetCachedDerivative () const
 
const MeasureTypeGetCachedValue () const
 
const MultipleValuedCostFunctionGetCostFunction () const
 
bool GetUseGradient () const
 
void gradf (const InternalParametersType &inparameters, InternalDerivativeType &gradient) override
 
 MultipleValuedVnlCostFunctionAdaptor (unsigned int spaceDimension, unsigned int numberOfValues)
 
void SetCostFunction (MultipleValuedCostFunction *costFunction)
 
void SetScales (const ScalesType &scales)
 
void SetUseGradient (bool)
 
void UseGradientOff ()
 
void UseGradientOn ()
 

Protected Member Functions

void ReportIteration (const EventObject &event) const
 

Private Member Functions

virtual const ScalesTypeGetInverseScales () const
 

Private Attributes

ParametersType m_CachedCurrentParameters {}
 
DerivativeType m_CachedDerivative {}
 
MeasureType m_CachedValue {}
 
MultipleValuedCostFunction::Pointer m_CostFunction {}
 
ScalesType m_InverseScales {}
 
Object::Pointer m_Reporter {}
 
bool m_ScalesInitialized {}
 

Member Typedef Documentation

◆ DerivativeType

Derivatives of the MultipleValuedCostFunction

Definition at line 56 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ InternalDerivativeType

InternalGradientType type alias.

Definition at line 47 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ InternalMeasureType

InternalMeasureType type alias.

Definition at line 44 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ InternalParametersType

InternalParametersType type alias.

Definition at line 41 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ MeasureType

MeasureType of the MultipleValuedCostFunction

Definition at line 50 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ ParametersType

Parameters of the MultipleValuedCostFunction

Definition at line 53 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ ScalesType

Scales type alias

Definition at line 59 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

Constructor & Destructor Documentation

◆ MultipleValuedVnlCostFunctionAdaptor()

itk::MultipleValuedVnlCostFunctionAdaptor::MultipleValuedVnlCostFunctionAdaptor ( unsigned int  spaceDimension,
unsigned int  numberOfValues 
)

Constructor with size

Member Function Documentation

◆ AddObserver()

unsigned long itk::MultipleValuedVnlCostFunctionAdaptor::AddObserver ( const EventObject event,
Command  
) const

This AddObserver method allows to simulate that this class derives from an itkObject for the purpose of reporting iteration events. The goal of this method is to allow ITK-vnl optimizer adaptors to get iteration events despite the fact that VNL does not provide callbacks.

◆ compute()

virtual void itk::MultipleValuedVnlCostFunctionAdaptor::compute ( const InternalParametersType x,
InternalMeasureType ff,
InternalDerivativeType g 
)
virtual

Delegate computation of value and gradient to the costFunction.

◆ ConvertExternalToInternalGradient()

void itk::MultipleValuedVnlCostFunctionAdaptor::ConvertExternalToInternalGradient ( const DerivativeType input,
InternalDerivativeType output 
)

Convert external derivative measures into internal type

◆ ConvertExternalToInternalMeasures()

void itk::MultipleValuedVnlCostFunctionAdaptor::ConvertExternalToInternalMeasures ( const MeasureType input,
InternalMeasureType output 
)

Convert external measures into internal type

◆ f()

void itk::MultipleValuedVnlCostFunctionAdaptor::f ( const InternalParametersType inparameters,
InternalMeasureType measures 
)
override

Delegate computation of the value to the CostFunction.

◆ GetCachedCurrentParameters()

const ParametersType& itk::MultipleValuedVnlCostFunctionAdaptor::GetCachedCurrentParameters ( ) const

◆ GetCachedDerivative()

const DerivativeType& itk::MultipleValuedVnlCostFunctionAdaptor::GetCachedDerivative ( ) const

◆ GetCachedValue()

const MeasureType& itk::MultipleValuedVnlCostFunctionAdaptor::GetCachedValue ( ) const

Return the value of the last evaluation to the value of the cost function. Note that this method DOES NOT triggers a computation of the function or the derivatives, it only returns previous values. Therefore the values here are only valid after you invoke the f() or gradf() methods.

◆ GetCostFunction()

const MultipleValuedCostFunction* itk::MultipleValuedVnlCostFunctionAdaptor::GetCostFunction ( ) const
inline

Get the CostFunction deriving from MultipleValuedCostFunction

Definition at line 73 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ GetInverseScales()

virtual const ScalesType& itk::MultipleValuedVnlCostFunctionAdaptor::GetInverseScales ( ) const
privatevirtual

Get current parameters scaling.

◆ GetUseGradient()

bool itk::MultipleValuedVnlCostFunctionAdaptor::GetUseGradient ( ) const

◆ gradf()

void itk::MultipleValuedVnlCostFunctionAdaptor::gradf ( const InternalParametersType inparameters,
InternalDerivativeType gradient 
)
override

Delegate computation of the gradient to the costFunction.

◆ ReportIteration()

void itk::MultipleValuedVnlCostFunctionAdaptor::ReportIteration ( const EventObject event) const
protected

This method is intended to be called by the derived classes in order to notify of an iteration event to any Command/Observers

◆ SetCostFunction()

void itk::MultipleValuedVnlCostFunctionAdaptor::SetCostFunction ( MultipleValuedCostFunction costFunction)
inline

Set the CostFunction deriving from MultipleValuedCostFunction

Definition at line 66 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ SetScales()

void itk::MultipleValuedVnlCostFunctionAdaptor::SetScales ( const ScalesType scales)

Set current parameters scaling.

◆ SetUseGradient()

void itk::MultipleValuedVnlCostFunctionAdaptor::SetUseGradient ( bool  )

Define if the Cost function should provide a customized Gradient computation or the gradient can be computed internally using a default approach

◆ UseGradientOff()

void itk::MultipleValuedVnlCostFunctionAdaptor::UseGradientOff ( )
inline

Definition at line 110 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ UseGradientOn()

void itk::MultipleValuedVnlCostFunctionAdaptor::UseGradientOn ( )
inline

Definition at line 105 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

Member Data Documentation

◆ m_CachedCurrentParameters

ParametersType itk::MultipleValuedVnlCostFunctionAdaptor::m_CachedCurrentParameters {}
mutableprivate

Definition at line 159 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ m_CachedDerivative

DerivativeType itk::MultipleValuedVnlCostFunctionAdaptor::m_CachedDerivative {}
mutableprivate

Definition at line 158 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ m_CachedValue

MeasureType itk::MultipleValuedVnlCostFunctionAdaptor::m_CachedValue {}
mutableprivate

Definition at line 157 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ m_CostFunction

MultipleValuedCostFunction::Pointer itk::MultipleValuedVnlCostFunctionAdaptor::m_CostFunction {}
private

Definition at line 151 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ m_InverseScales

ScalesType itk::MultipleValuedVnlCostFunctionAdaptor::m_InverseScales {}
private

Definition at line 154 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ m_Reporter

Object::Pointer itk::MultipleValuedVnlCostFunctionAdaptor::m_Reporter {}
private

Definition at line 155 of file itkMultipleValuedVnlCostFunctionAdaptor.h.

◆ m_ScalesInitialized

bool itk::MultipleValuedVnlCostFunctionAdaptor::m_ScalesInitialized {}
private

Definition at line 153 of file itkMultipleValuedVnlCostFunctionAdaptor.h.


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