How donnahooshmand/retina_painter works
RetinaPainter is a clinician-facing retinal OCT annotation and segmentation system paired with a training service. The principal workflow is to create a seeded project, review scans and paint sparse corrections, then train and view updated predictions in the painter. The trainer samples corrected tiles, applies masked segmentation loss, validates candidates, and manages checkpoints. The graph includes the documented U-Net, RETFound plain-decoder, and RFA-U-Net options, plus scan-review persistence and evaluation tools. Some connections reflect README claims or SOURCE INDEX references; unsampled code paths are not inferred beyond those references.
Main entry points: retina_painter.py Painter UI · trainer.py Project trainer · model_utils.py Model selection · create_project.py Project setup
Components 23
Annotation Workstation
- Painter UI
painter/src/main/python/retina_painter.py - Application entry
painter/src/main/python/main.py
Project And Review
- Project setup
painter/src/main/python/create_project.py - Review controls
painter/src/main/python/review_widget.py - Review persistence
painter/src/main/python/review_utils.py - Dataset preparation
painter/src/main/python/create_dataset.py - Folder segmentation
painter/src/main/python/segment_folder.py - Segmentation metrics
painter/src/main/python/plot_seg_metrics.py
Training Service
- Trainer entry
- Project trainer
trainer/src/trainer.py - Tile sampling
trainer/src/datasets.py - Image processing
trainer/src/im_utils.py - Masked loss
trainer/src/loss.py - Validation metrics
trainer/src/metrics.py
Segmentation Models
- Model selection
trainer/src/model_utils.py - U-Net
trainer/src/unet.py - RETFound decoder
trainer/src/retfound_model.py - RFA-U-Net decoder
trainer/src/retfound_rfa_model.py - RETFound ViT
trainer/src/retfound_vit.py
Other components
- Clinician
- OCT scans
- Pretrained weights
- Training instructions
Connections 26
- Clinician → Painter UI: annotates scans
- OCT scans → Project setup: selects scans
- Application entry → Painter UI: starts
painter/src/main/python/main.py - Painter UI → Project setup: creates project
painter/src/main/python/retina_painter.py - Project setup → Training instructions: configures training
painter/src/main/python/create_project.py - Painter UI → Review controls: collects decisions
painter/src/main/python/retina_painter.py - Review controls → Review persistence: persists review
painter/src/main/python/retina_painter.py - Painter UI → Review persistence: loads and saves
painter/src/main/python/retina_painter.py - Painter UI → Dataset preparation: prepares data
painter/src/main/python/retina_painter.py - Painter UI → Folder segmentation: requests segmentation
painter/src/main/python/retina_painter.py - Painter UI → Segmentation metrics: opens metrics
painter/src/main/python/retina_painter.py - Training instructions → Trainer entry: dispatches training
- Trainer entry → Project trainer: starts trainer
- Project trainer → Tile sampling: samples tiles
trainer/src/trainer.py - Tile sampling → Image processing: loads and transforms
trainer/src/datasets.py - Project trainer → Masked loss: computes objective
trainer/src/trainer.py - Project trainer → Validation metrics: validates model
trainer/src/trainer.py - Project trainer → Model selection: selects and checkpoints
trainer/src/trainer.py - Model selection → U-Net: uses
trainer/src/model_utils.py - Model selection → RETFound decoder: uses
trainer/src/model_utils.py - Model selection → RFA-U-Net decoder: uses
trainer/src/model_utils.py - RETFound decoder → RETFound ViT: encodes features
trainer/src/retfound_model.py - RFA-U-Net decoder → RETFound ViT: encodes features
trainer/src/retfound_rfa_model.py - Pretrained weights → RETFound ViT: initializes encoder
trainer/src/retfound_vit.py - Project trainer → Painter UI: returns predictions
- Clinician → Review controls: records scan decision
painter/src/main/python/review_widget.py