How wwu-mmll/deepbet works
deepbet is a neural-network tool for extracting brain masks from T1-weighted MRI, exposed through a Python API, CLI, and GUI. Users select input images, output destinations, and optional threshold/dilation settings; the shared runner validates files and invokes brain extraction. Extraction uses a bounding-box model before full-resolution segmentation, then postprocesses the mask and saves requested brain images, masks, and TIV values. Utilities handle model loading, normalization, image orientation, masking, and connected components. Workflow details are based on the sampled source; the README also documents the same outputs and controls.
Main entry points: bet.py Brain Extraction · utils.py Image Operations · cli.py CLI · gui.py GUI
Components 18
Extraction Workflow
- Batch Runner
deepbet/bet.py - Brain Extraction
deepbet/bet.py - MRI Preparation
deepbet/bet.py - Crop Selection
deepbet/bet.py - Mask Postprocessing
deepbet/bet.py - Output Saving
deepbet/bet.py - Brain, Mask, TIV
deepbet/bet.py
Model Inference
- BBox Inference
deepbet/bet.py - BBox Model
data/models/bbox_model.pt - Brain Inference
deepbet/bet.py - Segmentation Model
data/models/model.pt
Image Utilities
- File Validation
deepbet/utils.py - Image Operations
deepbet/utils.py
Other components
- User
- Python Caller
- MRI Files
Connections 21
- User → CLI: runs
- User → GUI: runs
- Python Caller → Batch Runner: calls
- CLI → Batch Runner: calls
- GUI → Batch Runner: calls
- MRI Files → Batch Runner: supplies
- Batch Runner → File Validation: checks files
- Batch Runner → Brain Extraction: invokes
- Brain Extraction → MRI Preparation: loads and orients
- Brain Extraction → BBox Inference: calls
- BBox Inference → BBox Model: runs
- BBox Inference → Image Operations: normalizes
- BBox Inference → Crop Selection: selects bounds
- Crop Selection → Brain Inference: sets crop
- Brain Inference → Segmentation Model: runs
- Brain Inference → Image Operations: normalizes
- Brain Extraction → Mask Postprocessing: thresholds mask
- Mask Postprocessing → Image Operations: cleans and dilates
- Brain Extraction → Image Operations: applies mask and reorients
- Brain Extraction → Output Saving: saves outputs
- Output Saving → Brain, Mask, TIV: writes