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

#include <PiecewiseLinearMap.h>

Inheritance diagram for mirtk::PiecewiseLinearMap:
Inheritance graph
Collaboration diagram for mirtk::PiecewiseLinearMap:
Collaboration graph

Public Member Functions

virtual void BoundingBox (double &x1, double &y1, double &z1, double &x2, double &y2, double &z2) const
 
vtkSmartPointer< vtkDataSet > Codomain () const
 
virtual bool Evaluate (double *v, double x, double y, double z=0) const
 
virtual double Evaluate (double x, double y, double z=0, int l=0) const
 
void GetPoint (int i, double &x, double &y) const
 
void GetPoint (int i, double &x, double &y, double &z) const
 
void GetPoint (int i, double p[3]) const
 
void GetValue (int i, double *v) const
 
virtual void Initialize ()
 Initialize map after inputs and parameters are set.
 
virtual MappingNewCopy () const
 Make deep copy of this volumetric map.
 
virtual int NumberOfComponents () const
 Dimension of codomain, i.e., number of output values.
 
int NumberOfPoints () const
 Number of discrete points at which map values are given.
 
PiecewiseLinearMapoperator= (const PiecewiseLinearMap &)
 Assignment operator.
 
 PiecewiseLinearMap ()
 Default constructor.
 
 PiecewiseLinearMap (const PiecewiseLinearMap &)
 Copy constructor.
 
class Point Point (int i) const
 
virtual bool Read (const char *)
 Read map from file.
 
double Value (int i, int l=0) const
 
virtual bool Write (const char *) const
 Write map to file.
 
virtual ~PiecewiseLinearMap ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Mapping
ImageAttributes Attributes (int nx, int ny=0, int nz=0) const
 
ImageAttributes Attributes (double dx=.0, double dy=.0, double dz=.0) const
 
void BoundingBox (double &x1, double &y1, double &x2, double &y2) const
 
void BoundingBox (double bounds[6]) const
 
void BoundingBox (Point &p1, Point &p2) const
 
bool Evaluate (double *v, const double p[3]) const
 
bool Evaluate (double *v, const Point &p) const
 
double Evaluate (const double p[3], int l=0) const
 
double Evaluate (const Point &, int l=0) const
 
virtual void Evaluate (GenericImage< float > &f, int l=0, vtkSmartPointer< vtkPointSet > m=nullptr) const
 
virtual void Evaluate (GenericImage< double > &f, int l=0, vtkSmartPointer< vtkPointSet > m=nullptr) const
 
virtual int NumberOfArguments () const
 Dimension of map domain.
 
virtual ~Mapping ()
 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::Mapping
static MappingNew (const char *)
 Read mapping from file.
 
- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Protected Member Functions inherited from mirtk::Mapping
 Mapping ()
 Default constructor.
 
 Mapping (const Mapping &)
 Copy constructor.
 
Mappingoperator= (const Mapping &)
 Assignment operator.
 
virtual void ReadMap (Cifstream &)
 Read map attributes and parameters from file stream.
 
virtual void WriteMap (Cofstream &) const
 Write map attributes and parameters to file stream.
 
- 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

Piecewise linear map defined at mesh nodes

This map is defined by its values at discrete mesh nodes. Intermediate values are interpolated using the weights of the respective mesh cell which this point belongs to. If the point is not contained in any mesh cell, the point is mapped to a constant outside value.

A surface map is commonly represented by the texture coordinates of a triangular surface mesh, while a tetrahedral mesh is commonly used to parameterize a volumetric map. These maps are usually computed using a finite element method (FEM).

Definition at line 48 of file PiecewiseLinearMap.h.

Member Function Documentation

§ BoundingBox()

virtual void mirtk::PiecewiseLinearMap::BoundingBox ( double &  x1,
double &  y1,
double &  z1,
double &  x2,
double &  y2,
double &  z2 
) const
virtual

Get minimum axes-aligned bounding box of map domain

Parameters
[out]x1Lower bound of map domain along x axis.
[out]y1Lower bound of map domain along y axis.
[out]z1Lower bound of map domain along z axis.
[out]x2Upper bound of map domain along x axis.
[out]y2Upper bound of map domain along y axis.
[out]z2Upper bound of map domain along z axis.

Implements mirtk::Mapping.

§ Codomain()

vtkSmartPointer<vtkDataSet> mirtk::PiecewiseLinearMap::Codomain ( ) const

Mesh discretizing the map domain with mapped mesh points

Note
Use this function only when the dimension of the codomain is 2 or 3.
See also
NumberOfComponents.
Returns
Mesh discretizing the codomain of the map, where the mesh points correspond to the unmapped points of the map domain mesh or nullptr when the dimension of the codomain is not 2 or 3.

§ Evaluate() [1/2]

virtual bool mirtk::PiecewiseLinearMap::Evaluate ( double *  v,
double  x,
double  y,
double  z = 0 
) const
virtual

Evaluate map at a given point

Parameters
[out]vMap value.
[in]xCoordinate of point along x axis at which to evaluate map.
[in]yCoordinate of point along y axis at which to evaluate map.
[in]zCoordinate of point along z axis at which to evaluate map.
Returns
Whether input point is inside map domain.

Implements mirtk::Mapping.

§ Evaluate() [2/2]

virtual double mirtk::PiecewiseLinearMap::Evaluate ( double  x,
double  y,
double  z = 0,
int  l = 0 
) const
virtual

Evaluate map at a given point

Parameters
[in]xCoordinate of point along x axis at which to evaluate map.
[in]yCoordinate of point along y axis at which to evaluate map.
[in]zCoordinate of point along z axis at which to evaluate map.
[in]lIndex of map value component.
Returns
The l-th component of the map value evaluate at the given point or the OutsideValue when input point is outside the map domain.

Reimplemented from mirtk::Mapping.

§ GetPoint() [1/3]

void mirtk::PiecewiseLinearMap::GetPoint ( int  i,
double &  x,
double &  y 
) const
inline

Get i-th domain mesh point

Parameters
[in]iPoint index.
[out]xPoint coordinate along x axis.
[out]yPoint coordinate along y axis.

Definition at line 231 of file PiecewiseLinearMap.h.

§ GetPoint() [2/3]

void mirtk::PiecewiseLinearMap::GetPoint ( int  i,
double &  x,
double &  y,
double &  z 
) const
inline

Get i-th domain mesh point

Parameters
[in]iPoint index.
[out]xPoint coordinate along x axis.
[out]yPoint coordinate along y axis.
[out]zPoint coordinate along z axis.

Definition at line 239 of file PiecewiseLinearMap.h.

§ GetPoint() [3/3]

void mirtk::PiecewiseLinearMap::GetPoint ( int  i,
double  p[3] 
) const
inline

Get i-th domain mesh point

Parameters
[in]iPoint index.
[out]pPoint coordinates.

Definition at line 225 of file PiecewiseLinearMap.h.

§ GetValue()

void mirtk::PiecewiseLinearMap::GetValue ( int  i,
double *  v 
) const
inline

Evaluate map at a given mesh point

Parameters
[in]iPoint index.
[out]vMap value.

Definition at line 255 of file PiecewiseLinearMap.h.

§ Point()

Point mirtk::PiecewiseLinearMap::Point ( int  i) const
inline

Get i-th domain mesh point

Parameters
[in]iPoint index.
Returns
Point coordinates.

Definition at line 247 of file PiecewiseLinearMap.h.

§ Value()

double mirtk::PiecewiseLinearMap::Value ( int  i,
int  l = 0 
) const
inline

Evaluate map at a given mesh point

Parameters
[in]iPoint index.
[in]lIndex of map value component.
Returns
The l-th component of the map value at the given mesh point.

Definition at line 261 of file PiecewiseLinearMap.h.


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