How menzelab/implicit-shape-reconstruction works
This repository implements sparse-input 3D shape reconstruction for medical segmentation volumes, with two model choices: an implicit AutoDecoder (AD) and ReconNet (RN). The principal workflow loads configured cases, sparsifies training data, learns a model, then reconstructs dense volumes from sparse inference inputs and optionally evaluates/exports them. Separate vertebra extraction preprocessing and the adapted surface-distance metric package are supporting product capabilities. The graph follows documented workflows and sampled entry points; some internal wiring is inferred only where README or entry-point behavior supports it.
Main entry points: eval.py Inference runner · train.py Training runner · io_utils.py Volume and checkpoint I/O · data_generation.py Sparse datasets
Components 19
Data preparation
- Case splits
casename_files - Vertebra extraction
preprocessing/extract_vertebra.py - Sparse datasets
impl_recon/utils/data_generation.py
Model training
- Training settings
config_files/training - Config loading
impl_recon/utils/config_io.py - Volume and checkpoint I/O
impl_recon/utils/io_utils.py - Training runner
impl_recon/train.py - AD and ReconNet
impl_recon/models/implicits.py
Inference and evaluation
- Inference settings
config_files/inference - Inference runner
impl_recon/eval.py - Implicit sampling
impl_recon/utils/impl_utils.py - Patch inference
impl_recon/utils/patch_utils.py
Geometry and metrics
- Sampling geometry
impl_recon/utils/geometry_utils.py - Surface metrics
surface_distance/metrics.py - Surface lookup tables
surface_distance/lookup_tables.py
Other components
- Researcher
- NIfTI labels
- Model checkpoints
- Reconstructed volumes
Connections 24
- Researcher → Vertebra extraction: preprocesses
- NIfTI labels → Vertebra extraction: reads labels
- Researcher → Training runner: starts training
- Training settings → Config loading: configures
- Case splits → Sparse datasets: selects cases
- NIfTI labels → Sparse datasets: loads volumes
- Training runner → Config loading: parses settings
- Training runner → Sparse datasets: creates loaders
- Training runner → AD and ReconNet: creates model
- Training runner → Volume and checkpoint I/O: writes checkpoints
- Volume and checkpoint I/O → Model checkpoints: stores state
- Researcher → Inference runner: starts inference
- Inference settings → Config loading: configures
- Inference runner → Config loading: parses settings
- Inference runner → Sparse datasets: creates loader
- Inference runner → Volume and checkpoint I/O: loads checkpoint
- Model checkpoints → Volume and checkpoint I/O: provides state
- Inference runner → AD and ReconNet: creates model
- Inference runner → Implicit sampling: samples AD
- Implicit sampling → Sampling geometry: generates coordinates
- Inference runner → Patch inference: runs RN patches
- Inference runner → Surface metrics: evaluates masks
- Surface metrics → Surface lookup tables: uses tables
- Inference runner → Reconstructed volumes: exports volumes