How tejash09/brain-tumor works
Project type and purpose
• This is a full-stack web application for brain tumor detection and visualization.
• It uses a Flask backend that serves HTML/CSS/JS views, runs a U-Net model for 3D semantic segmentation on MRI scans, and returns interactive visualizations to the user’s browser.
File structure
• Top-level directories/files:
• app1.py / app.py / main.py – Flask application entrypoints
• requirements.txt – dependency list (Flask, TensorFlow/PyTorch, Nibabel, Plotly, Nilearn, etc.)
• model_per_class.h5 – pre-trained U-Net segmentation weights
• sampledata/… – packaged NIfTI sample MRI scans for demo
• templates/… – Jinja2 HTML templates & client-side assets (app.js, CSS, upload.html, patients.html, etc.)
• gif.py, img.py, vol.py, python_script.py – backend modules handling GIF generation, image slicing, volume calculations, plotting, etc.
• style.css, about.css – top-level static styles
• Architectural pattern: a monolithic Flask “controller” with separate “service” modules for ML inference, data processing, and visualization. The “view” layer is implemented in Jinja2 templates + client JS.
Pull extra insights from the README
• Core ML is a U-Net 3D semantic segmentation (TensorFlow/PyTorch).
• Visualization uses Plotly (3D surface, multi-slice), Nilearn (statistical plots), custom GIFs.
• Web UI: Patients page, Upload page, About page, Interactive 3D viewer.
Elements
• Blue for user‐facing components (Browser, templates)
• Green for backend compute (ML, segmentation, plotting)
• Orange for data artifacts (model file, sampledata)