A Python toolkit for analyzing complex biological network structures
This is a work-in-progress re-write of SkelePlex.You may encounter bugs or broken features.
SkelePlex is a comprehensive image analysis tool designed to extract quantitative measurements from complex biological networks while preserving their morphological context. It specializes in analyzing branching structures such as:
- Bronchial trees - Respiratory system analysis
- Vasculature - Blood vessel networks
- Axonal networks - Neural connectivity
- Xylem structures - Plant vascular systems
- Hierarchical graph construction from segmentation images
- Interactive curation with custom viewer tools
- Comprehensive measurements: branch length, angles, generation, diameter, tissue thickness
- Scalable processing with parallelized, lazy operations for large datasets
- Multi-format support including
.zarrfor out-of-core computation
pip install "git+https://github.com/kevinyamauchi/skeleplex-v2.git#egg=skeleplex-v2[cellier,viz]"- Python 3.11+
- For large datasets: Sufficient RAM or
.zarrformat support - For the neural networks access to a GPU is recommended
- For interactive viewing: OpenGL-compatible graphics
Start with a semantic segmentation where 1 represents foreground (network) and 0 represents background. SkelePlex supports various formats including .zarr for out-of-memory computations.
Input: Binary segmentation of biological network
Transform the segmentation into a normalized distance field using a spherical max distance kernel. Each voxel value represents the normalized distance to the background.
Apply the multiscale SkelePlex UNet to predict skeleton centerlines from the distance field image.
AI-predicted skeleton centerlines
- Construct hierarchical graph with nodes at branch points
- Fit splines to connecting edges
- Use the interactive viewer for manual curation and quality control
There are many ways to analyse the graphs. We have implemented:
- Measuring of branch length, diameter, branch angle and number of tips connected to the branch
To measure branch diameters we:
- Extract orthogonal image sections along each branch
- Process and filter these image sections
- Extract the section area and determine branch thickness
- An automatized way to differentiate between the branch lumen and its surrounding wall thickness if the tissue and not the lumen was segmented
We provide a couple of examples on how to use SkelePlex, see the examples/ directory:
This is the best starting point.
Basic viewer usage- Usage of the skeleton viewerAdd your custom widget
Extract orthogonal slices along each branch- Important to measure branch diametersMeasure the branch diametersMeasure more and export
If you segmented the tissue of a branch and are interested to measure tissue thickness and the lumen diameter, you can train a lumen classifier to automate that step.
Create trainings data from orthogonal slicesSet up trainings data for trainingTrain your classifier
-
Fork and Clone
git clone https://github.com/kevinyamauchi/skeleplex-v2.git cd skeleplex-v2 -
Create Environment (recommended)
conda create -n skeleplex python=3.11 conda activate skeleplex
-
Install in Development Mode
pip install -e ".[dev-all]" -
Set up Pre-commit Hooks to apply linting
pre-commit install
# Run all tests
pytest
# Run specific test module
pytest tests/graph/test_skeleton_graph.py- All coordinates are transformed to physical units (µm)
- Input images should be isotropic for optimal results
For computing signed distances to mesh surfaces:
- Unix/Linux/macOS: Uses
pysdf(better performance) - Windows: Uses
igl(consistent results)
Both approaches yield equivalent results and only affect synthetic data generation.
If you use SkelePlex in your research, please cite:
@article{mederacke2025emergence,
title={The emergence of the fractal bronchial tree},
author={Mederacke, Malte and Yamauchi, Kevin A and Doumpas, Nikolaos and Schaumann, Laura and Sperl, Jonathan and Weikert, Thomas and Dane, D Merrill and Hsia, Connie CW and Pradella, Maurice and Bremerich, Jens and others},
journal={BioRxiv},
pages={2025--01},
year={2025},
publisher={Cold Spring Harbor Laboratory}
}This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [malte.mederacke@ethz.ch]


