go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itk::ScaledSingleValuedCostFunction Class Reference

#include <itkScaledSingleValuedCostFunction.h>

Detailed Description

A cost function that applies a scaling to another cost function.

This class can be used to adapt an existing, badly scaled, cost function.

By default it does not apply any scaling. Use the method SetUseScales(true) to enable the use of scales.

Definition at line 39 of file itkScaledSingleValuedCostFunction.h.

Inheritance diagram for itk::ScaledSingleValuedCostFunction:

Public Types

using ConstPointer = SmartPointer<const Self>
 
using NumberOfParametersType = unsigned int
 
using Pointer = SmartPointer<Self>
 
using ScalesType = Array<double>
 
using Self = ScaledSingleValuedCostFunction
 
using SingleValuedCostFunctionPointer = Superclass::Pointer
 
using Superclass = SingleValuedCostFunction
 

Public Member Functions

virtual void ConvertScaledToUnscaledParameters (ParametersType &parameters) const
 
virtual void ConvertUnscaledToScaledParameters (ParametersType &parameters) const
 
virtual const char * GetClassName () const
 
void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const override
 
virtual bool GetNegateCostFunction () const
 
NumberOfParametersType GetNumberOfParameters () const override
 
virtual const ScalesTypeGetScales ()
 
virtual const ScalesTypeGetSquaredScales ()
 
virtual bool GetUseScales () const
 
MeasureType GetValue (const ParametersType &parameters) const override
 
void GetValueAndDerivative (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
 
 ITK_DISALLOW_COPY_AND_MOVE (ScaledSingleValuedCostFunction)
 
 itkGetModifiableObjectMacro (UnscaledCostFunction, Superclass)
 
virtual void NegateCostFunctionOff ()
 
virtual void NegateCostFunctionOn ()
 
virtual void SetNegateCostFunction (bool _arg)
 
virtual void SetScales (const ScalesType &scales)
 
virtual void SetSquaredScales (const ScalesType &squaredScales)
 
virtual void SetUnscaledCostFunction (Superclass *_arg)
 
virtual void SetUseScales (bool _arg)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

void PrintSelf (std::ostream &os, Indent indent) const override
 
 ScaledSingleValuedCostFunction ()
 
 ~ScaledSingleValuedCostFunction () override=default
 

Private Attributes

bool m_NegateCostFunction { false }
 
ScalesType m_Scales {}
 
ScalesType m_SquaredScales {}
 
SingleValuedCostFunctionPointer m_UnscaledCostFunction { nullptr }
 
bool m_UseScales { false }
 

Member Typedef Documentation

◆ ConstPointer

Definition at line 48 of file itkScaledSingleValuedCostFunction.h.

◆ NumberOfParametersType

◆ Pointer

◆ ScalesType

◆ Self

◆ SingleValuedCostFunctionPointer

◆ Superclass

using itk::ScaledSingleValuedCostFunction::Superclass = SingleValuedCostFunction

Definition at line 46 of file itkScaledSingleValuedCostFunction.h.

Constructor & Destructor Documentation

◆ ScaledSingleValuedCostFunction()

itk::ScaledSingleValuedCostFunction::ScaledSingleValuedCostFunction ( )
protected

The constructor.

◆ ~ScaledSingleValuedCostFunction()

itk::ScaledSingleValuedCostFunction::~ScaledSingleValuedCostFunction ( )
overrideprotecteddefault

The destructor.

Member Function Documentation

◆ ConvertScaledToUnscaledParameters()

virtual void itk::ScaledSingleValuedCostFunction::ConvertScaledToUnscaledParameters ( ParametersType & parameters) const
virtual

Convert the parameters from scaled to unscaled: x = y/s.

◆ ConvertUnscaledToScaledParameters()

virtual void itk::ScaledSingleValuedCostFunction::ConvertUnscaledToScaledParameters ( ParametersType & parameters) const
virtual

Convert the parameters from unscaled to scaled: y = x*s.

◆ GetClassName()

virtual const char * itk::ScaledSingleValuedCostFunction::GetClassName ( ) const
virtual

Run-time type information (and related methods).

◆ GetDerivative()

void itk::ScaledSingleValuedCostFunction::GetDerivative ( const ParametersType & parameters,
DerivativeType & derivative ) const
override

Divide the parameters by the scales, call the GetDerivative routine of the unscaled cost function and divide the resulting derivative by the scales.

◆ GetNegateCostFunction()

virtual bool itk::ScaledSingleValuedCostFunction::GetNegateCostFunction ( ) const
virtual

Get the flag to negate the cost function or not.

◆ GetNumberOfParameters()

NumberOfParametersType itk::ScaledSingleValuedCostFunction::GetNumberOfParameters ( ) const
override

Ask the UnscaledCostFunction how many parameters it has.

◆ GetScales()

virtual const ScalesType & itk::ScaledSingleValuedCostFunction::GetScales ( )
virtual

Get the scales.

◆ GetSquaredScales()

virtual const ScalesType & itk::ScaledSingleValuedCostFunction::GetSquaredScales ( )
virtual

The ITK convention is to use the squared scales. This function returns the squared actual scales.

◆ GetUseScales()

virtual bool itk::ScaledSingleValuedCostFunction::GetUseScales ( ) const
virtual

Get the flag to use scales or not.

◆ GetValue()

MeasureType itk::ScaledSingleValuedCostFunction::GetValue ( const ParametersType & parameters) const
override

Divide the parameters by the scales and call the GetValue routine of the unscaled cost function.

◆ GetValueAndDerivative()

void itk::ScaledSingleValuedCostFunction::GetValueAndDerivative ( const ParametersType & parameters,
MeasureType & value,
DerivativeType & derivative ) const
override

Same procedure as in GetValue and GetDerivative.

◆ ITK_DISALLOW_COPY_AND_MOVE()

itk::ScaledSingleValuedCostFunction::ITK_DISALLOW_COPY_AND_MOVE ( ScaledSingleValuedCostFunction )

◆ itkGetModifiableObjectMacro()

itk::ScaledSingleValuedCostFunction::itkGetModifiableObjectMacro ( UnscaledCostFunction ,
Superclass  )

Get the cost function that needs scaling.

◆ NegateCostFunctionOff()

virtual void itk::ScaledSingleValuedCostFunction::NegateCostFunctionOff ( )
virtual

◆ NegateCostFunctionOn()

virtual void itk::ScaledSingleValuedCostFunction::NegateCostFunctionOn ( )
virtual

Set the flag to negate the cost function or not.

◆ New()

static Pointer itk::ScaledSingleValuedCostFunction::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

void itk::ScaledSingleValuedCostFunction::PrintSelf ( std::ostream & os,
Indent indent ) const
overrideprotected

PrintSelf.

◆ SetNegateCostFunction()

virtual void itk::ScaledSingleValuedCostFunction::SetNegateCostFunction ( bool _arg)
virtual

Set the flag to negate the cost function or not.

◆ SetScales()

virtual void itk::ScaledSingleValuedCostFunction::SetScales ( const ScalesType & scales)
virtual

Set the scales. Also computes the squared scales, just in case users call GetSquaredScales (for compatibility with the ITK convention).

◆ SetSquaredScales()

virtual void itk::ScaledSingleValuedCostFunction::SetSquaredScales ( const ScalesType & squaredScales)
virtual

The ITK convention is to use the squared scales. This function takes the square root of the input scales and sets them as the the actual scales

◆ SetUnscaledCostFunction()

virtual void itk::ScaledSingleValuedCostFunction::SetUnscaledCostFunction ( Superclass * _arg)
virtual

Set the cost function that needs scaling.

◆ SetUseScales()

virtual void itk::ScaledSingleValuedCostFunction::SetUseScales ( bool _arg)
virtual

Set the flag to use scales or not.

Field Documentation

◆ m_NegateCostFunction

bool itk::ScaledSingleValuedCostFunction::m_NegateCostFunction { false }
private

Definition at line 151 of file itkScaledSingleValuedCostFunction.h.

◆ m_Scales

ScalesType itk::ScaledSingleValuedCostFunction::m_Scales {}
private

Member variables.

Definition at line 147 of file itkScaledSingleValuedCostFunction.h.

◆ m_SquaredScales

ScalesType itk::ScaledSingleValuedCostFunction::m_SquaredScales {}
private

Definition at line 148 of file itkScaledSingleValuedCostFunction.h.

◆ m_UnscaledCostFunction

SingleValuedCostFunctionPointer itk::ScaledSingleValuedCostFunction::m_UnscaledCostFunction { nullptr }
private

Definition at line 149 of file itkScaledSingleValuedCostFunction.h.

◆ m_UseScales

bool itk::ScaledSingleValuedCostFunction::m_UseScales { false }
private

Definition at line 150 of file itkScaledSingleValuedCostFunction.h.



Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo