This repository holds the code for the paper Steerable Anatomical Shape Synthesis with Implicit Neural Representations. In this work we train implicit neural representations of 3D thyroid glands, conditioned on a latent code consisting of a combination of fixed anatomical features and learned latent features. The resulting model can be used generatively by sampling random latent codes, and can be steered through the conditioning features.
The figure below shows an example application, where we edit the volume, isthmus (bridge) area and symmetry of a single thyroid independently:
Access the data used in the paper via zenodo.
The code is layed out as a package.
The easiest way to work with it, is to setup a conda environment with the environment.yml provided in this repository:
conda env create -f environment.ymlAnd then install the repository as an editable package:
conda activate thyroidsynthesis
pip install --no-build-isolation --no-deps -e .If you run Windows, we recommend using WSL.
If you downloaded the Zenodo dataset, all presampled SDF values are already available as .npz files in the sdf directory.
If you want to change the sampling, or re-run it for other meshes, run the following:
python -m thyroidsynthesis.preprocessing.sdf /path/to/ply /path/to/sdfIf you downloaded the Zenodo dataset, all presampled thyroid features values are already available in the features.csv file.
If you want to re-run this for other meshes, run the following:
python -m thyroidsynthesis.preprocessing.features /path/to/ply /path/to/output_dirThis will write a features.csv file to /path/to/output_dir.
To train a model, run:
python -m thyroidsynthesis.nn.train /path/to/data /path/to/checkpoint.ckpt --fixed_features volume,isthmus_area,symmetryThis will train a model using training settings as reported in the paper, and will save the final model to /path/to/checkpoint.ckpt.
The data folder should look like:
/path/to/data
|
ply/
|
001.ply
002.ply
...
sdf/
|
001.npz
002.npz
...
If you download our data from zenodo and unzip, this is already the case.
For inference, run:
python -m thyroidsynthesis.nn.inference /path/to/data /path/to/checkpoint.ckpt /path/to/results --fixed_features volume,isthmus_area,symmetryThis will reconstruct and generate thyroid meshes, and save them in /path/to/results.
To plot some basic analysis, similar to what is shown in the paper, run:
python -m thyroidsynthesis.nn.plot /path/to/resultsIf you use this code, please cite our arXiv paper:
@misc{dewilde2025steerableanatomicalshapesynthesis,
title={Steerable Anatomical Shape Synthesis with Implicit Neural Representations},
author={Bram de Wilde and Max T. Rietberg and Guillaume Lajoinie and Jelmer M. Wolterink},
year={2025},
eprint={2504.03313},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2504.03313},
}