A self-contained Jupyter notebook for detecting artery stenosis from angiography images using classical image-processing techniques: denoising, edge enhancement, rotation alignment, and diameter estimation.
.
├── README.md
├── notebooks/
│ └── stenosis_detection.ipynb ← Jupyter notebook with full code & explanations
├── data/
│ └── angio_n.bmp ← Sample angiography image
├── results/
│ ├── stenosis_crop.png ← Binarized cropped vessel region
│ └── stenosis_summary.png ← Final summary (diameter & stenosis %)
└── requirements.txt
- Python 3.7+
- NumPy
- OpenCV
- scikit-image
- Matplotlib
- JupyterLab or Notebook
Install dependencies:
pip install -r requirements.txt
-
Clone the repository
git clone https://github.com/PixelErfan/automated-stenosis-detection.git cd automated-stenosis-detection
-
Launch the Jupyter notebook
jupyter notebook notebooks/stenosis_detection.ipynb
-
Run all cells, step-by-step:
- Load and display angiography image
- Denoise (median, morphological)
- Enhance edges with gradient & Laplacian
- Detect edges using Canny
- Automatically rotate vessel
- Binarize and crop region of interest
- Estimate maximum/minimum diameter
- Compute stenosis percentage
- Save result figures
The notebook uses a fully classical (non-deep learning) approach to analyze blood vessel structure:
- Denoising with filters to reduce noise artifacts
- Edge Enhancement to highlight vessel boundaries
- Auto-Rotation to align vessel horizontally
- Width Estimation by scanning white pixel runs in each row
- Stenosis Calculation using:
Stenosis (%) = (1 - D_stenosis / D_normal) × 100
- Normal diameter (max): 58 px
- Stenotic diameter (min): 1 px
- Percent stenosis: 98.28 %
This project is released under the MIT License. See LICENSE for details.
Mohammad Erfan Hasani · m_erfan_h78@yahoo.com
GitHub: @PixelErfan