Updates
- 29/10/2026: New improved documentation, including test-retest reproducibility scores on the Rotterdam Study.
- 01/10/2026: New CRE implementation that follows the ARIC vessel measurement manual..
- 12/09/2026: New VascX app available. It runs VascX in the browser using GPU and visualizes biomarkers. Running time is about ~10s per image on a Mac M4/M5 laptop, and much slower on CPU. It is meant as a demo and for small runs with <500 images. For best performance on larger sets, use the Python package with a GPU.
- 12/09/2026: New convnextv2 segmentation models are available and they are the new default models in VascX. They have better performance and run faster than the previous UNet ensembles.
- 10/06/2026: Updated README with more complete information on interpreting outputs and advanced use cases.
- 04/06/2026: We have fixed some remaining missing dependencies that meant run-models was not working correctly with vascx.
VascX retinal vascular analysis
VascX was created to facilitate the extraction of retinal vascular biomarkers from color fundus image (CFI) segmentations. The instructions in this repository explain how to run the entire pipeline, which has two main parts:
- CFI Segmentation. Extraction of optic disc, vessels and artery vein segmentation and fovea locations. Our model weights are publicly available in a huggingface repository. See instructions below for inference.
- Biomarker computation. Extraction of biomarkers from the segmentations.
Features
- Currently supported biomarkers / features: Central Retinal Equivalents, Calibers, Artery-Vein Ratio, Vascular Density, Bifurcation Angles, Tortuosity, Sparsity, and others.
- Many of these biomarkers support multiple implementations and configuration arguments as detailed in our manuscript. The code for each biomarker also specificies the supported options.
- VascX supports region-aware measurements, relative to the optic disc - fovea axis. If the region is not visible, the biomarker is not computed.
- VascX can generate visualisations for every biomarker.
Installation
To install the entire fundus analysis pipeline including fundus preprocessing, model inference code and vascular biomarker extraction:
-
Create a virtual environment, or otherwise ensure a clean environment.
-
Install torch and torchvision that match your cuda environment. For example:
pip install torch torchvision torchaudio # pip and CUDA 12
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia # conda and CUDA 12
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 # pip and CUDA 11
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia # conda and CUDA 11
- Install VascX:
pip install retinalysis-vascx
Usage
To run the two stages of VascX on a folder with input CFIs:
vascx run-models <PATH_TO_IMAGES> <PATH_TO_FOLDER_FOR_SEGMENTATIONS>
vascx calc-biomarkers <PATH_TO_FOLDER_FOR_SEGMENTATIONS> <PATH_TO_BIOMARKER_REPORT> --feature-set od_centered --n-jobs 8
-
PATH_TO_IMAGESshould point to a folder with input CFIs in standard imaging formats. DICOM is supported viapydicom. AlternativelyPATH_TO_IMAGESmay be the path to a CSV file withidandpathcolumns, and one image per row. If provided in this way, eachpathshould be an absolute path to a valid image file and the corresponding uniqueidwill be used to name the output and intermediate results for that image. This is useful when the source images are not all in a single folder.Sample CSV file with inputs
If you chose to use a CSV file as input to
run-models, the format should be the following:id,path drive_left_22,/path/to/samples/fundus/original/DRIVE_22.png drive_right_40,/path/to/samples/fundus/original/DRIVE_40.png chasedb_left_08,/path/to/samples/fundus/original/CHASEDB1_08L.png chasedb_right_12,/path/to/samples/fundus/original/CHASEDB1_12R.png hrf_green_04,/path/to/samples/fundus/original/HRF_04_g.jpg hrf_dr_07,/path/to/samples/fundus/original/HRF_07_dr.jpgNote that paths should be absolute and IDs should be unique.
-
The folder
PATH_TO_FOLDER_FOR_SEGMENTATIONSshould initially be an empty or non-existent folder. The first stage (run-models) will write intermediate segmentations and other AI outputs to this folder. -
The same folder should be passed to the second stage as input as shown above.
-
PATH_TO_BIOMARKER_REPORTis an output folder containing the biomarker values, metadata, README, manifest, and sample plots. -
The
--feature-setis used to specify a set of biomarkers to extract. The underscore spelling--feature_setremains available as an alias. -
The
--n-jobsoption indicates how many CPU jobs to start. For optimal performance, we recommend to set to the number of CPU threads available divided by two, as a rule of thumb. -
By default,
run-modelspicks the first available CUDA GPU, Apple MPS acceleration, or CPU. Override this with--device, passing any string accepted bytorch.device(for examplecuda:0,mps, orcpu). -
An optional
--logfile PATH_TO_LOGFILE_TXTcan be added to store warnings.
Example
For example, to run VascX on the provided samples folder in our git repository:
git clone git@github.com:Eyened/retinalysis-vascx.git rtnls_vascx
cd rtnls_vascx
vascx run-models ./samples/fundus/original/ ./samples/fundus/segmentations
vascx calc-biomarkers ./samples/fundus/segmentations ./samples/fundus/biomarker_report --feature-set od_centered --n-jobs 8 --naming resolved
Attribution
If you use VascX, please consider citing our open access papers / preprints:
-
retinalysis-vascx: An explainable software toolbox for the extraction of retinal vascular biomarkers Vargas Quiros, J. V., Beyeler, M. J., Vela, S. O., Center, E. R., Bergmann, S., Klaver, C. C. W., & Liefers, B. (2026). retinalysis-vascx: An explainable software toolbox for the extraction of retinal vascular biomarkers. arXiv preprint arXiv:2602.08580.
-
VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images Vargas Quiros, J. D., Liefers, B., van Garderen, K. A., Vermeulen, J. P., & Klaver, C. C. W. (2025). VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images. Translational Vision Science & Technology, 14(7), 19-19.
License
Copyright (c) 2025 Erasmus Medical Center.
retinalysis-vascx is available under the PolyForm Noncommercial License 1.0.0. Uses outside the permissions granted by that license require a separate commercial agreement. For commercial licensing, contact Jose Vargas.
Third-party components retain their respective licenses and copyright notices, including the BSD-2-Clause notices in the RPS modules and the license for the bundled sknw code.
Metadata
Release files for retinalysis-vascx 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| retinalysis_vascx-2.2.0-py3-none-any.whl | Python 3 | none | any | Details for retinalysis_vascx-2.2.0-py3-none-any.whl |
Release files / retinalysis_vascx-2.2.0-py3-none-any.whl
| Download URL | retinalysis_vascx-2.2.0-py3-none-any.whl |
|---|---|
| Size | 177.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ce43c4b418a54e468b9d9beebe0801ed558630d14eb5af10f32446955e33b6d
|
|
BLAKE2b-256 checksum How to use checksums |
48d4e59ebc996bf6d557210dada6874a682cad874f52d67e525e273295e8115a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for retinalysis-vascx 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.