Skip to content

helia77/MicroVasc-Review

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroVasc-Review

Review of Segmentation and Skeletonization Methods for Large-Scale Microvascular Networks

This repository contains code and resources associated with the paper
"Segmentation and Modeling of Large-Scale Microvascular Networks: A Survey" by Goharbavang et al.

📄 Read the Full Paper

Overview Diagram

Citation

If you use this code or the paper, please cite:

@article{goharbavang2025segmentation,
  title={Segmentation and modeling of large-scale microvascular networks: a survey},
  author={Goharbavang, Helya and Ashitkov, Artem T and Pillai, Athira and Wythe, Joshua D and Chen, Guoning and Mayerich, David},
  journal={Frontiers in Bioinformatics},
  volume={5},
  pages={1645520},
  year={2025},
  publisher={Frontiers Media SA}
}

Repository Content

The paper covers the following methods:

  • Binarization: Otsu’s thresholding; Frangi vesselness; Beyond Frangi; Optimally Oriented Flux; U‑Net; nnU‑Net
  • Skeletonization: Lee thinning; Palágyi thinning; Surface normal accumulation (Kerautret); Fast Marching (Kline); Mean curvature flow (Tagliasacchi); Voronoi‑based (Antiga)

This repository includes two CLI modules under 'implementations/' for a subset of these methods. For the rest, please see the External Resources section below for links to community or official implementations.

  • Binarize.py
    Provides otsu2d, otsu3d, frangi, and bfrangi.

  • Skeleton.py
    Provides lee, palagyi, kerautret, and kline subcommands.

Other directories:

  • manage_data/ Scripts for preprocessing and converting raw imaging data (e.g., Numpy → NWT).

  • metrics/ Tools to compute quantitative evaluation metrics:

    • Segmentation: Jaccard index, Dice coefficient, precision, recall
    • Skeletonization: NetMets precision and recall
  • optimization/ Parameter-tuning and sensitivity-analysis scripts (grid search for scale, shape, and threshold parameters).

  • LICENSE MIT License.

Quick Start

  1. Clone the repo

    git clone https://github.com/helia77/MicroVasc-Review.git
    cd MicroVasc-Review
  2. Install dependencies (e.g., via Conda environment)

    # conda create --name microvasc
    # conda activate microvasc
    pip install -e .
  3. Verify CLI tools

    binarize --help
    skeleton --help
  4. Run an algorithm

    binarize frangi \
    --input path/to/volume.npy \
    --output path/to/out.npy \
    --background white \
    --params 0.5 0.5 3 \
    --scale 1 2 3 4
    --th otsu3d

External Resources & Implementations

Refer to the paper for detailed methodology, evaluation results, and discussions.

Running External Codes

1. U-Net

  • Installation:

    # Requirements
    # Python 3.12+
    # PyTorch, NumPy, OpenCV, tqdm, scipy, matplotlib
    git clone https://github.com/MrMras/CNN.git
    cd CNN
    
    conda env create -n cnn -f environment.yml
    conda activate cnn
  • Usage:

      # Upload .npy files under   ./unprocessed_data/{name_of_dataset}
      # Change the path to these files in ./create_volume_from_npy.py
      python ./create_volume_from_npy.py
      # Should create a folder ./data/{name_of_dataset} and add 2 files in there.
    
      cd ./model/       # change the paths in ./model.py to ./data/{name_of_dataset}/{files}
      python ./model.py EPOCHS -c
      #  Model will save the model under ./saved_models/{name_of_dataset}/model_for_vasc3d{random id}.pth.
    
      cd ../            # specify the path for the trained model and the path to the target volume (line 64)
      python ./run_model.py
      # Binary and probability maps will be generated in ./processed_npy/ and ./probability_npy/

2. nnU-Net

  • Installation:

    conda create -n nnunet python=3.9.*
    pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
    pip install nnunetv2
    
    set nnUNet_raw = path/to/nnUNet_raw
    set nnUNet_preprocessed = path/to/nnUNet_preprocessed
    set nnUNet_results = path/to/nnUNet_results
  • Usage:

    # Use the new presets
    nnUNetv2_plan_experiment -d DATASET_ID -pl nnUNetPlannerResEncL
    # Extract fingerprint
    nnUNetv2_plan_and_preprocess -d DATASET_ID --verify_dataset_integrity
    # Train
    nnUNetv2_train DATASET__ID 3d_fullres 0/1/2/3/4 -p nnUNetResEncUNetLPlans
    # Predict
    nnUNetv2_predict -i INPUT_FOLDER -o OUTPUT_FOLDER -d DATASET_ID -c 3d_fullres -p nnUNetResEncUNetLPlans --save_probabilities
    nnUNetv2_apply_postprocessing -i FOLDER_WITH_PREDICTIONS -o OUTPUT_FOLDER --pp_pkl_file POSTPROCESSING_FILE -plans_json PLANS_FILE -dataset_json DATASET_JSON_FILE

About

Review of Segmentation and Skeletonization Methods for Large-Scale Microvascular Networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors