Public Member Functions | List of all members
mirtk::TransformationApproximationError Class Reference

#include <TransformationApproximationError.h>

Inheritance diagram for mirtk::TransformationApproximationError:
Inheritance graph
Collaboration diagram for mirtk::TransformationApproximationError:
Collaboration graph

Public Member Functions

void CenterPoints ()
 Subtract centroid from each point set.
 
virtual double Get (int i) const
 
virtual void Get (double *x) const
 
virtual void Gradient (double *dx, double step=.0, bool *sgn_chg=NULL)
 
virtual double GradientNorm (const double *dx) const
 
virtual int NumberOfDOFs () const
 
virtual void Put (const double *x)
 
virtual double Step (double *dx)
 
 TransformationApproximationError (class Transformation *, const double *, const double *, const double *, const double *, const double *, const double *, const double *, int)
 Constructor.
 
virtual void Update (bool gradient=true)
 
virtual double Value ()
 Evaluate objective function value.
 
virtual ~TransformationApproximationError ()
 Destructor.
 
- Public Member Functions inherited from mirtk::ObjectiveFunction
virtual void AddConstraintGradient (double *dx, double step=.0, bool *sgn_chg=nullptr)
 
virtual void DataFidelityGradient (double *dx, double step=.0, bool *sgn_chg=nullptr)
 
virtual double Evaluate (double *dx=NULL, double step=.0, bool *sgn_chg=NULL)
 
virtual void GradientStep (const double *dx, double &min, double &max) const
 
virtual bool Upgrade ()
 
virtual ~ObjectiveFunction ()=0
 Destructor.
 
- Public Member Functions inherited from mirtk::Observable
void AddObserver (Observer &)
 Add observer.
 
void Broadcast (Event, const void *=NULL)
 Broadcast event to observers.
 
void ClearObservers ()
 Delete all observers.
 
void DeleteObserver (Observer &)
 Delete observer.
 
void NotifyObservers (Event, const void *=NULL)
 Notify all observers about given event if this object has changed.
 
int NumberOfObservers () const
 Number of current observers.
 
virtual ~Observable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
virtual ParameterList Parameter () const
 Get parameter name/value pairs.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual bool Set (const char *name, const char *value)
 
virtual ~Object ()
 Destructor.
 

Additional Inherited Members

- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Protected Member Functions inherited from mirtk::ObjectiveFunction
 mirtkAttributeMacro (double, StepLength)
 Default step length used for gradient approximation.
 
- Protected Member Functions inherited from mirtk::Observable
 Observable ()
 Default constructor.
 
 Observable (const Observable &)
 Copy constructor.
 
Observableoperator= (const Observable &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 
- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Mean-squared-error of transformation approximation

This objective function is minimized by Transformation::ApproximateDOFs to find the transformation parameters which minimize the mean squared error of the approximation.

Definition at line 40 of file TransformationApproximationError.h.

Member Function Documentation

§ Get() [1/2]

virtual double mirtk::TransformationApproximationError::Get ( int  i) const
virtual

Get function parameter value

Parameters
[in]iFunction parameter (DoF) index.
Returns
Value of specified function parameter (DoF).

Implements mirtk::ObjectiveFunction.

§ Get() [2/2]

virtual void mirtk::TransformationApproximationError::Get ( double *  x) const
virtual

Get function parameter values

This function can be used to store a backup of the current funtion parameter values before an update such that these can be restored using the Put member function if the update did not result in the desired change of the overall objective function value.

Parameters
[in]xFunction parameter (DoF) values.

Implements mirtk::ObjectiveFunction.

§ Gradient()

virtual void mirtk::TransformationApproximationError::Gradient ( double *  dx,
double  step = .0,
bool *  sgn_chg = NULL 
)
virtual

Evaluate gradient of objective function w.r.t its DoFs

Parameters
[in]stepStep length for finite differences.
[out]dxGradient of objective function.
[out]sgn_chgWhether function parameter value is allowed to change sign when stepping along the computed gradient.

Implements mirtk::ObjectiveFunction.

§ GradientNorm()

virtual double mirtk::TransformationApproximationError::GradientNorm ( const double *  dx) const
virtual

Compute norm of gradient of objective function

This norm is used to define a unit for the step length used by gradient descent methods. It is, for example, the maximum absolute value norm for linear transformations and the maximum control point displacement for FFDs. The computation of the norm may be done after conjugating the gradient vector obtained using the Gradient member function.

Parameters
[in]dxGradient of objective function.

Implements mirtk::ObjectiveFunction.

§ NumberOfDOFs()

virtual int mirtk::TransformationApproximationError::NumberOfDOFs ( ) const
virtual

Get number of DoFs

Returns
Number of free function parameters.

Implements mirtk::ObjectiveFunction.

§ Put()

virtual void mirtk::TransformationApproximationError::Put ( const double *  x)
virtual

Set function parameter values

This is function can be used to set the parameters of the objective function to particular values. In particular, it can be used to restore the function parameters after a failed incremental update which did not result in the desired improvement.

Parameters
[in]xFunction parameter (DoF) values.

Implements mirtk::ObjectiveFunction.

§ Step()

virtual double mirtk::TransformationApproximationError::Step ( double *  dx)
virtual

Add change (i.e., scaled gradient) to each parameter value

This function updates each DoF of the objective function given a vector of corresponding changes, i.e., the computed gradient of the objective function w.r.t. these parameters or a desired change computed otherwise.

Parameters
[in]dxChange of each function parameter (DoF) as computed by the Gradient member function and scaled by a chosen step length.
Returns
Maximum change of function parameter.

Implements mirtk::ObjectiveFunction.

§ Update()

virtual void mirtk::TransformationApproximationError::Update ( bool  gradient = true)
virtual

Update internal state after change of parameters

Parameters
[in]gradientUpdate also internal state required for evaluation of gradient of objective function.

Reimplemented from mirtk::ObjectiveFunction.


The documentation for this class was generated from the following file: