MorphoGraphX  2.0-1-227
PCA.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef PCA_HPP
12 #define PCA_HPP
13 
14 #include <Process.hpp>
15 
16 #include <gsl/gsl_matrix.h>
17 #include <gsl/gsl_vector.h>
18 #include <gsl/gsl_eigen.h>
19 
20 namespace mgx
21 {
22 
23  // Class to calculate principle directions of cell to find plane of projection
24  class mgx_EXPORT PCA
25  {
26 
27  public:
28 
29  Point3f p1, p2, p3;
31  gsl_matrix *mat;
32  gsl_vector *eval;
33  gsl_matrix *evec;
34  gsl_eigen_symmv_workspace *w;
35 
36  PCA() : mat(gsl_matrix_alloc(3, 3)), eval(gsl_vector_alloc(3)),
37  evec(gsl_matrix_alloc(3, 3)), w(gsl_eigen_symmv_alloc(3)) {}
38 
39  ~PCA()
40  {
41  gsl_eigen_symmv_free(w);
42  gsl_vector_free(eval);
43  gsl_matrix_free(evec);
44  gsl_matrix_free(mat);
45  }
46 
47  bool operator()(const Matrix3f& corr);
48 
49  };
50 
51 
52 }
53 #endif
Process.hpp
mgx::PCA::eval
gsl_vector * eval
Definition: PCA.hpp:32
mgx::PCA::mat
gsl_matrix * mat
Definition: PCA.hpp:31
mgx::PCA::PCA
PCA()
Definition: PCA.hpp:36
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::PCA
Definition: PCA.hpp:24
mgx::PCA::p3
Point3f p3
Definition: PCA.hpp:29
mgx::Vector< 3, float >
mgx::PCA::~PCA
~PCA()
Definition: PCA.hpp:39
mgx::Matrix
Definition: Matrix.hpp:39
mgx::PCA::ev
Point3f ev
Definition: PCA.hpp:30
mgx::PCA::w
gsl_eigen_symmv_workspace * w
Definition: PCA.hpp:34
mgx::PCA::evec
gsl_matrix * evec
Definition: PCA.hpp:33