My Project
C2DTransformation Class Referenceabstract

This is the generic base class for 2D transformations. More...

#include <mia/2d/transform.hh>

Inheritance diagram for C2DTransformation:
[legend]
Collaboration diagram for C2DTransformation:
[legend]

Data Structures

class  const_iterator
class  iterator_impl
 Base of the implementation of an iterator over the transformation domain This iterator takes care of iterating over the transformation range. X is the fastest changing index. Some methods are abstract and must be defined in derived classes by using the specific transformation model. More...

Public Types

typedef C2DImage Data
 generic name for the data used by this transformation
typedef C2DInterpolatorFactory InterpolatorFactory
 generic name for the interpolation factory used by this transformation
typedef std::shared_ptr< C2DTransformationPointer
 pointer type of this transformation
typedef C2DBounds Size
 generic name for the size type used by this transformation
typedef C2DTransformation type
 generic name for this transformation type
typedef C2DFVector Vector
 generic name for the vector type used by this transformation
Public Types inherited from Transformation< C2DImage, C2DInterpolatorFactory >
typedef C2DImage Data
 typedef for the data type to be transformed by this transformation
typedef C2DInterpolatorFactory InterpolatorFactory
 type of the interpolator used by this transformation

Public Member Functions

virtual C2DFVector apply (const C2DFVector &x) const __attribute__((deprecated))
virtual const_iterator begin () const =0
 C2DTransformation (const C2DInterpolatorFactory &ipf)
virtual C2DTransformationclone () const __attribute__((warn_unused_result))
virtual size_t degrees_of_freedom () const =0
virtual C2DFMatrix derivative_at (const C2DFVector &x) const =0
virtual C2DFMatrix derivative_at (int x, int y) const =0
virtual const_iterator end () const =0
const std::string & get_creator_string () const
virtual C2DFVector get_displacement_at (const C2DFVector &x) const =0
virtual float get_jacobian (const C2DFVectorfield &v, float delta) const =0
virtual float get_max_transform () const =0
virtual C2DBounds get_minimal_supported_image_size () const
virtual CDoubleVector get_parameters () const =0
virtual const C2DBoundsget_size () const =0
virtual C2DTransformationinvert () const __attribute__((warn_unused_result))=0
virtual C2DFVector operator() (const C2DFVector &x) const =0
virtual float pertuberate (C2DFVectorfield &v) const =0
virtual bool refine ()
void set_creator_string (const std::string &s)
virtual void set_identity ()=0
virtual void set_parameters (const CDoubleVector &params)=0
virtual void translate (const C2DFVectorfield &gradient, CDoubleVector &params) const =0
virtual void update (float step, const C2DFVectorfield &a)=0
Pointer upscale (const C2DBounds &size) const
Public Member Functions inherited from Transformation< C2DImage, C2DInterpolatorFactory >
double get_energy_penalty () const
double get_energy_penalty_and_gradient (CDoubleVector &gradient) const
bool has_energy_penalty () const
std::shared_ptr< C2DImageoperator() (const C2DImage &input) const
void set_interpolator_factory (const C2DInterpolatorFactory &ipf)
 Transformation (const C2DInterpolatorFactory &ipf)
virtual ~Transformation ()
Public Member Functions inherited from CIOData
const std::string & get_source_format () const
void set_source_format (const std::string &format)
 CAttributedData ()
 CAttributedData (const CAttributedData &org)
 CAttributedData (PAttributeMap attr)
CAttributedDataoperator= (const CAttributedData &org)
 Assignemt operator.
const PAttribute get_attribute (const std::string &key) const
CAttributeMap::const_iterator begin_attributes () const
CAttributeMap::const_iterator end_attributes () const
void set_attribute (const std::string &key, PAttribute attr)
void set_attributes (CAttributeMap::const_iterator begin, CAttributeMap::const_iterator end)
void set_attribute (const std::string &key, const std::string &value)
template<typename T>
void set_attribute (const std::string &key, const T &value)
void set_attribute (const std::string &key, const char *value)
const std::string get_attribute_as_string (const std::string &key) const
 returns the requested attribute as string, returns an empty string if attribute doesn't exist
template<typename T>
const T get_attribute_as (const std::string &key) const
template<typename T>
const T get_attribute_as (const std::string &key, T default_value) const
void delete_attribute (const std::string &key)
bool has_attribute (const std::string &key) const
void print (std::ostream &os) const

Static Public Attributes

static const char * data_descr
 plug-in search path element "type"
static const char * dim_descr
 plug-in search path element "data"
static constexpr const char * input_spacing_attr = "in-pixel-spacing"
static constexpr const char * output_spacing_attr = "out-pixel-spacing"
Static Public Attributes inherited from Transformation< C2DImage, C2DInterpolatorFactory >
static const char * type_descr
 interface type for plugin implementation and search

Additional Inherited Members

Protected Member Functions inherited from Transformation< C2DImage, C2DInterpolatorFactory >
const C2DInterpolatorFactoryget_interpolator_factory () const

Detailed Description

This is the generic base class for 2D transformations.

This class defines the generic interface for a 2D transformation. Most methods are pure abstract and need to be implemented by a "real" transformation. Actual implementations are provided as plug-ins.

Definition at line 45 of file 2d/transform.hh.

Member Typedef Documentation

◆ Data

generic name for the data used by this transformation

Definition at line 49 of file 2d/transform.hh.

◆ InterpolatorFactory

generic name for the interpolation factory used by this transformation

Definition at line 58 of file 2d/transform.hh.

◆ Pointer

typedef std::shared_ptr<C2DTransformation > C2DTransformation::Pointer

pointer type of this transformation

Definition at line 64 of file 2d/transform.hh.

◆ Size

generic name for the size type used by this transformation

Definition at line 52 of file 2d/transform.hh.

◆ type

generic name for this transformation type

Definition at line 61 of file 2d/transform.hh.

◆ Vector

generic name for the vector type used by this transformation

Definition at line 55 of file 2d/transform.hh.

Constructor & Destructor Documentation

◆ C2DTransformation()

C2DTransformation::C2DTransformation ( const C2DInterpolatorFactory & ipf)

Standard constructor place holder

Referenced by clone(), get_minimal_supported_image_size(), and invert().

Member Function Documentation

◆ apply()

virtual C2DFVector C2DTransformation::apply ( const C2DFVector & x) const
inlinevirtual
Returns
the displacement at coordinate x
Remarks
rename the function to something that explains better whats going on

Definition at line 344 of file 2d/transform.hh.

References apply(), and get_displacement_at().

Referenced by apply().

◆ begin()

virtual const_iterator C2DTransformation::begin ( ) const
pure virtual
Returns
the start iterator of the transformation that iterates over the grid of the area the ransformation is defined on

References begin().

Referenced by begin().

◆ clone()

virtual C2DTransformation * C2DTransformation::clone ( ) const
virtual
Returns
a newly allocated copy of the actual transformation

References C2DTransformation().

◆ degrees_of_freedom()

virtual size_t C2DTransformation::degrees_of_freedom ( ) const
pure virtual
Returns
the number of free parameters this transformation provides

References degrees_of_freedom().

Referenced by degrees_of_freedom().

◆ derivative_at() [1/2]

virtual C2DFMatrix C2DTransformation::derivative_at ( const C2DFVector & x) const
pure virtual

evaluate the derivative (Jacobian matrix) of the transformation at the given coordinate

Parameters
x
Returns
2x2 matrix of the derivative

References derivative_at().

Referenced by derivative_at(), and derivative_at().

◆ derivative_at() [2/2]

virtual C2DFMatrix C2DTransformation::derivative_at ( int x,
int y ) const
pure virtual

evaluate the derivative (Jacobian matrix) of the transformation at the given grid coordinates

Parameters
x
y
Returns
2x2 matrix of the derivative

References derivative_at().

◆ end()

virtual const_iterator C2DTransformation::end ( ) const
pure virtual
Returns
the end iterator of the transformation that iterates over the grid of the area the ransformation is defined on

References end().

Referenced by end().

◆ get_creator_string()

const std::string & C2DTransformation::get_creator_string ( ) const
Returns
the description string used to create this transformations

◆ get_displacement_at()

virtual C2DFVector C2DTransformation::get_displacement_at ( const C2DFVector & x) const
pure virtual
Returns
the displacement at coordinate x

Referenced by apply().

◆ get_jacobian()

virtual float C2DTransformation::get_jacobian ( const C2DFVectorfield & v,
float delta ) const
pure virtual

Evaluate the Jacobian of the transformation when updated with vector field v by factor delta

Returns
Jacobian
Remarks
this only is used for fluid dynamics registration and should probably be moved elsewhere

◆ get_max_transform()

virtual float C2DTransformation::get_max_transform ( ) const
pure virtual
Returns
the (approximate) maximum absolute translation of the transformation over the whole domain

References get_max_transform().

Referenced by get_max_transform().

◆ get_minimal_supported_image_size()

virtual C2DBounds C2DTransformation::get_minimal_supported_image_size ( ) const
virtual
Returns
the minimal image size that makes sense for the transformation. Usually this is (1,1), but for spline based transformation the image must be larger.

References C2DTransformation().

◆ get_parameters()

virtual CDoubleVector C2DTransformation::get_parameters ( ) const
pure virtual
Returns
the transformation parameters as a flat value array

References get_parameters().

Referenced by get_parameters().

◆ get_size()

virtual const C2DBounds & C2DTransformation::get_size ( ) const
pure virtual

A transformation is defined on [0,X-1]x[0.Y-1].

Returns
the upper boundaries (X,Y) of this range

References get_size().

Referenced by get_size().

◆ invert()

virtual C2DTransformation * C2DTransformation::invert ( ) const
pure virtual
Returns
a the inverse transform

References C2DTransformation(), and invert().

Referenced by invert().

◆ operator()()

virtual C2DFVector C2DTransformation::operator() ( const C2DFVector & x) const
pure virtual

apply the actual transformation to point x

Returns
transformed point

◆ pertuberate()

virtual float C2DTransformation::pertuberate ( C2DFVectorfield & v) const
pure virtual

evaluate the pertuberation of a vectorfield combined with this transformation

Parameters
[in,out]vvectorfield to be pertuberated
Returns
maximum value of the pertuberation
Remarks
this makes only sense for fluid dynamics registration and should be handled elsewhere

References pertuberate().

Referenced by pertuberate().

◆ refine()

virtual bool C2DTransformation::refine ( )
virtual

If applicaple the transformation model is refined (e.g. splines are converted to a denser coefficient distribution.

Returns
true if refinement was applied, and false otherwise

◆ set_creator_string()

void C2DTransformation::set_creator_string ( const std::string & s)

Set the descrition string that was used to create this transformstion

Parameters
s

◆ set_identity()

virtual void C2DTransformation::set_identity ( )
pure virtual

set the transformation to be the identity transform

References set_identity().

Referenced by set_identity().

◆ set_parameters()

virtual void C2DTransformation::set_parameters ( const CDoubleVector & params)
pure virtual

sets the transformation parameters from a flat value array

References set_parameters().

Referenced by set_parameters().

◆ translate()

virtual void C2DTransformation::translate ( const C2DFVectorfield & gradient,
CDoubleVector & params ) const
pure virtual

Translate the input gradient to a vector field in the space of the transformation field

Remarks
this is too specialized and needs to be replaced by something

References translate().

Referenced by translate().

◆ update()

virtual void C2DTransformation::update ( float step,
const C2DFVectorfield & a )
pure virtual

update a transformation by using a vector field

Remarks
this is too specialized and should go away

References update().

Referenced by update().

◆ upscale()

Pointer C2DTransformation::upscale ( const C2DBounds & size) const

Transforation upscaling to new image size

Parameters
sizenew size of the transformation
Returns
shared pointer to upscaled transformation

References upscale().

Referenced by upscale().

Field Documentation

◆ data_descr

const char* C2DTransformation::data_descr
static

plug-in search path element "type"

Definition at line 67 of file 2d/transform.hh.

◆ dim_descr

const char* C2DTransformation::dim_descr
static

plug-in search path element "data"

Definition at line 70 of file 2d/transform.hh.

◆ input_spacing_attr

const char* C2DTransformation::input_spacing_attr = "in-pixel-spacing"
staticconstexpr

This attribute defines the voxel spacing of the input data of this transform.

Definition at line 378 of file 2d/transform.hh.

◆ output_spacing_attr

const char* C2DTransformation::output_spacing_attr = "out-pixel-spacing"
staticconstexpr

This attribute defines the output voxel spacing of this transform.

Definition at line 383 of file 2d/transform.hh.


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