This is a repository containing code described in "A Primer on Topological Data Analysis to Support Image Analysis Tasks in Environmental Science" by Ver Hoef et al. for running persistent homology, a tool from the mathematical field of topological data analysis (TDA) on the Sugar, Fish, Flowers, and Gravel dataset by Stevens et. al, more fully described in the paper here.
To begin, install miniconda on your system and create a clean environment, and if you have not already then install the following packages from conda-forge:
python
numpy
matplotlib
jupyterlab
ipympl
pillow
pandas
scikit-learn
tqdm
fire
POT
gudhi
The final package, GUDHI, contains the software implementations of TDA algorithms that we will principally use in this example.
To download the image data, navigate to the image_download
folder, update the download_all.ps1
(for Windows Powershell) or download_all.sh
(for Unix-based systems) scripts with where you would like the data to be stored, then execute that script. The data require ~5.5 GB of disk space.
The principal analysis and example viewing can be done in the analysis.ipynb
Jupyter notebook.