Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Member Functions | Protected Attributes
ParticleShapeStatistics< VDimension > Class Template Reference

#include <itkParticleShapeStatistics.h>

Public Member Functions

 itkStaticConstMacro (Dimension, unsigned int, VDimension)
 
int ImportPoints (std::vector< vnl_vector< double > > points)
 
int ReadPointFiles (const char *fname)
 
int ReloadPointFiles ()
 
int WriteCSVFile (const char *s)
 
int WriteCSVFile (const std::string &s)
 
int WriteCSVFile2 (const char *s)
 
int WriteCSVFile2 (const std::string &s)
 
int ComputeModes ()
 
int PrincipalComponentProjections ()
 
int FisherLinearDiscriminant (unsigned int)
 
int SampleSize () const
 
int Group1SampleSize () const
 
int Group2SampleSize () const
 
int NumberOfDimensions () const
 
int GroupID (unsigned int i) const
 
const std::vector< int > & GroupID () const
 
const vnl_matrix< double > & Eigenvectors () const
 
const vnl_vector< double > & Eigenvalues () const
 
const vnl_vector< double > & Mean () const
 
const vnl_vector< double > & Group1Mean () const
 
const vnl_vector< double > & Group2Mean () const
 
const vnl_vector< double > & NormalizedGroupDifference () const
 
const vnl_vector< double > & GroupDifference () const
 
int ComputeMedianShape (const int)
 
double L1Norm (unsigned int a, unsigned int b)
 
const vnl_matrix< double > & PCALoadings () const
 
const vnl_vector< double > & FishersLDA () const
 
const vnl_matrix< double > & ShapeMatrix () const
 
const vnl_vector< double > & Shape (unsigned int i) const
 
int SimpleLinearRegression (const std::vector< double > &y, const std::vector< double > &x, double &a, double &b) const
 

Protected Attributes

unsigned int m_numSamples1
 
unsigned int m_numSamples2
 
unsigned int m_numSamples
 
unsigned int m_domainsPerShape
 
unsigned int m_numDimensions
 
std::vector< int > m_groupIDs
 
vnl_matrix< double > m_pooled_covariance
 
vnl_matrix< double > m_eigenvectors
 
vnl_vector< double > m_eigenvalues
 
vnl_vector< double > m_mean
 
vnl_vector< double > m_mean1
 
vnl_vector< double > m_mean2
 
vnl_matrix< double > m_pointsMinusMean
 
vnl_matrix< double > m_shapes
 
vnl_matrix< double > m_projectedPMM1
 
vnl_matrix< double > m_projectedPMM2
 
vnl_vector< double > m_projectedMean1
 
vnl_vector< double > m_projectedMean2
 
std::vector< double > m_fishersProjection
 
std::vector< double > m_percentVarByMode
 
vnl_vector< double > m_fishersLD
 
int m_top95
 
vnl_matrix< double > m_principals
 
vnl_vector< double > m_groupdiff
 
vnl_vector< double > m_groupdiffnorm
 
std::vector< std::string > m_pointsfiles
 

Detailed Description

template<unsigned int VDimension = 3>
class ParticleShapeStatistics< VDimension >

This class computes various statistics for a set of correspondence positions and group ids.

Definition at line 38 of file itkParticleShapeStatistics.h.

Member Function Documentation

template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::ComputeMedianShape ( const int  )

Returns the median shape for the set of shapes with Group ID equal to the integer argument. For example, ComputeMedianShape(0) returns the median shape for the set of shapes with m_groupIDs == 0. The median shape is defined as the shape with the minimum sum of Euclidean L1 norms to all other shapes in that group. Arguments passed to this function are set to the index number of the median shape for Group A and Group B, respectively.

template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::ComputeModes ( )

Computes PCA modes from the set of correspondence mode positions. Requires that ReadPointFiles be called first.

template<unsigned int VDimension = 3>
const vnl_matrix<double>& ParticleShapeStatistics< VDimension >::Eigenvectors ( ) const
inline

Returns the eigenvectors/values.

Definition at line 96 of file itkParticleShapeStatistics.h.

97  { return m_eigenvectors; }
template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::FisherLinearDiscriminant ( unsigned  int)

Computes fishers linear discriminant line for best group separation.

template<unsigned int VDimension = 3>
const vnl_vector<double>& ParticleShapeStatistics< VDimension >::FishersLDA ( ) const
inline

Returns the Fisher linear discriminant

Definition at line 132 of file itkParticleShapeStatistics.h.

133  { return m_fishersLD; }
template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::GroupID ( unsigned int  i) const
inline

Returns the group ids

Definition at line 90 of file itkParticleShapeStatistics.h.

91  { return m_groupIDs[i]; }
template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::ImportPoints ( std::vector< vnl_vector< double > >  points)

Loads a set of point files and pre-computes some statistics.

template<unsigned int VDimension = 3>
ParticleShapeStatistics< VDimension >::itkStaticConstMacro ( Dimension  ,
unsigned  int,
VDimension   
)

Dimensionality of the domain of the particle system.

template<unsigned int VDimension = 3>
double ParticleShapeStatistics< VDimension >::L1Norm ( unsigned int  a,
unsigned int  b 
)

Returns the euclidean L1 norm between shape a and b

template<unsigned int VDimension = 3>
const vnl_vector<double>& ParticleShapeStatistics< VDimension >::Mean ( ) const
inline

Returns the mean shape.

Definition at line 102 of file itkParticleShapeStatistics.h.

103  { return m_mean; }
template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::NumberOfDimensions ( ) const
inline

Returns the number of dimensions (this is number of points times Dimension)

Definition at line 86 of file itkParticleShapeStatistics.h.

87  { return m_numDimensions; }
template<unsigned int VDimension = 3>
const vnl_matrix<double>& ParticleShapeStatistics< VDimension >::PCALoadings ( ) const
inline

Returns the component loadings

Definition at line 128 of file itkParticleShapeStatistics.h.

129  { return m_principals; }
template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::PrincipalComponentProjections ( )

Computes the principal component loadings, or projections onto the principal componenent axes for each of the samples. ComputeModes must be called first.

template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::ReadPointFiles ( const char *  fname)

Loads a set of point files and pre-computes some statistics.

template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::ReloadPointFiles ( )

Reloads a set of point files and recomputes some statistics.

template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::SampleSize ( ) const
inline

Returns the sample size.

Definition at line 78 of file itkParticleShapeStatistics.h.

79  { return m_numSamples; }
template<unsigned int VDimension = 3>
const vnl_matrix<double>& ParticleShapeStatistics< VDimension >::ShapeMatrix ( ) const
inline

Returns the shape matrix

Definition at line 136 of file itkParticleShapeStatistics.h.

137  {return m_shapes; }
template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::SimpleLinearRegression ( const std::vector< double > &  y,
const std::vector< double > &  x,
double &  a,
double &  b 
) const

Computes a simple linear regression of the first list of values with respect to the second y=a + bx. Returns the estimated parameters a & b. Returns 0 on success and -1 on fail.

template<unsigned int VDimension = 3>
int ParticleShapeStatistics< VDimension >::WriteCSVFile ( const char *  s)

Writes a text file in comma-separated format. Suitable for reading into excel or R or Matlab for analysis.


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