Skip to content

PixelErfan/automated-stenosis-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated Stenosis Detection: Classical Image Processing Pipeline

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.

Repository Structure

.
├── 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

📂 Requirements

  • Python 3.7+
  • NumPy
  • OpenCV
  • scikit-image
  • Matplotlib
  • JupyterLab or Notebook

Install dependencies:

pip install -r requirements.txt

🚀 Usage

  1. Clone the repository

    git clone https://github.com/PixelErfan/automated-stenosis-detection.git
    cd automated-stenosis-detection
  2. Launch the Jupyter notebook

    jupyter notebook notebooks/stenosis_detection.ipynb
  3. Run all cells, step-by-step:

    1. Load and display angiography image
    2. Denoise (median, morphological)
    3. Enhance edges with gradient & Laplacian
    4. Detect edges using Canny
    5. Automatically rotate vessel
    6. Binarize and crop region of interest
    7. Estimate maximum/minimum diameter
    8. Compute stenosis percentage
    9. Save result figures

🧠 Method Overview

The notebook uses a fully classical (non-deep learning) approach to analyze blood vessel structure:

  1. Denoising with filters to reduce noise artifacts
  2. Edge Enhancement to highlight vessel boundaries
  3. Auto-Rotation to align vessel horizontally
  4. Width Estimation by scanning white pixel runs in each row
  5. Stenosis Calculation using:
    Stenosis (%) = (1 - D_stenosis / D_normal) × 100

📈 Results

  • Normal diameter (max): 58 px
  • Stenotic diameter (min): 1 px
  • Percent stenosis: 98.28 %

🖼️ Visual Output

Input Angiography Image

Input Angiography

Cropped Binary Vessel Mask

Cropped Vessel Mask

Summary Image

Summary

📄 License

This project is released under the MIT License. See LICENSE for details.

👤 Author

Mohammad Erfan Hasani · m_erfan_h78@yahoo.com
GitHub: @PixelErfan

About

Automated stenosis detection from angiography images using classical Python image-processing techniques.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published