Skip to main content

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:

  1. Create a virtual environment, or otherwise ensure a clean environment.

  2. 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
  1. 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_IMAGES should point to a folder with input CFIs in standard imaging formats. DICOM is supported via pydicom. Alternatively PATH_TO_IMAGES may be the path to a CSV file with id and path columns, and one image per row. If provided in this way, each path should be an absolute path to a valid image file and the corresponding unique id will 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.jpg
    

    Note that paths should be absolute and IDs should be unique.

  • The folder PATH_TO_FOLDER_FOR_SEGMENTATIONS should 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_REPORT is an output folder containing the biomarker values, metadata, README, manifest, and sample plots.

  • The --feature-set is used to specify a set of biomarkers to extract. The underscore spelling --feature_set remains available as an alias.

  • The --n-jobs option 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-models picks the first available CUDA GPU, Apple MPS acceleration, or CPU. Override this with --device, passing any string accepted by torch.device (for example cuda:0, mps, or cpu).

  • An optional --logfile PATH_TO_LOGFILE_TXT can 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:

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)

Table of built distributions (wheels) for retinalysis-vascx 2.2.0
File Interpreter ABI Platform Actions
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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page