How rosalindfranklininstitute/volume-segmantics works
Volume Segmantics trains 2D segmentation models from labeled 3D volumes, then applies those models to segment new volumes. Training slices and augments data, configures a model and optional multitask heads, and optimizes it; prediction runs across configured axes and rotations, assembles results, and writes volume outputs. The README also documents 2.5D slicing, DINO encoders, and configurable multitask training. Some subsystem links are dashed because their implementation was not sampled.
Main entry points: vol_seg_2d_trainer.py 2D trainer · api.py Prediction API · model_2d.py Segmentation models · dataloaders.py Data loaders
Components 27
Data preparation
- Volume slicer
volume_segmantics/data/slicers.py - Data loaders
volume_segmantics/data/dataloaders.py - Pipeline dataset
volume_segmantics/data/pipeline_dataset.py - Target generation
volume_segmantics/data/targets
Model training
- Training command
volume_segmantics/scripts/train_2d_model.py - 2D trainer
volume_segmantics/model/operations/vol_seg_2d_trainer.py - Model manager
volume_segmantics/model/operations/trainer_model_manager.py - Segmentation models
volume_segmantics/model/model_2d.py - DINO encoder
volume_segmantics/model/encoders/dino_encoder.py - Multitask heads
volume_segmantics/model/heads - Loss functions
volume_segmantics/model/operations/trainer_losses.py - Semi-supervised training
volume_segmantics/model/training/mean_teacher.py
Volume prediction
- Prediction API
volume_segmantics/api.py - 2D predictor
volume_segmantics/model/operations/vol_seg_2d_predictor.py - Prediction manager
volume_segmantics/model/operations/vol_seg_prediction_manager.py - Inference modes
volume_segmantics/prediction/inference_modes.py - Per-axis prediction
volume_segmantics/prediction/per_axis_instances.py - Volume writer
volume_segmantics/prediction/writer.py
Result assembly
- Assembly interface
volume_segmantics/inference/instance_assembly/base.py - Prediction bundle
volume_segmantics/inference/instance_assembly/prediction_bundle.py - Watershed assembly
volume_segmantics/inference/instance_assembly/watershed_3d.py - uSegment3D assembly
volume_segmantics/inference/instance_assembly/usegment3d.py
Configuration and utilities
- Pipeline configuration
volume_segmantics/data/pipeline_loader.py - Pipeline registries
volume_segmantics/data/pipeline_registry.py - Volume I/O
volume_segmantics/utilities/base_data_utils.py - Runtime settings
volume_segmantics/utilities/config.py
Other components
- Researcher
Connections 28
- Researcher → Training command: starts training
README.md - Training command → 2D trainer: invokes
- 2D trainer → Data loaders: loads batches
volume_segmantics/model/operations/vol_seg_2d_trainer.py - 2D trainer → Model manager: configures model
volume_segmantics/model/operations/vol_seg_2d_trainer.py - 2D trainer → Loss functions: uses losses
volume_segmantics/model/operations/vol_seg_2d_trainer.py - 2D trainer → Semi-supervised training: supports training
volume_segmantics/model/operations/vol_seg_2d_trainer.py - 2D trainer → Pipeline configuration: loads configuration
volume_segmantics/model/operations/vol_seg_2d_trainer.py - Model manager → Segmentation models: creates model
volume_segmantics/model/operations/trainer_model_manager.py - Segmentation models → DINO encoder: selects encoder
volume_segmantics/model/model_2d.py - Segmentation models → Multitask heads: builds heads
volume_segmantics/model/model_2d.py - Pipeline configuration → Pipeline registries: resolves components
volume_segmantics/data/pipeline_loader.py - Pipeline dataset → Target generation: generates targets
volume_segmantics/data/pipeline_dataset.py - Pipeline dataset → Pipeline configuration: uses configuration
volume_segmantics/data/pipeline_dataset.py - Researcher → Prediction API: requests prediction
README.md - Prediction API → 2D predictor: invokes
volume_segmantics/api.py - 2D predictor → Data loaders: loads slices
volume_segmantics/model/operations/vol_seg_2d_predictor.py - Prediction manager → 2D predictor: delegates prediction
volume_segmantics/model/operations/vol_seg_prediction_manager.py - Prediction API → Per-axis prediction: supports axis prediction
volume_segmantics/api.py - Prediction API → Prediction bundle: builds bundle
volume_segmantics/api.py - Per-axis prediction → Assembly interface: uses assembly
volume_segmantics/prediction/per_axis_instances.py - uSegment3D assembly → Assembly interface: implements interface
volume_segmantics/inference/instance_assembly/usegment3d.py - uSegment3D assembly → Prediction bundle: consumes bundle
volume_segmantics/inference/instance_assembly/usegment3d.py - Watershed assembly → Assembly interface: implements interface
volume_segmantics/inference/instance_assembly/watershed_3d.py - Prediction API → Volume writer: writes output
- Volume writer → Volume I/O: serializes volume
- Prediction API → Inference modes: selects prediction mode
- Data loaders → Volume slicer: uses volume slices
- Researcher → Runtime settings: provides settings
README.md