/ampscan

ampscan is an open-source Python package for analysis and visualisation of digitised surface scan data, specifically for applications within Prosthetics and Orthotics (P&O), with an aim to improve evidence-based clinical practice towards improved patient outcomes.

Primary LanguagePythonMIT LicenseMIT

ampscanlogo

Join chat: Join the chat at https://gitter.im/ampscan Build status: Build Status Docs: Documentation Status License: License DOI: DOI

ampscan is an open-source Python package for analysis and visualisation of digitised surface scan data, specifically for applications within Prosthetics and Orthotics, developed with the ABEL at the University of Southampton. These industries are increasingly using surface scanners as part of clinical practice to capture the patient's individual geometry to design personalised devices. ampscan gives researchers within this field access to powerful tools to analyse the collected scans to help inform clinical practice towards improved patient-outcomes. This package has been designed to be accessible for researchers and clinicians with only a limited knowledge of Python. Therefore, analysis procedures can all be accessed using the lightweight Graphical User Interface within the git repo, and will soon be available as a standalone web-app.

A graphical summary of a typical ampscan process. a) Importing a pair of scans, b) Automatically snap centres, c) Align using ICP algorithm, d) Register and visualise shape deviation and e) Automatically analyse the registered scan

The typical ampscan process is demonstrated above (Figure 1) and the core functionality summarised below, with a more detailed description available in the online documentation:

  • AmpObject: this is the key object of the package and holds the key data and methods. The key data held within the AmpObject is the mesh data including arrays of the vertices, faces, normals and field values. The vtk actor for visualisation is also stored. The core methods of the AmpObject include imports for .stl files, saving .stl files, rotation and translation. Further methods on the core AmpObject include smoothing, trimming and visualisation.

  • Alignment: This takes two AmpObjects, one fixed and one moving, and applies a rigid transformation to the moving AmpObject in order to minimise the spatial error between the two AmpObjects. This means that when the registration process is performed, only the true shape deviations are calculated.

  • Registration: This takes two AmpObjects, one baseline and one target, and applies a non-rigid transformation to morph the baseline vertices onto the surface of the target. Following this, a detailed map of the spatial difference between the two shapes can be visualised and analysed.

  • Analysis: This is used to extract key geometrical infomation about the shape, including volume and serial slice cross section areas and perimeters.

  • Graphical User Interface: This enables visualisation to multiple AmpObjects within a single window, giving access to the automated and manual alignment tools as well as registration. This facilitates the core analysis of the scan data for users who are not experienced Python users. The python version of the GUI is available in the gui folder from the git repo and a standalone webapp is now avilable.

Potential applications of ampscan include tracking how the limb shape and volume has changed over time, digitising manual prosthetic socket design modifications, and comparing the outputs of different scanning technologies.

ampscan relies heavily on NumPy and SciPy to perform mathematical operations with visualisation handled by PyQt and VTK. The package is still under development by researchers at the University of Southampton. For full documentation, visit the ampscan website.

Installing ampscan

ampscan has a number of dependencies, namely; NumPy, SciPy, Matplotlib, PyQt and VTK. We recommend using pip for installation. It is possible to install via conda, but in our experience, VTK can be challenging to install via this route. If you do choose to use conda, we recommend the conda-forge channel for VTK. Before installation, ensure your environment is using Python 3.

ampscan currently is supported on Python 3.6-3.9 for Linux, Windows and Mac.

For the most up to date version of ampscan, clone directly from the github repository using:

git clone https://github.com/abel-research/ampscan

To install via pip, navigate to the ampscan/ directory and run a pip install using:

pip install -r requirements.txt

Followed by:

pip install -e .

ampscan will soon be available on pip once v0.3 is released

If you are installing on Red Hat, you may need to install the dependencies listed in the Yum Requirements file.

Maintainer Notes

If you wish to help develop ampscan, then please read our contributing guidelines.

Documentation for the ampscan library is automatically generated using sphinx. Any additional code should be documented in accordance with 'numpy style' docstrings. A template can be found here.

Testing

Testing is performed automatically using Gitlab Actions. New tests can be added to the repo.

License

At ampscan we use the MIT license, which can be found here here

How to acknowledge

ampscan has been published in JOSS. Please cite as: Steer et al., (2020). ampscan: A lightweight Python package for shape analysis of prosthetics and orthotics. Journal of Open Source Software, 5(48), 2060, https://doi.org/10.21105/joss.02060