go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
itk::ScaledSingleValuedNonLinearOptimizer Class Reference

#include <itkScaledSingleValuedNonLinearOptimizer.h>

Inheritance diagram for itk::ScaledSingleValuedNonLinearOptimizer:
Inheritance graph
[legend]
Collaboration diagram for itk::ScaledSingleValuedNonLinearOptimizer:
Collaboration graph
[legend]

Public Types

typedef SmartPointer< const SelfConstPointer
typedef
Superclass::CostFunctionType 
CostFunctionType
typedef Superclass::DerivativeType DerivativeType
typedef Superclass::MeasureType MeasureType
typedef Superclass::ParametersType ParametersType
typedef SmartPointer< SelfPointer
typedef
ScaledCostFunctionType::Pointer 
ScaledCostFunctionPointer
typedef
ScaledSingleValuedCostFunction 
ScaledCostFunctionType
typedef
NonLinearOptimizer::ScalesType 
ScalesType
typedef
ScaledSingleValuedNonLinearOptimizer 
Self
typedef
SingleValuedNonLinearOptimizer 
Superclass

Public Member Functions

virtual const char * GetClassName () const
virtual const ParametersTypeGetCurrentPosition (void) const
virtual bool GetMaximize () const
virtual const
ScaledCostFunctionType
GetScaledCostFunction ()
virtual const ParametersTypeGetScaledCurrentPosition ()
bool GetUseScales (void) const
virtual void InitializeScales (void)
virtual void MaximizeOff ()
virtual void MaximizeOn ()
virtual void SetCostFunction (CostFunctionType *costFunction)
virtual void SetMaximize (bool _arg)
virtual void SetUseScales (bool arg)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

virtual void GetScaledDerivative (const ParametersType &parameters, DerivativeType &derivative) const
virtual MeasureType GetScaledValue (const ParametersType &parameters) const
virtual void GetScaledValueAndDerivative (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
void PrintSelf (std::ostream &os, Indent indent) const
 ScaledSingleValuedNonLinearOptimizer ()
virtual void SetCurrentPosition (const ParametersType &param)
virtual void SetScaledCurrentPosition (const ParametersType &parameters)
virtual ~ScaledSingleValuedNonLinearOptimizer ()

Protected Attributes

ScaledCostFunctionPointer m_ScaledCostFunction
ParametersType m_ScaledCurrentPosition

Private Member Functions

void operator= (const Self &)
 ScaledSingleValuedNonLinearOptimizer (const Self &)

Private Attributes

bool m_Maximize
ParametersType m_UnscaledCurrentPosition

Detailed Description

Optimizers that inherit from this class optimize a scaled cost function $F(y)$ instead of the original function $f(x)$:

\[ y = x \cdot s \]

\[ F(y) = f(y/s) \]

where $y$ are the scaled parameters, $x$ the original parameters and $s$ the scales.

During optimization the inheriting classes should update the ScaledCurrentPosition ( $y$) instead of the CurrentPosition ( $y/s$).

When an optimizer needs the value at a (scaled) position $y$, it should use the function this->GetScaledValue( $y$) instead of the GetValue method. Similar for the derivative.

Typically, in StartOptimization() the following line should be present:
this->SetCurrentPosition(this->GetInitialPosition);
This makes sure that the initial position $y_0 = x_0 \cdot s$, where $x_0$ is the initial (unscaled) position entered by the user.

Note that:

Definition at line 59 of file itkScaledSingleValuedNonLinearOptimizer.h.


Member Typedef Documentation

typedef NonLinearOptimizer::ScalesType itk::ScaledSingleValuedNonLinearOptimizer::ScalesType

Constructor & Destructor Documentation

itk::ScaledSingleValuedNonLinearOptimizer::ScaledSingleValuedNonLinearOptimizer ( ) [protected]

The constructor.

virtual itk::ScaledSingleValuedNonLinearOptimizer::~ScaledSingleValuedNonLinearOptimizer ( ) [inline, protected, virtual]

The destructor.

Definition at line 129 of file itkScaledSingleValuedNonLinearOptimizer.h.

itk::ScaledSingleValuedNonLinearOptimizer::ScaledSingleValuedNonLinearOptimizer ( const Self ) [private]

The private constructor.


Member Function Documentation

virtual const char* itk::ScaledSingleValuedNonLinearOptimizer::GetClassName ( ) const [virtual]
virtual const ParametersType& itk::ScaledSingleValuedNonLinearOptimizer::GetCurrentPosition ( void  ) const [virtual]

Get the current unscaled position: get the ScaledCurrentPosition and divide each element through its scale.

virtual bool itk::ScaledSingleValuedNonLinearOptimizer::GetMaximize ( ) const [virtual]
virtual const ScaledCostFunctionType* itk::ScaledSingleValuedNonLinearOptimizer::GetScaledCostFunction ( ) [virtual]

Get a pointer to the scaled cost function.

virtual const ParametersType& itk::ScaledSingleValuedNonLinearOptimizer::GetScaledCurrentPosition ( ) [virtual]

Get the current scaled position.

virtual void itk::ScaledSingleValuedNonLinearOptimizer::GetScaledDerivative ( const ParametersType parameters,
DerivativeType derivative 
) const [protected, virtual]

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

virtual MeasureType itk::ScaledSingleValuedNonLinearOptimizer::GetScaledValue ( const ParametersType parameters) const [protected, virtual]

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

virtual void itk::ScaledSingleValuedNonLinearOptimizer::GetScaledValueAndDerivative ( const ParametersType parameters,
MeasureType value,
DerivativeType derivative 
) const [protected, virtual]

Same procedure as in GetValue and GetDerivative.

bool itk::ScaledSingleValuedNonLinearOptimizer::GetUseScales ( void  ) const
virtual void itk::ScaledSingleValuedNonLinearOptimizer::InitializeScales ( void  ) [virtual]

Configure the scaled cost function. This function sets the current scales in the ScaledCostFunction. NB: it assumes that the scales entered by the user are the squared scales (following the ITK convention). Call this method in StartOptimization() and after entering new scales.

virtual void itk::ScaledSingleValuedNonLinearOptimizer::MaximizeOff ( ) [virtual]
virtual void itk::ScaledSingleValuedNonLinearOptimizer::MaximizeOn ( ) [virtual]

Setting: set to 'true' if you want to maximize the cost function. It forces the scaledCostFunction to negate the cost function value and its derivative.

static Pointer itk::ScaledSingleValuedNonLinearOptimizer::New ( ) [static]
void itk::ScaledSingleValuedNonLinearOptimizer::operator= ( const Self ) [private]
void itk::ScaledSingleValuedNonLinearOptimizer::PrintSelf ( std::ostream &  os,
Indent  indent 
) const [protected]
virtual void itk::ScaledSingleValuedNonLinearOptimizer::SetCostFunction ( CostFunctionType costFunction) [virtual]

Setting: SetCostFunction.

virtual void itk::ScaledSingleValuedNonLinearOptimizer::SetCurrentPosition ( const ParametersType param) [protected, virtual]

Set the scaled current position by entering the non-scaled parameters. The method multiplies param by the scales and calls SetScaledCurrentPosition.

Note: It is not possible (and needed) anymore to set m_CurrentPosition. Optimizers that inherit from this class should optimize the scaled parameters!

This method will probably only be used to convert the InitialPosition entered by the user.

virtual void itk::ScaledSingleValuedNonLinearOptimizer::SetMaximize ( bool  _arg) [virtual]
virtual void itk::ScaledSingleValuedNonLinearOptimizer::SetScaledCurrentPosition ( const ParametersType parameters) [protected, virtual]

Set m_ScaledCurrentPosition.

virtual void itk::ScaledSingleValuedNonLinearOptimizer::SetUseScales ( bool  arg) [virtual]

Setting: Turn on/off the use of scales. Set this flag to false when no scaling is desired.


Field Documentation

Definition at line 186 of file itkScaledSingleValuedNonLinearOptimizer.h.

Definition at line 136 of file itkScaledSingleValuedNonLinearOptimizer.h.

Member variables.

Definition at line 135 of file itkScaledSingleValuedNonLinearOptimizer.h.

Variable to store the CurrentPosition, when the function GetCurrentPosition is called. This method needs a member variable, because the GetCurrentPosition return something by reference.

Definition at line 185 of file itkScaledSingleValuedNonLinearOptimizer.h.



Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo