LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::activeShapeModel Class Reference

This is the base class for active shape models (ASM). More...

#include <ltiActiveShapeModel.h>

Inheritance diagram for lti::activeShapeModel:
Inheritance graph
[legend]
Collaboration diagram for lti::activeShapeModel:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class activeShapeModel More...

Public Member Functions

 activeShapeModel ()
 activeShapeModel (const activeShapeModel &other)
virtual ~activeShapeModel ()
virtual const char * getTypeName () const
activeShapeModelcopy (const activeShapeModel &other)
activeShapeModeloperator= (const activeShapeModel &other)
virtual functorclone () const
const parametersgetParameters () const
Transformation

Methods for transforming a shape from shape space to eigenspace and vice versa.

Eigenspace (w) -> shape space (x): x = eigenVectorMatrix * weightsVector + meanShape
Shape space (x) -> eigenspace (w): w = (eigenVectorMatrix)^T * (shape - meanShape)



void convertShapeToWeightsVector (const pointDistributionModel::shape &src, vector< double > &dest) const
void convertShapeToWeightsVector (const pointDistributionModel::shape &src, vector< double > &dest, const fvector &pointReliability) const
void convertWeightsVectorToShape (const vector< double > &src, pointDistributionModel::shape &dest) const
Comparison

Methods for comparing and aligning two shapes.



geometricTransform::parameters alignShape (pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape) const
geometricTransform::parameters alignShape (pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape, const fvector &pointReliability) const
float calculateShapeDifference (const pointDistributionModel::shape &firstShape, const pointDistributionModel::shape &secondShape) const
float calculateShapeDifference (const pointDistributionModel::shape &firstShape, const pointDistributionModel::shape &secondShape, const fvector &pointReliability) const
Properties

Methods for computing properties of one shape.



tpoint< float > calculateShapeCenter (const pointDistributionModel::shape &shape) const
tpoint< float > calculateShapeCenter (const pointDistributionModel::shape &shape, const fvector &pointReliability) const
float calculateShapeDistance (const pointDistributionModel::shape &shape, const tpoint< float > &thePoint=tpoint< float >(0.0f, 0.0f)) const
float calculateShapeDistance (const pointDistributionModel::shape &shape, const fvector &pointReliability, const tpoint< float > &thePoint=tpoint< float >(0.0f, 0.0f)) const
double calculateShapeOrientation (const pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape, const tpoint< float > &theCenter=tpoint< float >(0.0f, 0.0f)) const
double calculateShapeOrientation (const pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape, const fvector &pointReliability, const tpoint< float > &theCenter=tpoint< float >(0.0, 0.0)) const

Protected Member Functions

float calculateRelativeShapeScale (const pointDistributionModel::shape &shape, const pointDistributionModel::shape &referenceShape, const fvector &pointReliability, const tpoint< float > &shapeCenter=tpoint< float >(0.0, 0.0), const tpoint< float > &referenceShapeCenter=tpoint< float >(0.0, 0.0)) const
void trimShape (pointDistributionModel::shape &srcdest) const
void trimShape (pointDistributionModel::shape &srcdest, const fvector &pointReliability) const
void trimWeightsVector (vector< double > &srcdest) const
double calculateAngle (const tpoint< float > &thePoint) const
vector< double > buildVector (const pointDistributionModel::shape &src) const
pointDistributionModel::shape buildShape (const vector< double > &src) const
void createListOfNormals (const pointDistributionModel::shape &theShape, tpointList< float > &listOfNormals) const

Detailed Description

This is the base class for active shape models (ASM).

ASMs are deformable 2D-templates, that can align themselves to image features according to defined search strategies (see derived classes). The deformation is regularized (i.e. constrained) by an underlying PDM (pointDistributionModel).

This class provides the methods for aligning PDM shapes (pointDistributionModel::shape) and to correct invalid shapes to satisfy the restrictions of a given PDM. Furthermore, methods to obtain information about the position of a shape are provided. Shapes with weighted points (point reliabilities) are also supported.


Constructor & Destructor Documentation

lti::activeShapeModel::activeShapeModel (  ) 

default constructor

lti::activeShapeModel::activeShapeModel ( const activeShapeModel other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::activeShapeModel::~activeShapeModel (  )  [virtual]

destructor


Member Function Documentation

geometricTransform::parameters lti::activeShapeModel::alignShape ( pointDistributionModel::shape shape,
const pointDistributionModel::shape referenceShape,
const fvector pointReliability 
) const

align a given weighted shape to another.

Parameters:
shape shape to be aligned. the transformed shape will also be saved here.
referenceShape fixed shape to be aligned to
pointReliability vector containing reliability values between 0 (unreliable) and 1 (reliable) for all points
Returns:
geometric parameters that are used to re-transform shape
geometricTransform::parameters lti::activeShapeModel::alignShape ( pointDistributionModel::shape shape,
const pointDistributionModel::shape referenceShape 
) const

align a given shape to another.

note that the return geometricTransform::parameters describe the transformation from the referenceShape to the unaligned shape! this is done to align a given shape to a normalized shape and be able to easily project this normalized shape (e.g. meanShape) on the original shape.

Parameters:
shape shape to be aligned. the transformed shape will also be saved here.
referenceShape fixed shape to be aligned to
Returns:
geometric parameters that are used to re-transform shape
pointDistributionModel::shape lti::activeShapeModel::buildShape ( const vector< double > &  src  )  const [protected]

convert a vector [x1, y1, x2, y2, .

..] into a shape [(x1,y1),...]

vector<double> lti::activeShapeModel::buildVector ( const pointDistributionModel::shape src  )  const [protected]

convert the shape [(x1,y1),.

..] to a vector [x1, y1, x2, y2, ...]

double lti::activeShapeModel::calculateAngle ( const tpoint< float > &  thePoint  )  const [protected]

calculate angle between a point and the x-axis

float lti::activeShapeModel::calculateRelativeShapeScale ( const pointDistributionModel::shape shape,
const pointDistributionModel::shape referenceShape,
const fvector pointReliability,
const tpoint< float > &  shapeCenter = tpoint< float >(0.0, 0.0),
const tpoint< float > &  referenceShapeCenter = tpoint< float >(0.0, 0.0) 
) const [protected]

calculate reliability-weighted scaling factor

tpoint<float> lti::activeShapeModel::calculateShapeCenter ( const pointDistributionModel::shape shape,
const fvector pointReliability 
) const

calculate the center of a given shape.

all points of the shape are multiplied with their reliability factor, then summed, and the results divided by the sum of reliabilities.

tpoint<float> lti::activeShapeModel::calculateShapeCenter ( const pointDistributionModel::shape shape  )  const

calculate the center of a given shape.

all points of the shape are summed and the results divided by the number of points.

Returns:
center of the given shape
float lti::activeShapeModel::calculateShapeDifference ( const pointDistributionModel::shape firstShape,
const pointDistributionModel::shape secondShape,
const fvector pointReliability 
) const

calculate difference of two weighted shapes

float lti::activeShapeModel::calculateShapeDifference ( const pointDistributionModel::shape firstShape,
const pointDistributionModel::shape secondShape 
) const

calculate mean difference of two shapes, i.e.

the sum of squared distances of all corresponding points divided by the number of points

float lti::activeShapeModel::calculateShapeDistance ( const pointDistributionModel::shape shape,
const fvector pointReliability,
const tpoint< float > &  thePoint = tpoint< float >(0.0f, 0.0f) 
) const

calculate the mean distance of a given point to the reliability-weighted points of a shape

float lti::activeShapeModel::calculateShapeDistance ( const pointDistributionModel::shape shape,
const tpoint< float > &  thePoint = tpoint< float >(0.0f, 0.0f) 
) const

calculate the mean distance of a given point to the points of a shape

Returns:
average distance
double lti::activeShapeModel::calculateShapeOrientation ( const pointDistributionModel::shape shape,
const pointDistributionModel::shape referenceShape,
const fvector pointReliability,
const tpoint< float > &  theCenter = tpoint< float >(0.0, 0.0) 
) const

calculate the relative orientation difference of two shapes with regard to a given rotation center and given point reliabilities

double lti::activeShapeModel::calculateShapeOrientation ( const pointDistributionModel::shape shape,
const pointDistributionModel::shape referenceShape,
const tpoint< float > &  theCenter = tpoint< float >(0.0f, 0.0f) 
) const

calculate the relative orientation difference of two shapes, with regard to a given rotation center

Returns:
angle between referenceShape and shape
virtual functor* lti::activeShapeModel::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

Reimplemented in lti::gradientASM, and lti::skinASM.

void lti::activeShapeModel::convertShapeToWeightsVector ( const pointDistributionModel::shape src,
vector< double > &  dest,
const fvector pointReliability 
) const

convert a reliability-weighted shape to a weights vector, i.e.

project a shape into the pdm eigenspace Formula: w = (eigenVectorMatrix)^T * ((shape - meanShape) * reliabilities) Note: the shape is assumed to be aligned to position, size and rotation of meanShape!

Parameters:
src shape with the source data.
dest vector where the result will be left.
pointReliability vector containing point reliabilities.
void lti::activeShapeModel::convertShapeToWeightsVector ( const pointDistributionModel::shape src,
vector< double > &  dest 
) const

convert a shape to a weights vector, i.e.

project a shape into the pdm eigenspace

Formula: w = (eigenVectorMatrix)^T * (shape - meanShape)

Note: the shape is assumed to be aligned to position, size and rotation of meanShape!

Parameters:
src shape with the source data.
dest vector where the result will be left.
void lti::activeShapeModel::convertWeightsVectorToShape ( const vector< double > &  src,
pointDistributionModel::shape dest 
) const

convert a weights vector into a shape (i.e.

shape space) Formula: x = eigenVectorMatrix * weightsVector + meanShape

Parameters:
src vector with the source data.
dest shape where the result will be left.
activeShapeModel& lti::activeShapeModel::copy ( const activeShapeModel other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

Reimplemented in lti::gradientASM, and lti::skinASM.

void lti::activeShapeModel::createListOfNormals ( const pointDistributionModel::shape theShape,
tpointList< float > &  listOfNormals 
) const [protected]

create normals for each point

const parameters& lti::activeShapeModel::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

Reimplemented in lti::gradientASM, and lti::skinASM.

virtual const char* lti::activeShapeModel::getTypeName (  )  const [virtual]

returns the name of this type ("activeShapeModel")

Reimplemented from lti::functor.

Reimplemented in lti::gradientASM, and lti::skinASM.

activeShapeModel& lti::activeShapeModel::operator= ( const activeShapeModel other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

Reimplemented in lti::gradientASM, and lti::skinASM.

void lti::activeShapeModel::trimShape ( pointDistributionModel::shape srcdest,
const fvector pointReliability 
) const [protected]

convert reliability-weighted shape to weights vector, correct if invalid and convert back to shape space.

Parameters:
srcdest shape with the source data. The result will be left here too.
pointReliability the reliabilities of each point of the shape as value between 0.0 and 1.0
void lti::activeShapeModel::trimShape ( pointDistributionModel::shape srcdest  )  const [protected]

convert shape to weights vector, correct if invalid and convert back to shape space.

Parameters:
srcdest shape with the source data. The result will be left here too.
void lti::activeShapeModel::trimWeightsVector ( vector< double > &  srcdest  )  const [protected]

Correct weights vector according to varianceCoefficient.

all vector entries that are not in between -c*v and c*v, where c is the given varianceCoefficient and v is the variance of the corresponding dimension (eigenvector), are set to 0.0

Parameters:
srcdest vector<double> with the source data. The result will be left here too.

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

Generated on Sat Apr 10 15:27:01 2010 for LTI-Lib by Doxygen 1.6.1