Metadata-Version: 2.4
Name: vesskel
Version: 3.3.0
Summary: 2D and 3D Skeletonization and Graph-based Analysis
License-Expression: MIT AND (Apache-2.0 OR BSD-2-Clause)
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: argcomplete>=3.6.0
Requires-Dist: numba>=0.65.0
Requires-Dist: numpy>=2.4.4
Requires-Dist: pillow>=12.2.0
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: scipy>=1.17.1
Requires-Dist: skan>=0.13.1
Provides-Extra: napari
Requires-Dist: napari[all]; extra == "napari"
Requires-Dist: napari-assistant>=0.6.0; extra == "napari"
Requires-Dist: itk>=5.4.6; extra == "napari"
Requires-Dist: napari-simpleitk-image-processing>=0.4.9; extra == "napari"
Requires-Dist: napari-skimage>=0.6.0; extra == "napari"
Provides-Extra: dev
Requires-Dist: pytest>=9.0.2; extra == "dev"
Requires-Dist: pytest-xdist>=3.8.0; extra == "dev"
Requires-Dist: pooch>=1.9.0; extra == "dev"
Requires-Dist: scikit-image>=0.26.0; extra == "dev"
Provides-Extra: notebooks
Requires-Dist: seaborn>=0.13.2; extra == "notebooks"
Requires-Dist: statsmodels>=0.14.6; extra == "notebooks"
Requires-Dist: scikit-learn>=1.8.0; extra == "notebooks"
Dynamic: license-file

# VesSkel

Vessel Skeletonization and Graph-Based Phenotype Analysis in Retinal Fundus Images

## Installation

```sh
uv sync                  # core only
uv sync --extra dev      # + test tools
uv sync --extra napari   # + napari GUI
uv sync --all-extras     # everything
```

## Napari

```sh
uv sync --extra napari && uv run napari
```

Open a `manual1` TIFF from the HRF folder, then run **Lee94 Thinning** from the VesSkel plugin menu to see the skeleton.

Inside the **Analyze Vessels** widget, tune extraction settings and use **Save Config** to export a reusable JSON preset.

## CLI

Use the same JSON preset exported from napari to batch-process images.

```sh
vesskel config-init --out config.json
vesskel validate-config --config config.json
vesskel run --input HRF/manual1 --config config.json --out outputs
```

CLI outputs:
- `outputs/summary.csv` with one feature row per image
- Optional per-image skeleton outputs (default: `.npy`)
- Optional per-image branch tables when `output.write_branch_csv=true`

### Shell completions

```sh
# zsh
eval "$(vesskel completions zsh)"

# bash
eval "$(vesskel completions bash)"

# PowerShell
vesskel completions powershell | Out-String | Invoke-Expression
```

Add the appropriate line to your shell rc for persistent tab-completion.

## Tests

```sh
uv sync --extra dev && uv run pytest
```

- **2D regression** - thinning + feature extraction on all 45 HRF samples, compared against saved baselines
- **3D regression** - thinning + features on a brain volume (from scikit-image), same baseline approach
- **3D comparison** - vesskel `lee94_thin` vs `skimage.morphology.skeletonize` on the brain volume, asserting identical output

First run (or `--update-baseline`) generates baselines in `tests/skeletons/` and `tests/features/`.

## Dataset

This project uses the High-Resolution Fundus (HRF) Image Database, established by a collaborative research group to support comparative studies on automatic segmentation algorithms on retinal fundus images.

The database contains 45 images total:
- 15 images of healthy patients
- 15 images of patients with diabetic retinopathy
- 15 images of glaucomatous patients

Binary gold standard vessel segmentation images and field of view (FOV) masks are available for each image.

### License

> Budai, Attila; Bock, Rüdiger; Maier, Andreas; Hornegger, Joachim; Michelson, Georg.
> Robust Vessel Segmentation in Fundus Images.
> International Journal of Biomedical Imaging, vol. 2013, 2013

The HRF dataset is released under the **Creative Commons 4.0 Attribution License**.

For more information, visit the [HRF Image Database](https://www5.cs.fau.de/research/data/fundus-images/).

