This is the official code repository for "Deep learning model for coronary artery segmentation and quantitative stenosis detection in angiographic images", which is accpeted by Medical Physics as a research article!
π Official Website: This repository now includes a modern website showcasing the project. See the Website Section below for details.
Figure 1: The overall architecture of SAM-VMNet combining VMUnet (Vision-based Medical Network) with SAM (Segment Anything Model)
To set up the project, follow these steps:
Clone the repository:
git clone https://github.com/qimingfan10/SAM-VMNet.git
cd SAM-VMNetpip install -r requirements.txtThe .whl files of mamba_ssm could be found here. The .whl files of causal_conv1d could be found here.
Download the following files from Google Drive and place them in the ./pre_trained_weights directory:
Download the ARCADE from zenodo.
After downloading the datasets, you are supposed to put them into ./data/vessel/ and the file format reference is as follows.
- './data/vessel/'
- train
- images
- .png
- masks
- .png
- val
- images
- .png
- masks
- .png
- test
- images
- .png
- masks
- .png
bash train.shFirst, train the Pure VM-UNet of Branch 1. The trained weights will be saved in ./result_branch1/.
bash test.shThen, use the trained weights to predict the test set images and obtain pred_masks.
bash train.shFinally, train the SAM-VMNet of Branch 2. The trained weights will be saved in ./result_branch1/.
This repository also includes MATLAB code for quantitative stenosis detection in segmented vessel images. The stenosis detection module complements the deep learning segmentation pipeline by providing detailed analysis of vessel narrowing.
π Quick Links:
- π Quick Start Guide - Get started in 5 minutes!
- π Detailed Documentation
- π‘ Usage Examples
- π Changelog
The stenosis detection module (stenosis_detection/maskjiance1016.m) performs comprehensive analysis including:
- Centerline extraction using skeletonization
- Radius calculation for each centerline point using Method of Moments
- Segmentation point detection (bifurcation points)
- Path finding between segmentation points
- Stenosis detection with degree calculation
- Result visualization with color-coded stenosis points
The stenosis detection code is located in the stenosis_detection/ directory:
Main Function:
maskjiance1016.m- Main stenosis detection script
Supporting Functions:
MoMforSeg1.m- Radius calculation using Method of Momentscheck_neighbors.m- Neighbor checking for skeleton pointsfindpath2.m- Shortest path finding on skeleton graphgetRadius.m- Radius retrieval functionduilie.m- Queue processing for stenosis detectiongetNeighbors.m- 8-connected neighbor retrieval
Documentation:
README_stenosis.md- Complete documentation for stenosis detection module
One-Click Startup (Recommended):
Using bash script (Linux/Mac):
./run_stenosis_detection.sh [original_image_path] [mask_image_path]Using Python script (Cross-platform):
python run_stenosis_detection.py [original_image_path] [mask_image_path]Example:
# With image paths
./run_stenosis_detection.sh data/test.jpg data/test_mask.png
# Or run with default images (need to edit maskjiance1016.m first)
./run_stenosis_detection.sh-
Prepare Input Images:
- Original image: Original vessel angiographic image
- Segmented mask: Binary mask image after segmentation (from SAM-VMNet or other segmentation methods)
-
Modify Image Paths: Edit
stenosis_detection/maskjiance1016.m:Im = imread("your_original_image.jpg"); im = imread("your_segmented_mask.png");
-
Run Detection in MATLAB:
cd stenosis_detection maskjiance1016
-
View Results:
- Figure 1: Centerline extraction result
- Figure 2: Segmentation points detection result
- Figure 3: Stenosis detection result with color-coded stenosis points
The detection results include:
- Stenosis Points: Coordinates of detected stenosis locations
- Stenosis Degrees: Quantitative stenosis severity (0-1 scale)
- Visualization: Color-coded markers indicating stenosis severity:
- Red: Severe stenosis (>75%)
- Green: Moderate stenosis (50-75%)
- Blue: Mild stenosis (25-50%)
- MATLAB R2016b or higher
- Image Processing Toolbox
For detailed usage instructions and parameter tuning, please refer to stenosis_detection/README_stenosis.md.
This repository includes a modern, responsive website built with React and TailwindCSS that showcases the SAM-VMNet project.
- π± Fully responsive design
- π¨ Modern UI with smooth animations
- π Interactive documentation
- π¬ Demo and visualization showcase
- π₯ Easy access to downloads and resources
Development:
npm install
npm run devProduction Build:
npm run buildThe built website will be in the dist/ directory and is ready to deploy to any static hosting service.
- Home: Project overview and key features
- About: Research background and methodology
- Features: Technical details and architecture
- Demo: Interactive demonstration and workflow
- Documentation: Complete setup and usage guide
- Downloads: Pre-trained models and datasets
Visit the deployed website or run locally to explore all features!
This project is licensed under the Apache-2.0 License. See the LICENSE file for more details.
If you use this project in your research, please cite the following paper:
@article{https://doi.org/10.1002/mp.17970,
author = {Huang, Baixiang and Luo, Yu and Wei, Guangyu and He, Songyan and Shao, Yushuang and Zeng, Xueying and Zhang, Qing},
title = {Deep learning model for coronary artery segmentation and quantitative stenosis detection in angiographic images},
journal = {Medical Physics},
volume = {52},
number = {7},
pages = {e17970},
doi = {https://doi.org/10.1002/mp.17970},
year = {2025}
}For any questions or issues, please open an issue on this repository.
