GPA Class Reference
Generalised Procrustes Analysis.
More...
#include <gpa.h>
List of all members.
|
Public Member Functions |
| GPA (Matrix< double > *data=0, int individuals=0, int landmarks=0, int dimensions=0) |
virtual | ~GPA () |
| Destructor.
|
void | LoadData (Matrix< double > *data, int individuals, int landmarks, int dimensions) |
void | PerformGPA (int alignment=0, bool scale=true, bool rotate=true, bool translate=true, bool reflection=true) |
void | SetProcrustesDistanceMethod (int method) |
void | SetAlignment (int alignment) |
int | GetNumberOfSpecimens () |
int | GetNumberOfLandmarks () |
int | GetNumberOfDimensions () |
void | GetProcrustesMean (vector< vector< double > > *m) |
void | GetProcrustesMean (Matrix< double > *m) |
void | GetMeanAsComplex (vector< complex< double > > *m) |
void | GetProcrustesResiduals (int i, vector< vector< double > > *r) |
void | GetProcrustesResiduals (int i, Matrix< double > *r) |
void | GetProcrustesCoordinates (int i, Matrix< double > *proc, bool scale=false) |
void | GetProcrustesCoordinates (Matrix< double > *P, bool scale=false) |
void | GetCentroidSizes (vector< double > *c) |
void | GetSimilarityMatrix (int i, Matrix< double > *S) |
void | GetSimilarityMatrices (vector< Matrix< double > > *S) |
void | GetTransformationMatrix (int i, Matrix< double > *T) |
void | GetTransformationMatrices (vector< Matrix< double > > *T) |
double | GetProcrustesDistance (int i, int j, int method=0, bool formSpace=false) |
void | GetProcrustesDistances (Matrix< double > *dist, int method=0, bool formSpace=false) |
void | GetFormSpaceCoordinates (Matrix< double > *F) |
bool | IsCalculated () |
void | SetMaxIterations (int maxIterations) |
void | SetMinTolerance (double minTolerance) |
Static Public Attributes |
static const double | EPSILON = 1e-12 |
| A small number.
|
static const double | SQRT2 = 1.414213562373095 |
| The square root of two.
|
Detailed Description
Generalised Procrustes Analysis.
Constructor & Destructor Documentation
GPA::GPA |
( |
Matrix< double > * |
data = 0 , |
|
|
int |
individuals = 0 , |
|
|
int |
landmarks = 0 , |
|
|
int |
dimensions = 0 | |
|
) |
| | |
Constructor
- Parameters:
-
| data | the landmark coordinates |
| individuals | number of specimens |
| landmarks | number of landmarks |
| dimensions | number of dimensions (2 or 3) |
Member Function Documentation
void GPA::GetCentroidSizes |
( |
vector< double > * |
c |
) |
|
Get centroid sizes for all specimens
- Returns:
- vector of centroid sizes
void GPA::GetFormSpaceCoordinates |
( |
Matrix< double > * |
F |
) |
|
Get Form Space Coordinates
- Returns:
- A matrix with the procrustes coordinates and a column with ln of centroid size
void GPA::GetMeanAsComplex |
( |
vector< complex< double > > * |
m |
) |
|
Get Mean in the form of complex numbers
- Returns:
- mean shape in the form of complex numbers
int GPA::GetNumberOfDimensions |
( |
|
) |
|
Get number of dimensions
- Returns:
- the number of dimensions
int GPA::GetNumberOfLandmarks |
( |
|
) |
|
Get number of landmarks
- Returns:
- the number of landmarks
int GPA::GetNumberOfSpecimens |
( |
|
) |
|
Get number of specimens
- Returns:
- the number of specimens
void GPA::GetProcrustesCoordinates |
( |
Matrix< double > * |
P, |
|
|
bool |
scale = false | |
|
) |
| | |
Get procrustes coordinates for all specimens
- Parameters:
-
| scale | scale coordinates with cos(rho) to give Kendallīs shape space |
- Returns:
- procrustes coordinates for all specimen
void GPA::GetProcrustesCoordinates |
( |
int |
i, |
|
|
Matrix< double > * |
proc, |
|
|
bool |
scale = false | |
|
) |
| | |
Get procrustes coordinates
- Parameters:
-
| i | specimen |
| scale | scale coordinates with cos(rho) to give Kendallīs shape space |
- Returns:
- procrustes coordinates for specimen i
double GPA::GetProcrustesDistance |
( |
int |
i, |
|
|
int |
j, |
|
|
int |
method = 0 , |
|
|
bool |
formSpace = false | |
|
) |
| | |
Get Procrustes distances between two specimens
- Parameters:
-
| i | first specimen |
| j | second specimen |
| method | method used for calculation (see Dryden and Mardia 1998) if method is 1 then full Procrustes distance is used (eq. 4.15) if method is 2 then partial Procrustes distance is used (eq. 4.21) if method is 3 then Procrustes distance is used (eq. 4.22) otherwise euclidean distance is used (sum up the squares of the residuals and take the square root) |
| formSpace | if true then we return formspace distance |
void GPA::GetProcrustesDistances |
( |
Matrix< double > * |
dist, |
|
|
int |
method = 0 , |
|
|
bool |
formSpace = false | |
|
) |
| | |
Get Procrustes distance matrix between all specimens
- Parameters:
-
| method | method used for calculation (see Dryden and Mardia 1998) if method is 1 then full Procrustes distance is used (eq. 4.15) if method is 2 then partial Procrustes distance is used (eq. 4.21) if method is 3 then Procrustes distance is used (eq. 4.22) otherwise euclidean distance is used (sum up the squares of the residuals and take the square root) |
| formSpace | if true then we return formspace distance |
void GPA::GetProcrustesMean |
( |
Matrix< double > * |
m |
) |
|
Get Procrustes Mean
- Returns:
- mean shape of data
void GPA::GetProcrustesMean |
( |
vector< vector< double > > * |
m |
) |
|
Get Procrustes Mean
- Returns:
- mean shape of data
void GPA::GetProcrustesResiduals |
( |
int |
i, |
|
|
vector< vector< double > > * |
r | |
|
) |
| | |
Get Procrustes Residuals
- Parameters:
-
- Returns:
- the procrustes residuals for specimen i
void GPA::GetSimilarityMatrices |
( |
vector< Matrix< double > > * |
S |
) |
|
Get similarity matrices for all specimens
- Returns:
- similarity matrices for all specimens
void GPA::GetSimilarityMatrix |
( |
int |
i, |
|
|
Matrix< double > * |
S | |
|
) |
| | |
Get similarity matrix for specimen i
- Parameters:
-
- Returns:
- similarity matrix for specimen i
void GPA::GetTransformationMatrices |
( |
vector< Matrix< double > > * |
T |
) |
|
Get transformation matrices for all specimens
- Returns:
- transformation matrices for all specimens
void GPA::GetTransformationMatrix |
( |
int |
i, |
|
|
Matrix< double > * |
T | |
|
) |
| | |
Get transformation matrix for specimen i
- Parameters:
-
- Returns:
- transformation matrix for specimen i
bool GPA::IsCalculated |
( |
|
) |
|
Has GPA been performed
- Returns:
- true if GPA analysis has been performed on our data
void GPA::LoadData |
( |
Matrix< double > * |
data, |
|
|
int |
individuals, |
|
|
int |
landmarks, |
|
|
int |
dimensions | |
|
) |
| | |
LoadData
- Parameters:
-
| data | the landmark coordinates |
| individuals | number of specimens |
| landmarks | number of landmarks |
| dimensions | number of dimensions (2 or 3) |
void GPA::PerformGPA |
( |
int |
alignment = 0 , |
|
|
bool |
scale = true , |
|
|
bool |
rotate = true , |
|
|
bool |
translate = true , |
|
|
bool |
reflection = true | |
|
) |
| | |
Perform Generalised Procrustes Analysis
- Parameters:
-
| alignment | (0: use default, 1: align with principal axes, 2: align with first specimen) |
| scale | false if we want to keep scaling |
| rotate | false if we want to keep rotation |
| translate | false of we want to keep location |
| reflection | enable reflections |
void GPA::SetAlignment |
( |
int |
alignment |
) |
|
Set Alignment of procrustes coordinates
- Parameters:
-
| alignment | if alignment is 0 use default (principal axes) if alignment is 1 then align with principal axes if alignment is 2 then align with first specimen |
void GPA::SetProcrustesDistanceMethod |
( |
int |
method |
) |
|
Set method for calculating Procrustes distances
- Parameters:
-
| method | method used for calculation (see Dryden and Mardia 1998) if method is 1 then full Procrustes distance is used (eq. 4.15) if method is 2 then partial Procrustes distance is used (eq. 4.21) if method is 3 then Procrustes distance is used (eq. 4.22) otherwise euclidean distance is used (sum up the squares of the residuals and take the square root) |
The documentation for this class was generated from the following files:
- M:/evan/GMMlib/inc/gpa.h
- M:/evan/GMMlib/src/gpa.cpp