Skip to content

shapeworks::ParticleShapeStatistics

More...

#include <ParticleShapeStatistics.h>

Public Functions

Name
ParticleShapeStatistics()
ParticleShapeStatistics(std::shared_ptr< Project > project)
~ParticleShapeStatistics()
int do_pca(std::vector< std::vector< Point > > global_pts, int domainsPerShape =1)
int do_pca(ParticleSystemEvaluation particleSystem, int domainsPerShape =1)
int import_points(std::vector< Eigen::VectorXd > points, std::vector< int > group_ids)
Loads a set of point files and pre-computes some statistics.
void compute_multi_level_analysis_statistics(std::vector< Eigen::VectorXd > points, unsigned int dps)
Loads a set of point files and pre-computes statistics for multi-level analysis.
int compute_shape_dev_modes_for_mca()
Compute shape variations for MLCA.
int compute_relative_pose_modes_for_mca()
Compute pose variations for MLCA.
void set_num_particles_per_domain(const std::vector< int > & num_particles_array)
Set number of particles per domain/object (required for multi-level analysis)
int read_point_files(const std::string & s)
Loads a set of point files and pre-computes some statistics.
int write_csv_file(const std::string & s)
Writes a text file in comma-separated format. Suitable for reading into excel or R or Matlab for analysis.
int compute_modes()
Computes PCA modes from the set of correspondence mode positions. Requires that ReadPointFiles be called first.
int get_num_modes() const
Return the number of modes.
int principal_component_projections()
int get_num_samples() const
Returns the sample size.
int get_group1_num_samples() const
int get_group2_num_samples() const
int get_num_dimensions() const
Returns the number of dimensions (this is number of points times Dimension)
int get_domains_per_shape()
Return Number of objects present in Multi-Object Shape Structure.
std::vector< int > NumberOfPointsArray()
Returns Number of Particles Array.
int GroupID(unsigned int i) const
Returns the group ids.
const std::vector< int > & GroupID() const
const Eigen::MatrixXd & get_eigen_vectors() const
Returns the eigenvectors/values.
const std::vector< double > & get_eigen_values() const
const Eigen::MatrixXd & get_eigenvectors_rel_pos()
Returns the eigenvectors/eigenvalues for morphological and relative pose pariations of MLCA.
const std::vector< double > & get_eigenvalues_shape_dev()
const Eigen::MatrixXd & get_eigenvectors_shape_dev()
const std::vector< double > & get_eigenvalues_rel_pose()
const Eigen::VectorXd & get_mean_shape_dev()
Returns the mean vector of within and between subspace.
const Eigen::VectorXd & get_mean_rel_pos()
const Eigen::VectorXd & get_mean() const
Returns the mean shape.
const Eigen::VectorXd & get_group1_mean() const
const Eigen::VectorXd & get_group2_mean() const
const Eigen::VectorXd & get_group_difference() const
Returns group2 - group1 mean.
int compute_median_shape(const int ID)
double l1_norm(unsigned int a, unsigned int b)
Returns the euclidean L1 norm between shape a and b.
Eigen::MatrixXd & get_pca_loadings()
Returns the component loadings.
const std::vector< double > & get_percent_variance_by_mode() const
Eigen::VectorXd get_compactness(const std::function< void(float)> & progress_callback =nullptr) const
Eigen::VectorXd get_specificity(const std::function< void(float)> & progress_callback =nullptr) const
Eigen::VectorXd get_generalization(const std::function< void(float)> & progress_callback =nullptr) const
Eigen::MatrixXd get_group1_matrix() const
Eigen::MatrixXd get_group2_matrix() const
Eigen::MatrixXd & matrix()
void set_num_values_per_particle(int value_per_particle)
Set the number of values for each particle (e.g. 3 for x/y/z, 4 for x/y/z/scalar)
int simple_linear_regression(const std::vector< double > & y, const std::vector< double > & x, double & a, double & b)

Detailed Description

class shapeworks::ParticleShapeStatistics;

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

Public Functions Documentation

function ParticleShapeStatistics

inline ParticleShapeStatistics()

function ParticleShapeStatistics

ParticleShapeStatistics(
    std::shared_ptr< Project > project
)

function ~ParticleShapeStatistics

inline ~ParticleShapeStatistics()

function do_pca

int do_pca(
    std::vector< std::vector< Point > > global_pts,
    int domainsPerShape =1
)

function do_pca

int do_pca(
    ParticleSystemEvaluation particleSystem,
    int domainsPerShape =1
)

function import_points

int import_points(
    std::vector< Eigen::VectorXd > points,
    std::vector< int > group_ids
)

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

function compute_multi_level_analysis_statistics

void compute_multi_level_analysis_statistics(
    std::vector< Eigen::VectorXd > points,
    unsigned int dps
)

Loads a set of point files and pre-computes statistics for multi-level analysis.

function compute_shape_dev_modes_for_mca

int compute_shape_dev_modes_for_mca()

Compute shape variations for MLCA.

function compute_relative_pose_modes_for_mca

int compute_relative_pose_modes_for_mca()

Compute pose variations for MLCA.

function set_num_particles_per_domain

void set_num_particles_per_domain(
    const std::vector< int > & num_particles_array
)

Set number of particles per domain/object (required for multi-level analysis)

function read_point_files

int read_point_files(
    const std::string & s
)

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

function write_csv_file

int write_csv_file(
    const std::string & s
)

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

function compute_modes

int compute_modes()

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

function get_num_modes

int get_num_modes() const

Return the number of modes.

function principal_component_projections

int principal_component_projections()

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

function get_num_samples

inline int get_num_samples() const

Returns the sample size.

function get_group1_num_samples

inline int get_group1_num_samples() const

function get_group2_num_samples

inline int get_group2_num_samples() const

function get_num_dimensions

inline int get_num_dimensions() const

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

function get_domains_per_shape

inline int get_domains_per_shape()

Return Number of objects present in Multi-Object Shape Structure.

function NumberOfPointsArray

inline std::vector< int > NumberOfPointsArray()

Returns Number of Particles Array.

function GroupID

inline int GroupID(
    unsigned int i
) const

Returns the group ids.

function GroupID

inline const std::vector< int > & GroupID() const

function get_eigen_vectors

inline const Eigen::MatrixXd & get_eigen_vectors() const

Returns the eigenvectors/values.

function get_eigen_values

inline const std::vector< double > & get_eigen_values() const

function get_eigenvectors_rel_pos

inline const Eigen::MatrixXd & get_eigenvectors_rel_pos()

Returns the eigenvectors/eigenvalues for morphological and relative pose pariations of MLCA.

function get_eigenvalues_shape_dev

inline const std::vector< double > & get_eigenvalues_shape_dev()

function get_eigenvectors_shape_dev

inline const Eigen::MatrixXd & get_eigenvectors_shape_dev()

function get_eigenvalues_rel_pose

inline const std::vector< double > & get_eigenvalues_rel_pose()

function get_mean_shape_dev

inline const Eigen::VectorXd & get_mean_shape_dev()

Returns the mean vector of within and between subspace.

function get_mean_rel_pos

inline const Eigen::VectorXd & get_mean_rel_pos()

function get_mean

inline const Eigen::VectorXd & get_mean() const

Returns the mean shape.

function get_group1_mean

inline const Eigen::VectorXd & get_group1_mean() const

function get_group2_mean

inline const Eigen::VectorXd & get_group2_mean() const

function get_group_difference

inline const Eigen::VectorXd & get_group_difference() const

Returns group2 - group1 mean.

function compute_median_shape

int compute_median_shape(
    const int ID
)

Returns the median shape for the set of shapes with Group ID equal to the integer argument. For example, compute_median_shape(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.*/

function l1_norm

double l1_norm(
    unsigned int a,
    unsigned int b
)

Returns the euclidean L1 norm between shape a and b.

function get_pca_loadings

inline Eigen::MatrixXd & get_pca_loadings()

Returns the component loadings.

function get_percent_variance_by_mode

inline const std::vector< double > & get_percent_variance_by_mode() const

function get_compactness

Eigen::VectorXd get_compactness(
    const std::function< void(float)> & progress_callback =nullptr
) const

function get_specificity

Eigen::VectorXd get_specificity(
    const std::function< void(float)> & progress_callback =nullptr
) const

function get_generalization

Eigen::VectorXd get_generalization(
    const std::function< void(float)> & progress_callback =nullptr
) const

function get_group1_matrix

Eigen::MatrixXd get_group1_matrix() const

function get_group2_matrix

Eigen::MatrixXd get_group2_matrix() const

function matrix

inline Eigen::MatrixXd & matrix()

function set_num_values_per_particle

inline void set_num_values_per_particle(
    int value_per_particle
)

Set the number of values for each particle (e.g. 3 for x/y/z, 4 for x/y/z/scalar)

function simple_linear_regression

static int simple_linear_regression(
    const std::vector< double > & y,
    const std::vector< double > & x,
    double & a,
    double & b
)

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.*/


Updated on 2024-03-17 at 12:58:44 -0600