ITK
4.9.0
Insight Segmentation and Registration Toolkit
|
#include <itkSingleValuedVnlCostFunctionAdaptorv4.h>
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 ObjectToObjectMetricBase::DerivativeType | DerivativeType |
typedef vnl_vector < InternalMeasureType > | InternalDerivativeType |
typedef double | InternalMeasureType |
typedef vnl_vector < InternalMeasureType > | InternalParametersType |
typedef ObjectToObjectMetricBase::MeasureType | MeasureType |
typedef ObjectToObjectMetricBase::ParametersType | ParametersType |
typedef OptimizerParameters < InternalMeasureType > | ScalesType |
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 ParametersType & | GetCachedCurrentParameters () const |
virtual const DerivativeType & | GetCachedDerivative () const |
virtual const MeasureType & | GetCachedValue () const |
const ObjectToObjectMetricBase * | GetCostFunction (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 |
typedef ObjectToObjectMetricBase::DerivativeType itk::SingleValuedVnlCostFunctionAdaptorv4::DerivativeType |
Derivatives of the SingleValuedCostFunction
Definition at line 54 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
typedef vnl_vector< InternalMeasureType > itk::SingleValuedVnlCostFunctionAdaptorv4::InternalDerivativeType |
InternalGradientType typedef.
Definition at line 48 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
InternalMeasureType typedef.
Definition at line 42 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
typedef vnl_vector< InternalMeasureType > itk::SingleValuedVnlCostFunctionAdaptorv4::InternalParametersType |
InternalParametersType typedef.
Definition at line 45 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
typedef ObjectToObjectMetricBase::MeasureType itk::SingleValuedVnlCostFunctionAdaptorv4::MeasureType |
Type of the SingleValuedCostFunction value
Definition at line 57 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
typedef ObjectToObjectMetricBase::ParametersType itk::SingleValuedVnlCostFunctionAdaptorv4::ParametersType |
Parameters of the SingleValuedCostFunction
Definition at line 51 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
typedef OptimizerParameters< InternalMeasureType > itk::SingleValuedVnlCostFunctionAdaptorv4::ScalesType |
Scales typedef
Definition at line 60 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
itk::SingleValuedVnlCostFunctionAdaptorv4::SingleValuedVnlCostFunctionAdaptorv4 | ( | unsigned int | spaceDimension | ) |
Constructor with size
unsigned long itk::SingleValuedVnlCostFunctionAdaptorv4::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.
|
overridevirtual |
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
|
overridevirtual |
Delegate computation of the value to the CostFunction.
const ParametersType& itk::SingleValuedVnlCostFunctionAdaptorv4::GetCachedCurrentParameters | ( | ) | const |
Return the parameters directly from the assigned metric.
|
virtual |
|
virtual |
|
inline |
Get the CostFunction deriving from SingleValuedCostFunction
Definition at line 72 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
References m_ObjectMetric.
|
overridevirtual |
Delegate computation of the gradient to the costFunction.
|
protected |
This method is intended to be called by the derived classes in order to notify of an iteration event to any Command/Observers
|
inline |
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.
|
mutableprivate |
Definition at line 123 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
|
mutableprivate |
Definition at line 122 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
|
private |
Definition at line 117 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
Referenced by GetCostFunction(), and SetCostFunction().
|
private |
Definition at line 120 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
|
private |
Definition at line 119 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
|
private |
Definition at line 118 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.