TMaskedCost< T, M, V > Class Template Referenceabstract

The generic cost function interface. More...

#include <mia/template/masked_cost.hh>

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

Public Types

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

Public Member Functions

double evaluate_force (const T &mov, const M &mask, V &force) const
 
void set_reference (const T &ref)
 
double value (const T &mov, const M &mask) const
 
virtual ~TMaskedCost ()
 ensure virtual destruction, since we have virtual functions More...
 
- 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 M, typename V>
class TMaskedCost< T, M, 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
    Tthe data type of the objects that the cost evaluation is based on
    Vthe type of the gradient force field created by this cost function

Definition at line 64 of file masked_cost.hh.

Member Typedef Documentation

◆ Data

template<typename T , typename M , typename V >
typedef T TMaskedCost< T, M, V >::Data

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

Definition at line 67 of file masked_cost.hh.

◆ Force

template<typename T , typename M , typename V >
typedef V TMaskedCost< T, M, V >::Force

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

Definition at line 73 of file masked_cost.hh.

◆ Mask

template<typename T , typename M , typename V >
typedef M TMaskedCost< T, M, V >::Mask

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

Definition at line 70 of file masked_cost.hh.

◆ PData

template<typename T , typename M , typename V >
typedef RData::Pointer TMaskedCost< T, M, V >::PData

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

Definition at line 79 of file masked_cost.hh.

◆ plugin_data

template<typename T , typename M , typename V >
typedef T TMaskedCost< T, M, V >::plugin_data

plugin searchpath helper type

Definition at line 82 of file masked_cost.hh.

◆ plugin_type

template<typename T , typename M , typename V >
typedef masked_cost_type TMaskedCost< T, M, V >::plugin_type

plugin searchpath helper type

Definition at line 85 of file masked_cost.hh.

◆ RData

template<typename T , typename M , typename V >
typedef TRefHolder<T> TMaskedCost< T, M, V >::RData

Const reference holder TRefHolder of the cost function data.

Definition at line 76 of file masked_cost.hh.

Constructor & Destructor Documentation

◆ ~TMaskedCost()

template<typename T , typename M , typename V >
virtual TMaskedCost< T, M, V >::~TMaskedCost ( )
virtual

ensure virtual destruction, since we have virtual functions

Member Function Documentation

◆ evaluate_force()

template<typename T , typename M , typename V >
double TMaskedCost< T, M, V >::evaluate_force ( const T &  mov,
const M &  mask,
V &  force 
) const

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

Parameters
movthe moving image
maskthe mask to be applied when evaluating the cost function
[out]forcegradient force
Returns
the cost function value

◆ set_reference()

template<typename T , typename M , typename V >
void TMaskedCost< T, M, 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 M , typename V >
double TMaskedCost< T, M, V >::value ( const T &  mov,
const M &  mask 
) const

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

Parameters
movthe moving image
maskthe mask to be applied when evaluating the cost function
Returns
the cost function value

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