By Yihong Chen, Jiancheng Yang, Deniz Sayin Mercadier, Hieu Le, Juerg Schwitter, Pascal Fua.
This repo is an official implementation of the paper "End-to-End 4D Heart Mesh Recovery Across Full-Stack and Sparse Cardiac MRI" accepted by TMLR.
TetHeart is an end-to-end framework for unified 4D (3D + time) heart mesh recovery from both offline full-stack and intra-procedural sparse-slice cardiac MRI. Using deformable tetrahedra to model shape and motion in a coherent space shared across cardiac structures, it initializes detailed patient-specific meshes from high-quality full stacks and updates them from whatever slices are available in real-time, down to a single one.
Please refer to INSTALL.md for installation instructions.
We use the public ACDC, M&Ms, M&Ms-2 datasets. Please find at here for the private dataset we use.
Please refer to Bi-ventricle SSM and 4DMR to prepare GT meshes. After generation, you may need to register the meshes to the MRI image coordinate system.
Set DATA_ROOT at the top of each tools/preprocess/handle_*.py to the directory that holds the raw datasets. Then, for each dataset, first convert it into the nnU-Net/MSD layout (handle_*) and then preprocess it into the per-patient .npy volumes consumed by the configs (preprocess):
# ACDC
python tools/preprocess/handle_acdc.py --task acdc
python tools/preprocess/preprocess.py --task 914 --n_jobs 4
# M&Ms
python tools/preprocess/handle_mm.py --task mm
python tools/preprocess/preprocess.py --task 933 --n_jobs 4
# M&Ms-2
python tools/preprocess/handle_mm2.py --task mm2
python tools/preprocess/preprocess.py --task 943 --n_jobs 4The handle_* step writes the MSD folders under data/, and the preprocess step writes the final data/{914,933,943}_3d/ folders. If you would rather keep the data elsewhere, point target_path (in handle_*) and --results (in preprocess) at another location and symlink it to ./data.
For the private dataset, please refer to ukbb_cardiac to process the DICOM data first.
We provide a sample processed data from the ACDC dataset as reference.
python tools/train.py configs/debug.pypython tools/test.py <config> <checkpoint> --evalpython tools/test.py <config> <checkpoint> --show --show-dir <output_dir>Configs live under configs/. At there you could find some other configs for datasets like CHAOS and MMWHS. Our model can also achieve good static reconstruction results.
If you want to modify something, simply add new models, datasets, metrics and register them. Then create a new config and you are ready to go.
We thank NVIDIA nnU-Net for its well-structured and extensible nnU-Net implementation, and MMCV for its flexible configuration system.
If you find this work useful in your research, please consider citing:
@article{chen2026tetheart,
title = {End-to-End 4D Heart Mesh Recovery Across Full-Stack and Sparse Cardiac MRI},
author = {Chen, Yihong and Yang, Jiancheng and Mercadier, Deniz Sayin and Le, Hieu and Schwitter, Juerg and Fua, Pascal},
journal = {Transactions on Machine Learning Research (TMLR)},
year = {2026}
}