pyssam documentation

Welcome to the documentation for pyssam! This package aims to provide a lightweight and low-dependency option for statistical modelling in Python.

Main applications of this package include statistical shape and appearance modelling, which can be used to parameterise biomedical structures and quantify changes in these complex datasets across a population.

Getting Started

Installation

You can install pyssam with pip as

pip install pyssam

Several jupyter notebooks also exist, which require:

pip install matplotlib

To check the package is installed properly can be done by typing the following in a bash terminal

python -c "import pyssam ; print(pyssam.SSAM.__doc__)"

Tutorials

Three Jupyter notebooks are provided that give an overview of how to use pyssam for statistical shape and/or appearance modelling.

Extending to new datasets

Landmarks are required to apply pyssam to a new dataset. These can be obtained using a variety of methods as reviewed in Section 4 of Heimann and Meinzer (2009). This can be quite task specific, therefore we have not included specific methods for this. On tree-like structures, we have previously used nodal coordinates as landmarks as done in pyssam.datasets.Tree. For modelling lung lobes, we have also used an automatic algorithm detailed by Ferrarini et al. (2007), but the code is not provided here as it has many task-specific parameters.

A script for manually landmarking an input shape is given in scripts/click_landmarking.py. This uses vedo (repository here) to visualise an input mesh and create landmarks by left click and pressing “c”. The aim of this script is to provide a simple way to landmark meshes before progressing to more advanced automatic algorithms.