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 a feature requests or suggest new demos. Consider contributing your own as a pull request.
With this toolbox you can:
See demos of principal components analysis and determining the number of principal components.
See demo of two-block partial least-squares.
See demo of hypothesis testing using partial least-squares regression model, as first developed in this paper.
You can find the (evolving) project documentation on the project website.
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.
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.
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
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
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