TCost< T, V > Class Template Referenceabstract
Image Registration and Transformation

The generic cost function interface. More...

`#include <mia/core/cost.hh>`

Inheritance diagram for TCost< T, V >:
[legend]
Collaboration diagram for TCost< T, V >:
[legend]

## Public Types

typedef T | Data
| typedef for generic programming: The data type used by the cost function
typedef V | Force
| typedef for generic programming: The gradient forca type create by the cost function
typedef RData::Pointer | PData
| Pointer to const reference holder TRefHolder of the cost function data.
typedef T | plugin_data
| plugin searchpath helper type
typedef cost_type | plugin_type
| plugin searchpath helper type
typedef TRefHolder< T > | RData
| Const reference holder TRefHolder of the cost function data.
Public Types inherited from CPropertyFlagHolder
typedef std::set< const char * > | Set
| define the type of the set of flags

## Public Member Functions

double | evaluate_force (const T &src, V &force) const
void | set_reference (const T &ref)
double | value (const T &src) const
virtual | ~TCost ()
| ensure virtual destruction, since we have virtual functions
Public Member Functions inherited from CProductBase
const char * | get_init_string () const
void | set_init_string (const char *init)
void | set_module (PPluginModule module)
Public Member Functions inherited from CPropertyFlagHolder
void | add (const char *property)
Set | get_missing_properties (const CPropertyFlagHolder &testset) const
bool | has (const char *property) const
bool | has_all_in (const CPropertyFlagHolder &testset) const
virtual | ~CPropertyFlagHolder ()

## Detailed Description

template<typename T, typename V>
class TCost< T, V >

The generic cost function interface.

The class defines an abstract interface for a cost function between two entities of the same type. The pure virtual functions -double do_value(const T& a, const T& b) const, and -double do_evaluate_force(const T& a, const T& b, float scale, V& force) const have to be implemented in the derived class to make it a real cost function. The virtual function

- void post_set_reference(const T& ref) may be overwritten in order to prepare the reference data for the implemented cost function.
  Template Parameters

    T | the data type of the objects that the cost evaluation is based on
    V | the type of the gradient force field created by this cost function

Definition at line 64 of file core/cost.hh.

## Member Typedef Documentation

## Data

template<typename T, typename V>

typedef T TCost< T, V >::Data

typedef for generic programming: The data type used by the cost function

Definition at line 68 of file core/cost.hh.

## Force

template<typename T, typename V>

typedef V TCost< T, V >::Force

typedef for generic programming: The gradient forca type create by the cost function

Definition at line 71 of file core/cost.hh.

## PData

template<typename T, typename V>

typedef RData::Pointer TCost< T, V >::PData

Pointer to const reference holder TRefHolder of the cost function data.

Definition at line 77 of file core/cost.hh.

## plugin_data

template<typename T, typename V>

typedef T TCost< T, V >::plugin_data

plugin searchpath helper type

Definition at line 80 of file core/cost.hh.

## plugin_type

template<typename T, typename V>

typedef cost_type TCost< T, V >::plugin_type

plugin searchpath helper type

Definition at line 83 of file core/cost.hh.

## RData

template<typename T, typename V>

typedef TRefHolder<T> TCost< T, V >::RData

Const reference holder TRefHolder of the cost function data.

Definition at line 74 of file core/cost.hh.

## Constructor & Destructor Documentation

## ~TCost()

template<typename T, typename V>

virtual TCost< T, V >::~TCost | ( |  | ) |

virtual

ensure virtual destruction, since we have virtual functions

## Member Function Documentation

## evaluate_force()

template<typename T, typename V>

double TCost< T, V >::evaluate_force | ( | const T & | src,
|  | V & | force ) const

Evaluate the value of the cost function and its gradient with respect to the given src image and the reference that was set by calling set_reference(const T& ref).

Parameters

  | src |
  [out] | force | gradient force

Returns
  the cost function value

## set_reference()

template<typename T, typename V>

void TCost< T, V >::set_reference | ( | const T & | ref | ) |

Set the new reference of the cost function. The virtual private function post_set_reference(const T& ref) is then called to run possible preparations on the reference image.

## value()

template<typename T, typename V>

double TCost< T, V >::value | ( | const T & | src | ) | const

Evaluate the value of the cost function petreen the given src image and the reference that was set by calling set_reference(const T& ref).

Parameters

  src |

Returns
  the cost function value

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

- core/cost.hh