An interactive web application for automated MRI brain tissue segmentation, analysis and clinical report generation.
Upload any NIfTI MRI scan and instantly get:
- Real-time brain slice navigation
- Automated tissue segmentation
- Clinical measurements
- Downloadable PDF report
- Upload any MRI scan — supports .nii and .nii.gz formats
- Interactive slice viewer — navigate through all brain slices with a slider
- Automatic segmentation — K-means clustering classifies tissue instantly
- Clinical measurements — voxel counts, percentages, signal intensities
- Tissue distribution chart — pie chart showing brain composition
- PDF report generation — professional clinical report with one click
- 🔵 Background — area outside the brain
- 🔴 Grey Matter — outer brain tissue (thinking regions)
- 🟡 White Matter — inner brain connections
- Python 3.13
- Streamlit — web application framework
- NiBabel — MRI file handling
- Scikit-learn — K-means clustering for segmentation
- NumPy & Pandas — numerical analysis
- Matplotlib — visualisation and charts
- ReportLab — automated PDF report generation
- Nilearn — neuroimaging datasets
git clone https://github.com/kuljit-medtech/MRI-webapp.git
cd MRI-webapp
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install streamlit nibabel nilearn matplotlib numpy scipy scikit-learn reportlab pandasstreamlit run app.pyThen open your browser at http://localhost:8501
Upload any NIfTI MRI file (.nii or .nii.gz) and the app will automatically:
- Load and display the scan
- Segment brain tissue
- Show measurements
- Generate a PDF report
- NIfTI (.nii)
- Compressed NIfTI (.nii.gz)
- OpenNeuro — real anonymised research scans
- IXI Dataset — 600 real brain MRI scans
- BrainWeb — simulated brain MRI
Developed by Kuljit Singh — MS student at Otto Von Guericke University, Magdeburg, Germany.
Part of a medical imaging portfolio focusing on MRI processing, quality assurance and AI-based analysis.
- 🔗 GitHub
- 🔗 MRI Brain Viewer
