MedHexPlane is a research codebase for dynamic contrast-enhanced MRI (DCE‑MRI) reconstruction from undersampled, multi‑coil k‑space. We model the 4D complex image volume as an implicit neural representation over (x, y, z, t), using a HexPlane‑style factorization (learned 2D planes + an MLP decoder). Training is end‑to‑end with a differentiable forward model (coil sensitivities + NUFFT) and k‑space data‑consistency losses.
This repository is under active development. It is not a clinical tool.
At a high level:
- Sample spatiotemporal coordinates
(x, y, z, t). - Query factorized plane features (e.g.,
XY/XZ/YZandXT/YT/ZTplanes). - Decode to a coilless complex image volume.
- Apply coil sensitivity maps to form per‑coil images.
- Use NUFFT to predict k‑space samples and optimize data‑consistency + regularizers.
hexplane/: core library (model, training loop, losses, NUFFT forward model, visualization).config/: example YAML configs (OmegaConf).main.py: primary entry point (train/reconstruct).process_for_dl.py,extract_*.py: data preparation utilities (some require vendor tooling; see notes below).
Recommended: Python 3.10+ with a recent PyTorch build (GPU strongly recommended). Install PyTorch first (CPU or CUDA) via the official selector, then:
pip install -r requirements.txt
pip install -e .If you prefer an isolated environment and don’t already have micromamba, one Linux install recipe is:
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
./bin/micromamba shell init -s bash -r ~/micromamba
source ~/.bashrc
micromamba config append channels conda-forgeThen create/activate an env and install deps:
micromamba create -y -n medhex python=3.11
micromamba activate medhex
pip install -r requirements.txt
pip install -e .Run a small phantom experiment (no external data required):
python main.py config=config/phantom.yaml optim.num_iters=50Run with a prepared HDF5 (paths not included):
python main.py config=config/mri.yaml data.path=/path/to/prepared_nufft.h5Configs use OmegaConf and support CLI overrides with dot notation, e.g.:
python main.py config=config/phantom.yaml optim.num_iters=200 systems.base_dir=./logThis repo expects a prepared HDF5 containing NUFFT trajectories, sampled k‑space, and coil sensitivity maps. The extract_*.py utilities include code paths that depend on vendor‑specific tooling (e.g., Philips precon) and are provided as reference; they are not required for running phantom experiments.
This project is strongly influenced by HexPlane and related implicit representation work. See LICENSE for licensing details.