ITK  4.8.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::SingleValuedVnlCostFunctionAdaptorv4 Class Reference

#include <itkSingleValuedVnlCostFunctionAdaptorv4.h>

+ Inheritance diagram for itk::SingleValuedVnlCostFunctionAdaptorv4:
+ Collaboration diagram for itk::SingleValuedVnlCostFunctionAdaptorv4:

Detailed Description

This class is an Adaptor that allows to pass itk::ObjectToObjectMetricBase objects to vnl_optimizers expecting a vnl_cost_function. For use in the ITKv4 registration framework.

This class returns a single value.

Definition at line 36 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

Public Types

typedef vnl_vector
< InternalMeasureType
typedef double InternalMeasureType
typedef vnl_vector
< InternalMeasureType
typedef OptimizerParameters
< InternalMeasureType

Public Member Functions

unsigned long AddObserver (const EventObject &event, Command *) const
virtual void compute (const InternalParametersType &x, InternalMeasureType *f, InternalDerivativeType *g) override
void ConvertExternalToInternalGradient (const DerivativeType &input, InternalDerivativeType &output) const
virtual InternalMeasureType f (const InternalParametersType &inparameters) override
const ParametersTypeGetCachedCurrentParameters () const
virtual const DerivativeTypeGetCachedDerivative () const
virtual const MeasureTypeGetCachedValue () const
const ObjectToObjectMetricBaseGetCostFunction (void) const
virtual void gradf (const InternalParametersType &inparameters, InternalDerivativeType &gradient) override
void SetCostFunction (ObjectToObjectMetricBase *costFunction)
void SetScales (const ScalesType &scales)
 SingleValuedVnlCostFunctionAdaptorv4 (unsigned int spaceDimension)

Protected Member Functions

void ReportIteration (const EventObject &event) const

Private Attributes

DerivativeType m_CachedDerivative
MeasureType m_CachedValue
ObjectToObjectMetricBase::Pointer m_ObjectMetric
Object::Pointer m_Reporter
ScalesType m_Scales
bool m_ScalesInitialized

Member Typedef Documentation

Derivatives of the SingleValuedCostFunction

Definition at line 54 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

InternalGradientType typedef.

Definition at line 48 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

InternalMeasureType typedef.

Definition at line 42 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

InternalParametersType typedef.

Definition at line 45 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

Type of the SingleValuedCostFunction value

Definition at line 57 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

Parameters of the SingleValuedCostFunction

Definition at line 51 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

Scales typedef

Definition at line 60 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

Constructor & Destructor Documentation

itk::SingleValuedVnlCostFunctionAdaptorv4::SingleValuedVnlCostFunctionAdaptorv4 ( unsigned int  spaceDimension)

Constructor with size

Member Function Documentation

unsigned long itk::SingleValuedVnlCostFunctionAdaptorv4::AddObserver ( const EventObject event,
) 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.

virtual void itk::SingleValuedVnlCostFunctionAdaptorv4::compute ( const InternalParametersType x,
InternalMeasureType f,
InternalDerivativeType g 

Delegate computation of value and gradient to the costFunction.

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

Convert external derviative measures into internal type

virtual InternalMeasureType itk::SingleValuedVnlCostFunctionAdaptorv4::f ( const InternalParametersType inparameters)

Delegate computation of the value to the CostFunction.

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

Return the parameters directly from the assigned metric.

virtual const DerivativeType& itk::SingleValuedVnlCostFunctionAdaptorv4::GetCachedDerivative ( ) const
virtual const MeasureType& itk::SingleValuedVnlCostFunctionAdaptorv4::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.

const ObjectToObjectMetricBase* itk::SingleValuedVnlCostFunctionAdaptorv4::GetCostFunction ( void  ) const

Get the CostFunction deriving from SingleValuedCostFunction

Definition at line 72 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

References m_ObjectMetric.

virtual void itk::SingleValuedVnlCostFunctionAdaptorv4::gradf ( const InternalParametersType inparameters,
InternalDerivativeType gradient 

Delegate computation of the gradient to the costFunction.

void itk::SingleValuedVnlCostFunctionAdaptorv4::ReportIteration ( const EventObject event) const

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

void itk::SingleValuedVnlCostFunctionAdaptorv4::SetCostFunction ( ObjectToObjectMetricBase costFunction)

Set the CostFunction deriving from SingleValuedCostFunction

Definition at line 66 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

References m_ObjectMetric.

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

Set current parameters scaling.

Member Data Documentation

DerivativeType itk::SingleValuedVnlCostFunctionAdaptorv4::m_CachedDerivative

Definition at line 123 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

MeasureType itk::SingleValuedVnlCostFunctionAdaptorv4::m_CachedValue

Definition at line 122 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

ObjectToObjectMetricBase::Pointer itk::SingleValuedVnlCostFunctionAdaptorv4::m_ObjectMetric

Definition at line 117 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

Referenced by GetCostFunction(), and SetCostFunction().

Object::Pointer itk::SingleValuedVnlCostFunctionAdaptorv4::m_Reporter

Definition at line 120 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

ScalesType itk::SingleValuedVnlCostFunctionAdaptorv4::m_Scales

Definition at line 119 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

bool itk::SingleValuedVnlCostFunctionAdaptorv4::m_ScalesInitialized

Definition at line 118 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.

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