Dynamic contrast-enhanced (DCE) breast MRI is a sensitive screening modality, but it is slow, expensive, and requires intravenous injection of a gadolinium-based contrast agent. Synthetic contrast enhancement aims to remove the dependency on contrast agent injection by generating post-contrast sequences from a pre-contrast acquisition, cutting scan time and cost while avoiding contrast-agent exposure.
However, contrast enhancement is a physical process that unfolds over time, yet DCE acquisitions are temporally sparse and non-uniformly sampled, i.e., MRIs are only taken at specific timestamps, not as a dense video. Therefore, DCE modeling does not simply involve producing a single plausible post-contrast frame, but producing a temporally consistent trajectory.
TeNCA (Temporal Neural Cellular Automata) reframes this contrast modeling as an iterative cellular-automata update, where the number of NCA steps maps to elapsed physical time.
TeNCA/
├── config/
│ └── <model>.yaml # experiment configuration (model / training / data)
├── data/ # dataset root, see "Data"
├── src/
│ ├── dataset.py # PyTorch Dataset
│ ├── metrics.py # MSE / MAE / SSIM-MAE losses, masked SSIM, masked FID
│ ├── utils.py # helper functions for logging
│ ├── nca/
│ │ ├── model.py # NCA model
│ │ └── trainer.py # NCA training loop
│ └── unet/
│ ├── unet.py # U-Net baseline
│ └── trainer.py # U-Net training loop
│
├── utils/ # data preparation (download, patchify, train-test split, ...)
├── main.py # run models
├── requirements.txt # Python dependencies
├── LICENSE # Apache-2.0
└── README.md
git clone https://github.com/LangDaniel/TeNCA.git
cd TeNCA
# recommended: isolated environment
conda create -n tenca python=3.12 -y
conda activate tenca
pip install -r requirements.txtpython main.py config/<model>.ymlParameters can be adjusted in the config/<model>.yml file, with config/nca.yml and config/unet.yml reproducing the paper's setup.
main.py creates a timestamped run directory under output.output_dir, snapshots the config and source files for reproducibility, then builds and trains the selected model.
If you use this code or build on TeNCA, please cite:
@inproceedings{lang2025temporal,
title={Temporal Neural Cellular Automata: Application to modeling of contrast enhancement in breast MRI},
author={Lang, Daniel M and Osuala, Richard and Spieker, Veronika and Lekadir, Karim and Braren, Rickmer and Schnabel, Julia A},
booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
pages={604--614},
year={2025},
organization={Springer}
}