ITK
5.2.0
Insight Toolkit
|
#include <itkSingleValuedVnlCostFunctionAdaptorv4.h>
Public Types | |
using | DerivativeType = ObjectToObjectMetricBase::DerivativeType |
using | InternalDerivativeType = vnl_vector< InternalMeasureType > |
using | InternalMeasureType = double |
using | InternalParametersType = vnl_vector< InternalMeasureType > |
using | MeasureType = ObjectToObjectMetricBase::MeasureType |
using | ParametersType = ObjectToObjectMetricBase::ParametersType |
using | ScalesType = OptimizerParameters< InternalMeasureType > |
Public Member Functions | |
unsigned long | AddObserver (const EventObject &event, Command *) const |
void | compute (const InternalParametersType &x, InternalMeasureType *fun, InternalDerivativeType *g) override |
void | ConvertExternalToInternalGradient (const DerivativeType &input, InternalDerivativeType &output) const |
InternalMeasureType | f (const InternalParametersType &inparameters) override |
const ParametersType & | GetCachedCurrentParameters () const |
virtual const DerivativeType & | GetCachedDerivative () const |
virtual const MeasureType & | GetCachedValue () const |
const ObjectToObjectMetricBase * | GetCostFunction () const |
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 |
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 37 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
using itk::SingleValuedVnlCostFunctionAdaptorv4::DerivativeType = ObjectToObjectMetricBase::DerivativeType |
Derivatives of the SingleValuedCostFunction
Definition at line 54 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
using itk::SingleValuedVnlCostFunctionAdaptorv4::InternalDerivativeType = vnl_vector<InternalMeasureType> |
InternalGradientType type alias.
Definition at line 48 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
InternalMeasureType type alias.
Definition at line 42 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
using itk::SingleValuedVnlCostFunctionAdaptorv4::InternalParametersType = vnl_vector<InternalMeasureType> |
InternalParametersType type alias.
Definition at line 45 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
using itk::SingleValuedVnlCostFunctionAdaptorv4::MeasureType = ObjectToObjectMetricBase::MeasureType |
Type of the SingleValuedCostFunction value
Definition at line 57 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
using itk::SingleValuedVnlCostFunctionAdaptorv4::ParametersType = ObjectToObjectMetricBase::ParametersType |
Parameters of the SingleValuedCostFunction
Definition at line 51 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
using itk::SingleValuedVnlCostFunctionAdaptorv4::ScalesType = OptimizerParameters<InternalMeasureType> |
Scales type alias
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.
|
override |
Delegate computation of value and gradient to the costFunction.
void itk::SingleValuedVnlCostFunctionAdaptorv4::ConvertExternalToInternalGradient | ( | const DerivativeType & | input, |
InternalDerivativeType & | output | ||
) | const |
Convert external derivative measures into internal type
|
override |
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 74 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
References m_ObjectMetric.
|
override |
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 67 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
References m_ObjectMetric.
void itk::SingleValuedVnlCostFunctionAdaptorv4::SetScales | ( | const ScalesType & | scales | ) |
Set current parameters scaling.
|
mutableprivate |
Definition at line 131 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
|
mutableprivate |
Definition at line 130 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
|
private |
Definition at line 125 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
Referenced by GetCostFunction(), and SetCostFunction().
|
private |
Definition at line 128 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
|
private |
Definition at line 127 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.
|
private |
Definition at line 126 of file itkSingleValuedVnlCostFunctionAdaptorv4.h.