build-small-hackathon/ct-app
2
๐ฉป CT Report Generator
An automated 3D volumetric reporting pipeline for CT scans, powered by TotalSegmentator (3D U-Net) (โก ~30 Million Total Parameters) โ deployed serverlessly on Modal.
๐บ [Watch the full video demo and post on X (Twitter)!](https://x.com/AKIS23820044161/status/2066586748541657272)
Special Bonus Targets : Tiny Titan (~30M parameters model) ยท Off-Brand Award
๐ Overview
CT report generator is a Gradio-based clinical dashboard that automates the extraction and quantification of anatomical structures from 3D CT scans. It processes raw .nii / .nii.gz volumetric data, calculates the exact volume of dozens of internal organs, and automatically flags any measurements that fall outside of expected healthy reference ranges (e.g., hepatomegaly, splenomegaly, or asymmetrical kidneys).
๐ Features
๐ค AI Models Used
1. TotalSegmentator โ 3D Anatomical Segmentation
- Architecture: 3D U-Net (nnU-Net framework)
- Total Parameters: ~30 Million (30M)
- Task: 3D medical image segmentation.
- Used for: Identifying and calculating the exact cubic centimeter (cmยณ) volume of 100+ anatomical structures from raw CT scans.
- Inference: Fast-mode enabled for rapid screening on Modal A10G GPU.
๐๏ธ Architecture
GRADIO FRONTEND (app.py)
โโโ 3D Visualization โ nibabel + PIL (Mid-axial slice rendering)
โโโ Validation โ Checks for valid 3D shape and intensity spread
โโโ PDF Generation โ WeasyPrint HTML-to-PDF conversion
โโโ Remote RPC โ Connects to Modal backend via `modal.Cls`
MODAL SERVERLESS BACKEND (backend.py)
โโโ Segmenter [A10G] โ `TotalSegmentator` subprocess
โ JSON parsing & Reference Range Logic
โ Returns structured clinical findings๐ฅ๏ธ GPU Resources (Modal)
โ๏ธ Setup & Deployment
# 1. Install dependencies
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# 2. Deploy Modal backend
modal deploy backend.py
# 3. Run the Gradio frontend
python app.py