ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkSingleValuedVnlCostFunctionAdaptor.h>
This class is an Adaptor that allows to pass itk::SingleValuedCostFunctions to vnl_optimizers expecting a vnl_cost_function.
This class returns a single valued.
Definition at line 37 of file itkSingleValuedVnlCostFunctionAdaptor.h.
Public Types | |
using | DerivativeType = SingleValuedCostFunction::DerivativeType |
using | InternalDerivativeType = vnl_vector< double > |
using | InternalMeasureType = double |
using | InternalParametersType = vnl_vector< double > |
using | MeasureType = SingleValuedCostFunction::MeasureType |
using | ParametersType = SingleValuedCostFunction::ParametersType |
using | ScalesType = Array< double > |
Public Member Functions | |
unsigned long | AddObserver (const EventObject &event, Command *) const |
void | compute (const InternalParametersType &x, InternalMeasureType *f, InternalDerivativeType *g) override |
void | ConvertExternalToInternalGradient (const DerivativeType &input, InternalDerivativeType &output) const |
InternalMeasureType | f (const InternalParametersType &inparameters) override |
const ParametersType & | GetCachedCurrentParameters () const |
const DerivativeType & | GetCachedDerivative () const |
const MeasureType & | GetCachedValue () const |
const SingleValuedCostFunction * | GetCostFunction () const |
bool | GetNegateCostFunction () const |
void | gradf (const InternalParametersType &inparameters, InternalDerivativeType &gradient) override |
void | NegateCostFunctionOff () |
void | NegateCostFunctionOn () |
void | SetCostFunction (SingleValuedCostFunction *costFunction) |
void | SetNegateCostFunction (bool value) |
void | SetScales (const ScalesType &scales) |
SingleValuedVnlCostFunctionAdaptor (unsigned int spaceDimension) | |
Protected Member Functions | |
void | ReportIteration (const EventObject &event) const |
Private Member Functions | |
virtual const ScalesType & | GetInverseScales () const |
using itk::SingleValuedVnlCostFunctionAdaptor::DerivativeType = SingleValuedCostFunction::DerivativeType |
Derivatives of the SingleValuedCostFunction
Definition at line 55 of file itkSingleValuedVnlCostFunctionAdaptor.h.
using itk::SingleValuedVnlCostFunctionAdaptor::InternalDerivativeType = vnl_vector< double > |
InternalGradientType type alias.
Definition at line 49 of file itkSingleValuedVnlCostFunctionAdaptor.h.
using itk::SingleValuedVnlCostFunctionAdaptor::InternalMeasureType = double |
InternalMeasureType type alias.
Definition at line 46 of file itkSingleValuedVnlCostFunctionAdaptor.h.
using itk::SingleValuedVnlCostFunctionAdaptor::InternalParametersType = vnl_vector< double > |
InternalParametersType type alias.
Definition at line 43 of file itkSingleValuedVnlCostFunctionAdaptor.h.
Type of the SingleValuedCostFunction value
Definition at line 58 of file itkSingleValuedVnlCostFunctionAdaptor.h.
using itk::SingleValuedVnlCostFunctionAdaptor::ParametersType = SingleValuedCostFunction::ParametersType |
Parameters of the SingleValuedCostFunction
Definition at line 52 of file itkSingleValuedVnlCostFunctionAdaptor.h.
using itk::SingleValuedVnlCostFunctionAdaptor::ScalesType = Array< double > |
Scales type alias
Definition at line 61 of file itkSingleValuedVnlCostFunctionAdaptor.h.
itk::SingleValuedVnlCostFunctionAdaptor::SingleValuedVnlCostFunctionAdaptor | ( | unsigned int | spaceDimension | ) |
Constructor with size
unsigned long itk::SingleValuedVnlCostFunctionAdaptor::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::SingleValuedVnlCostFunctionAdaptor::ConvertExternalToInternalGradient | ( | const DerivativeType & | input, |
InternalDerivativeType & | output | ||
) | const |
Convert external derviative measures into internal type
|
override |
Delegate computation of the value to the CostFunction.
const ParametersType& itk::SingleValuedVnlCostFunctionAdaptor::GetCachedCurrentParameters | ( | ) | const |
const DerivativeType& itk::SingleValuedVnlCostFunctionAdaptor::GetCachedDerivative | ( | ) | const |
const MeasureType& itk::SingleValuedVnlCostFunctionAdaptor::GetCachedValue | ( | ) | const |
|
inline |
Get the CostFunction deriving from SingleValuedCostFunction
Definition at line 71 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
privatevirtual |
Get current parameters scaling.
bool itk::SingleValuedVnlCostFunctionAdaptor::GetNegateCostFunction | ( | ) | const |
|
override |
Delegate computation of the gradient to the costFunction.
|
inline |
Definition at line 107 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
inline |
Definition at line 106 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
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 itkSingleValuedVnlCostFunctionAdaptor.h.
void itk::SingleValuedVnlCostFunctionAdaptor::SetNegateCostFunction | ( | bool | value | ) |
Set/Get Negate cost function. The purpose of this boolean flag is to make possible to take certain VNL optimizers that are only minimizers, and use them for maximizing functions. When the boolean flag is set to true, the values returned by GetValue in the internal ITK cost function will be multiplied by -1 before returning it in the f() function. Similar operations will be done for the gradf() and compute() methods. When the boolean flag is set to false, then the values returned by the ITK cost function will be passed unchanged to the VNL optimizers.
void itk::SingleValuedVnlCostFunctionAdaptor::SetScales | ( | const ScalesType & | scales | ) |
Set current parameters scaling.
|
mutableprivate |
Definition at line 144 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
mutableprivate |
Definition at line 143 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
mutableprivate |
Definition at line 142 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
private |
Definition at line 134 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
private |
Definition at line 138 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
private |
Definition at line 139 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
private |
Definition at line 140 of file itkSingleValuedVnlCostFunctionAdaptor.h.
|
private |
Definition at line 137 of file itkSingleValuedVnlCostFunctionAdaptor.h.