Statismo  0.10.1
 All Classes Namespaces Functions Typedefs
Public Types | Public Member Functions | Static Public Member Functions | List of all members
statismo::PosteriorModelBuilder< T > Class Template Reference

Given a statistical model (prior) and a set of point constraints (likelihood), generate a new PCA model (posterior). More...

#include <PosteriorModelBuilder.h>

Inheritance diagram for statismo::PosteriorModelBuilder< T >:
Inheritance graph

Public Types

typedef Representer< T > RepresenterType
 
typedef ModelBuilder< T > Superclass
 
typedef Superclass::DataManagerType DataManagerType
 
typedef
Superclass::StatisticalModelType 
StatisticalModelType
 
typedef RepresenterType::ValueType ValueType
 
typedef RepresenterType::PointType PointType
 
typedef
StatisticalModelType::PointValueListType 
PointValueListType
 
typedef
DataManagerType::DataItemListType 
DataItemListType
 
typedef MatrixType PointCovarianceMatrixType
 
typedef
StatisticalModelType::PointValuePairType 
PointValuePairType
 
typedef std::pair
< PointValuePairType,
PointCovarianceMatrixType > 
PointValueWithCovariancePairType
 
typedef std::list
< PointValueWithCovariancePairType > 
PointValueWithCovarianceListType
 
- Public Types inherited from statismo::ModelBuilder< T >
typedef Representer< T > RepresenterType
 
typedef StatisticalModel< T > StatisticalModelType
 
typedef DataManager< T > DataManagerType
 
typedef
DataManagerType::DataItemListType 
DataItemListType
 

Public Member Functions

void Delete ()
 
virtual ~PosteriorModelBuilder ()
 
StatisticalModelTypeBuildNewModel (const DataItemListType &dataItemList, const PointValueListType &pointValues, double pointValueNoiseVariance, double noiseVariance) const
 
StatisticalModelTypeBuildNewModel (const DataItemListType &DataItemList, const PointValueWithCovarianceListType &pointValuesWithCovariance, double noiseVariance) const
 
StatisticalModelTypeBuildNewModelFromModel (const StatisticalModelType *model, const PointValueListType &pointValues, double pointValueNoiseVariance, bool computeScores=true) const
 
StatisticalModelTypeBuildNewModelFromModel (const StatisticalModelType *model, const PointValueWithCovarianceListType &pointValuesWithCovariance, bool computeScores=true) const
 
PointValueWithCovarianceListType TrivialPointValueWithCovarianceListWithUniformNoise (const PointValueListType &pointValues, double pointValueNoiseVariance) const
 

Static Public Member Functions

static PosteriorModelBuilderCreate ()
 

Additional Inherited Members

- Static Public Attributes inherited from statismo::ModelBuilder< T >
static const double TOLERANCE = 1e-5
 
- Protected Member Functions inherited from statismo::ModelBuilder< T >
MatrixType ComputeScores (const MatrixType &X, const StatisticalModelType *model) const
 
ModelInfo CollectModelInfo () const
 

Detailed Description

template<typename T>
class statismo::PosteriorModelBuilder< T >

Given a statistical model (prior) and a set of point constraints (likelihood), generate a new PCA model (posterior).

This class builds a StatisticalModel, just as PCAModelBuilder. However, in addition to the data, this model builder also takes as input a set of point constraints, i.e. known values for points. The resulting model will satisfy these constraints, and thus has a much lower variability than an unconstrained model would have.

For mathematical detailes see the paper Posterior Shape Models Thomas Albrecht, Marcel L ̈thi, Thomas Gerig, Thomas Vetter Medical Image Analysis 2013

Add method that allows for the use of the pointId in the constraint.

Constructor & Destructor Documentation

template<typename T>
virtual statismo::PosteriorModelBuilder< T >::~PosteriorModelBuilder ( )
inlinevirtual

destructor

Member Function Documentation

template<typename T >
PosteriorModelBuilder< T >::StatisticalModelType * statismo::PosteriorModelBuilder< T >::BuildNewModel ( const DataItemListType &  dataItemList,
const PointValueListType &  pointValues,
double  pointValueNoiseVariance,
double  noiseVariance 
) const

Builds a new model from the data provided in the dataManager, and the given constraints. This version of the function assumes a noise with a uniform uncorrelated variance of the form pointValueNoiseVariance * identityMatrix at every given point.

Parameters
DataItemListThe list holding the data the model is built from
pointValuesA list of (point, value) pairs with the known values.
pointValueNoiseVarianceThe variance of the estimated error at the known points (the pointValues)
noiseVarianceThe variance of the noise assumed on our data
Returns
a new statistical model
Warning
The returned model needs to be explicitly deleted by the user of this method.
template<typename T >
PosteriorModelBuilder< T >::StatisticalModelType * statismo::PosteriorModelBuilder< T >::BuildNewModel ( const DataItemListType &  DataItemList,
const PointValueWithCovarianceListType &  pointValuesWithCovariance,
double  noiseVariance 
) const

Builds a new model from the data provided in the dataManager, and the given constraints. For this version of the function, the covariance matrix of the noise needs to be specified for every point. These covariance matrices are passed in the pointValuesWithCovariance list.

Parameters
DataItemListThe list holding the data the model is built from
pointValuesWithCovarianceA list of ((point,value), covarianceMatrix) for each known value.
noiseVarianceThe variance of the noise assumed on our data
Returns
a new statistical model
Warning
The returned model needs to be explicitly deleted by the user of this method.
template<typename T >
PosteriorModelBuilder< T >::StatisticalModelType * statismo::PosteriorModelBuilder< T >::BuildNewModelFromModel ( const StatisticalModelType model,
const PointValueListType &  pointValues,
double  pointValueNoiseVariance,
bool  computeScores = true 
) const

Builds a new StatisticalModel given a StatisticalModel and the given constraints. If we interpret the given model as a prior distribution over the modeled objects, the resulting model can (loosely) be interpreted as the posterior distribution, after having observed the data given in the PointValues. This version of the function assumes a noise with a uniform uncorrelated variance of the form pointValueNoiseVariance * identityMatrix at every given point.

Parameters
modelA statistical model.
pointValuesA list of (point, value) pairs with the known values.
pointValueNoiseVarianceThe variance of the estimated error at the known points (the pointValues)
computeScoresDetermines whether the scores are computed and stored in the model.
Returns
a new statistical model
Warning
The returned model needs to be explicitly deleted by the user of this method.
template<typename T >
PosteriorModelBuilder< T >::StatisticalModelType * statismo::PosteriorModelBuilder< T >::BuildNewModelFromModel ( const StatisticalModelType model,
const PointValueWithCovarianceListType &  pointValuesWithCovariance,
bool  computeScores = true 
) const

Builds a new StatisticalModel given a StatisticalModel and the given constraints. If we interpret the given model as a prior distribution over the modeled objects, the resulting model can (loosely) be interpreted as the posterior distribution, after having observed the data given in the PointValues. For this version of the function, the covariance matrix of the noise needs to be specified for every point. These covariance matrices are passed in the pointValuesWithCovariance list.

Parameters
modelA statistical model.
pointValuesWithCovarianceA list of ((point,value), covarianceMatrix) for each known value.
computeScoresDetermines whether the scores are computed and stored in the model.
Returns
a new statistical model
Warning
The returned model needs to be explicitly deleted by the user of this method.
template<typename T>
static PosteriorModelBuilder* statismo::PosteriorModelBuilder< T >::Create ( )
inlinestatic

Factory method to create a new PosteriorModelBuilder

Parameters
representerThe representer
template<typename T>
void statismo::PosteriorModelBuilder< T >::Delete ( )
inline

Destroy the object. The same effect can be achieved by deleting the object in the usual way using the c++ delete keyword.

template<typename T >
PosteriorModelBuilder< T >::PointValueWithCovarianceListType statismo::PosteriorModelBuilder< T >::TrivialPointValueWithCovarianceListWithUniformNoise ( const PointValueListType &  pointValues,
double  pointValueNoiseVariance 
) const

A convenience function to create a PointValueWithCovarianceList with uniform variance

Parameters
pointValuesA list of (point, value) pairs with the known values.
pointValueNoiseVarianceThe variance of the estimated error at the known points (the pointValues)
Returns
a PointValueWithCovarianceListType with the given uniform variance
Warning
The returned model needs to be explicitly deleted by the user of this method.

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