Skip to content

harrymatthews50/python_shape_stats

Repository files navigation

python_shape_stats

A Python toolbox for statistical shape analysis of dense surface meshes. I have given several demo scripts for specific use cases. Feel free to make feature requests or suggest new demos. Consider contributing as a pull request.

Documentation

You can find the (evolving) project documentation on the project website.

Overview

With this toolbox you can:

Explore and model shape variation within a sample

See demos of principal components analysis and determining the number of principal components.

Assess covariation between structures

See demo of two-block partial least-squares.

Test statistical hypotheses

See demo of hypothesis testing using partial least-squares regression model, as first developed in this paper.

NOTE

It is required that all meshes be in correspondence prior to analysis. This is usually achieved through non-rigid mesh-to-mesh image registration (see Section 2.2 of this paper). If you have access to MATLAB (or can work with the C++ library directly) I recommend for this MeshMonk, introduced in this paper. If you have good experiences with other registration toolboxes please feel free to suggest them as a pull request.

Installation/quickstart

Follow these instructions to get started in under five minutes.

I suggest handling Python environments (in general) with Conda. Once you have conda installed. I would also install Git if you haven't already.

Clone the repository

The following clones the repository into the current folder by typing the following in the command prompt/terminal. This is the easiest way to have the scripts in 'demos' locally on your machine.

git clone https://github.com/harrymatthews50/python_shape_stats.git

Make the conda environment and install python shape stats.

On Linux or MacOS the following should be executed in the terminal. On Windows this needs to be done in the special 'Anaconda Prompt' that should have installed when you installed Conda.

conda create -n shape_stats
conda activate shape_stats
conda install pip
pip install python_shape_stats

Run a demo script to see if everything runs

Try to run one of the demo scripts in the 'demos' folder that will have downloaded when you cloned the repository. In the first instance try to run them directly from the terminal or Anaconda prompt (on Windows), with the shape_stats environment active. Close any plotting windows that open and see if the script runs to the end without errors. Note that you will need to change to wherever you have cloned the repo to.

conda activate shape_stats
python <path>/demos/2B_PLS.py

About

A Python toolbox for statistical shape analysis

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages