Background Topological data analysis (TDA) has gained interest in medical image analysis, but there are no standardized definitions or pipelines to benchmark model performance. Current TDA tools and packages are mainly developed for general machine learning applications, there are no packages for medical imaging. In this paper, we introduce medical imaging topological data analysis (Med-TDA) tool, a standardized TDA framework designed to process medical images across different modalities and enables researchers to easily reproduce reported results. Methods Persistent homology (PH), a TDA tool for extracting topological features, is a primary component of the package. Med-TDA is an open-source Python package that provides an end-to-end pipeline for preprocessing medical images, computing PH, vectorizing persistent barcodes, thereby extracting TDA features from medical images. The package is designed to be used either as an importable library or command-line interface (CLI) supporting batch data processing, and can be installed via PyPI or directly from the source. Lastly, we provide tutorials on the GitHub repository, along with comprehensive documentation. Results We evaluated the Med-TDA pipeline on two publicly available medical imaging datasets and compared its performance with that of the standard radiomic features extracted via PyRadiomics pipeline. Overall, the proposed TDA pipeline demonstrated comparable performance to PyRadiomics, with Med-TDA achieving marginally higher performance on one of the datasets. Conclusions We provide Med-TDA, a standardized end-to-end pipeline for computing TDA features from medical images. The experimental results highlight its potential as a practical tool alongside existing radiomic methods in medical image analysis.
Software Tool Article
[version 1; peer review: awaiting peer review]
1 School of Computing, Queen's University, Kingston, Ontario, Canada
2 Department of Radiology and Diagnostic Imaging, University of Alberta Department of Radiology and Diagnostic Imaging, Edmonton, Alberta, Canada
3 Alberta Machine Intelligence Institute, Edmonton, Alberta, Canada
Dashti A. Ali
Roles: Conceptualization, Methodology, Software, Visualization, Writing – Original Draft Preparation
Amber L. Simpson
Roles: Conceptualization, Resources, Supervision, Writing – Review & Editing
OPEN PEER REVIEW
REVIEWER STATUS AWAITING PEER REVIEW
Topological data analysis (TDA) has gained interest in medical image analysis, but there are no standardized definitions or pipelines to benchmark model performance. Current TDA tools and packages are mainly developed for general machine learning applications, there are no packages for medical imaging. In this paper, we introduce medical imaging topological data analysis (Med-TDA) tool, a standardized TDA framework designed to process medical images across different modalities and enables researchers to easily reproduce reported results.
MethodsPersistent homology (PH), a TDA tool for extracting topological features, is a primary component of the package. Med-TDA is an open-source Python package that provides an end-to-end pipeline for preprocessing medical images, computing PH, vectorizing persistent barcodes, thereby extracting TDA features from medical images. The package is designed to be used either as an importable library or command-line interface (CLI) supporting batch data processing, and can be installed via PyPI or directly from the source. Lastly, we provide tutorials on the GitHub repository, along with comprehensive documentation.
ResultsWe evaluated the Med-TDA pipeline on two publicly available medical imaging datasets and compared its performance with that of the standard radiomic features extracted via PyRadiomics pipeline. Overall, the proposed TDA pipeline demonstrated comparable performance to PyRadiomics, with Med-TDA achieving marginally higher performance on one of the datasets.
ConclusionsWe provide Med-TDA, a standardized end-to-end pipeline for computing TDA features from medical images. The experimental results highlight its potential as a practical tool alongside existing radiomic methods in medical image analysis.
topological data analysis, persistent homology, medical image analysis, feature extraction, machine learning; Python software package
Corresponding author: Dashti A. Ali Competing interests: No competing interests were disclosed.
Grant information: The author(s) declared that no grants were involved in supporting this work.
Copyright: © 2026 Ali DA and Simpson AL. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. How to cite: Ali DA and Simpson AL. Med-TDA: Medical Imaging Topological Data Analysis Tool [version 1; peer review: awaiting peer review]. F1000Research 2026, 15:1382 (https://doi.org/10.12688/f1000research.188425.1) First published: 17 Aug 2026, 15:1382 (https://doi.org/10.12688/f1000research.188425.1) Latest published: 17 Aug 2026, 15:1382 (https://doi.org/10.12688/f1000research.188425.1)
The standardization of medical imaging tools has enabled the benchmarking of model performance across many types of imaging and allowed tools to have broad uptake. Standardized pipelines significantly increase the reproducibility and comparability of results.1 For example, the PyRadiomics package has been widely used for quantitative image analysis and radiomic feature extraction, becoming an accepted pipeline in many studies with over 7,000 citations.1 Topological data analysis (TDA), a relatively new field of data science, has gained popularity in medical image analysis2 but no standardized pipelines exist. This paper introduces the Medical Imaging Topological Data Analysis (Med-TDA) tool, a standardized TDA package designed to handle the end-to-end TDA workflow, from preprocessing to feature extraction, across different medical imaging modalities.
Several software tools have been developed for TDA including GUDHI,3 Ripser,4 giotto-tda,5 Perseus,6 and CubicalRipser.7 Although these tools are widely used to apply TDA in various fields, they are not specifically designed for medical imaging and do not provide an end-to-end workflow for medical image analysis. Some limitations across these packages are as follows:
1. They do not provide TDA specific preprocessing for medical images. For instance, preprocessing a CT image alongside its segmentation mask is not supported. Moreover, when applying a segmentation mask, an appropriate background value should be selected to preserve genuine topological structures captured by PH and to avoid introducing artificial ones. Computing the PH of a CT image directly from raw Hounsfield units can yield richer features than using normalized values.
2. Existing TDA packages do not offer a broad range of parameters for PH computations, such as cube-construction algorithms, filtration types, or various barcode vectorization methods and their fusion across PH dimensions.
3. They lack a CLI tool capable of executing a complete TDA pipeline for an entire medical imaging dataset in a single step.
Med-TDA addresses these limitations by offering a unified pipeline to extract TDA features from medical images. PH is one of the main TDA tools that extracts topological invariants, such as connected components, loops, and enclosed voids, from data across different thresholds and encapsulates them in the form of persistent barcodes.8,9 These barcodes, which have a multiset structure, are then vectorized using a vectorization method to obtain standard feature vectors that can be used in ML tasks, such as classification.10 The proposed package is designed to streamline the workflow of PH computation and vectorization in the context of medical image analysis.
Med-TDA is a Python package that follows a modular, layered pipeline architecture and provides an extensible framework for preprocessing medical images and extracting TDA features across multiple imaging modalities. The package provides a dual-interface architectures, serving as both an importable Python API and a command-line interface (CLI). The CLI, a thin wrapper around the core library, offers a quick solution for processing and extracting TDA features from a single image or an entire dataset with one command. The primary components of the library revolves around three classes: preprocessing, barcode extractions and vectorization. In terms of input data types, the package supports 2–4 dimensional medical imaging data from multiple modalities, such as X-ray, ultrasound, CT, and MRI. Furthermore, the key dependencies required to run the package include GUDHI, CubicalRipser, NumPy, and SimpleITK. A full list of dependencies is available in the package documentation.
Features and functionality
In this section, we briefly describe the main functionalities of the package. Each module is responsible for a specific functionality, such as preprocessing, barcode computation, and vectorization. More importantly, the entire pipeline—from preprocessing to feature extraction—can be executed through the feature extractor module.
Preprocessing
The preprocessing module provides a flexible API for preparing medical images prior to PH computation. This component provides several operations with configurable parameters, including resampling, windowing, intensity clipping, normalization, and cropping the region of interest (ROI) using a segmentation mask.
PH computation and vectorization
The barcode extractor module leverages the CubicalRipser package, which provides an efficient implementation of the cubical complex filtration algorithm, to compute PH from multidimensional medical images. The preprocessing component is used internally in this module prior to PH computation. The configurable parameters of this module include filtration type (sub-level and super-level), cubical complex construction type (T or V), maximum PH dimension, and preprocessing parameters. Following PH computation, persistent barcodes are vectorized to generate feature vectors suitable for machine learning tasks. Med-TDA provides this functionality with configurable parameters and implements eight vectorization methods: Betti curve, entropy summary, persistence image, persistence landscape, persistence lifespan, persistence silhouette, persistence statistics, and persistence tropical coordinates.
Full pipeline
The feature extractor module provides an end-to-end pipeline for preprocessing, barcode computation, and vectorization. This pipeline is illustrated in Figure 1. This module includes configurable parameters for preprocessing, PH computation, and vectorization. In addition, the module can perform multiple vectorizations and return a dictionary of concatenated features across PH dimensions. The following code snippet demonstrates the use of the feature extractor API on a sample image:
from medtda import FeatureExtractor # Initialize with desired settings extractor = FeatureExtractor( normalize= True, normalize_method= 'minmax', vectorization_method= 'persistence_stats') # Extract features from image's ROI features = extractor.execute (image= 'image.nii.gz', mask= 'mask.nii.gz')
The pipeline accepts medical images of various modalities and dimensions, such as X-ray, CT, and MRI. Optionally, segmentation masks can accompany the input images. The data are then preprocessed using either default or user-defined parameters. Available preprocessing operations include resampling, windowing, normalization, ROI cropping, and others. Next, PH is computed from the ROI data, followed by feature vectorization, and the resulting features are returned.
The CLI serves as a wrapper around the feature extractor module, offering a convenient method for processing batch data. All configurable parameters for the different steps of the pipeline can be set via command-line arguments or through a YAML configuration file. The following code snippet, for instance, executes the full Med-TDA pipeline on a dataset of images:
# Batch processing with parallel workers medtda cases.csv --output- dir ./results --workers 4 --normalize
Finally, a plotting module is provided for the visualization of persistent barcodes, persistence diagrams, and vectorized barcodes.
Software installation and documentation
The source code of the Med-TDA package is publicly available on the project’s GitHub repository: https://github.com/dashtiali/medtda.
The package can be installed from the Python Package Index (PyPI) using the command:
pip install medtda
or alternatively from the project’s GitHub repository by installing from the source code. Furthermore, a Jupyter notebook tutorial is provided in the GitHub repository, and comprehensive package documentation can be accessed at: https://medtda.readthedocs.io.
Since the package is written in Python, it is inherently cross-platform and can run on Windows, Linux, and macOS with Python installed.
Requirements: Python ≥3.10.
Core dependencies: NumPy ≥1.21, SciPy ≥1.7, GUDHI ≥3.5, cripser ≥0.0.32, SimpleITK ≥2.1, Pillow ≥9.0, scikit-image ≥0.19, scikit-learn ≥1.0, pandas ≥1.3, matplotlib ≥3.5, seaborn ≥0.11, PyYAML ≥6.0, tqdm ≥4.60.
To evaluate the Med-TDA pipeline, two publicly available datasets of 2D and 3D medical images were used: the Digital Database for Screening Mammography (DDSM)11 and the Multi-phase Computed Tomography (CT) dataset for Liver Tumour Diagnosis (MCT-LTDiag).12 The DDSM dataset consists of mammography images of patients with normal and abnormal breast tissues. A balanced subset of 512 images was used for the experiments. The dataset contains preprocessed 2D ROI images with a resolution of 128 × 128 pixels. The MCT-LTDiag dataset is comprised of multi-phase CT images of patients diagnosed with different subtypes of liver cancer, including hepatocellular carcinoma (HCC), intrahepatic cholangiocarcinoma (ICC), colorectal liver metastasis (CRLM), hepatic hemangioma (HH), and breast cancer liver metastasis (BCLM). Only the portal venous phase CT images were used in the experiments, and three patients were excluded due to incorrect segmentation masks. The ROI includes only the tumour regions in all 3D CT images in the dataset.
The Med-TDA CLI tool was utilized to execute the full TDA pipeline on both datasets, and the required preprocessing and feature extraction tasks were handled by the pipeline. For the 3D dataset, CT images were resampled to isotropic spacing; ROIs were cropped using the segmentation masks and padded by 5 voxels; PH was computed from the Hounsfield unit voxel intensities of the ROIs; and persistent statistics vectorization was used to vectorize the barcodes. The datasets were split using a stratified 80/20 train–test ratio. Features with low variance and high correlation were removed, with no further feature selection applied. A logistic regression classifier was then fine-tuned on the training data and evaluated on the test data.
Finally, the evaluation results are reported in terms of AUC, accuracy, recall, precision, and F1-score, along with confidence intervals over 1000 iterations. For benchmarking and comparison, standard radiomic features, including all original features, were extracted from each dataset using the PyRadiomics package and evaluated using the same classification pipeline. The classification results are reported in Table 1. Overall, Med-TDA and PyRadiomics pipelines demonstrate comparable performance, with Med-TDA providing marginally higher performance on the DDSM dataset. Furthermore, confusion matrices and SHAP summary plots are illustrated in Figure 2.
In this work, we presented Med-TDA, a Python package for extracting TDA features from multidimensional medical images. The package provides a standardized pipeline for preprocessing, PH computation, and vectorization across different modalities, subsequently enabling the extraction of various TDA features. The package can be used as an importable library or as a CLI tool, allowing the full pipeline to be executed on an entire dataset of images in a single step. Med-TDA can be installed from PyPI or its GitHub repository, and comprehensive documentation is provided to guide users through the package’s modules and functionalities with examples, facilitating adoption by the medical imaging community. Finally, we evaluated the Med-TDA pipeline on two publicly available medical imaging datasets and compared its performance against the PyRadiomics pipeline. While the current release focuses on persistent homology as one of the primary TDA approaches for medical imaging, future work will build upon this foundation. To supplement the current comprehensive documentation, future releases will introduce video tutorials to guide users more effectively, while also integrating additional topological tools, such as the Mapper algorithm, to further expand the analytical capabilities of the package.
Software available from: https://pypi.org/project/medtda.
Source code available from: https://github.com/dashtiali/medtda.
Archived source code at time of publication: https://doi.org/10.5281/zenodo.21766759.
License: The MIT License.
The author(s) declared that no grants were involved in supporting this work.
© 2026 Ali DA and Simpson AL. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Current Reviewer Status:
AWAITING PEER REVIEW
AWAITING PEER REVIEW
?
Key to Reviewer Statuses VIEW HIDE
ApprovedThe paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approvedFundamental flaws in the paper seriously undermine the findings and conclusions
Open Peer Review
AWAITING PEER REVIEW
Sign up for content alerts
Alongside their report, reviewers assign a status to the article:
Approved - the paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations - A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approved - fundamental flaws in the paper seriously undermine the findings and conclusions