Supporting code for reproducing Biomechanical Constraints Assimilation in Deep-Learning Image Registration: Application to sliding and locally rigid deformations
conda create --name biomechanical_DLIR python=3.10conda activate biomechanical_DLIRpip install -r requirements.txt
Download Learn2Reg AbdomenCTCT data and preprocess (skip to Training Script)
Part of our results were obtained on the Learn2Reg AbdomenCTCT dataset.
- Download data : (or manually here )
mkdir Datasets/wget -P Datasets/ https://cloud.imi.uni-luebeck.de/s/32WaSRaTnFk2JeT/download/AbdomenCTCT.ziporcurl ...unzip Datasets/AbdomenCTCT.zip -d Datasets/rm -r Datasets/AbdomenCTCT.zip
- Generate regularization masks indicating which loss (rigidity,strain,Jacobian) to use for every voxel, as well as the sliding motion directions:
python AbdomenCTCT_data_generation/reorient_images.pypython AbdomenCTCT_data_generation/segmentTotalSegmentator.py-> Note that GPU usage is highly recommended..python AbdomenCTCT_data_generation/make_physics_loss_masks.py
You should now have the complete dataset under Datasets/AbdomenCTCT_reoriented/ including a /segmentationsTr folder.
Model architectures, training orchestration and dataset configurations are handled through a json file. The main training script then executes the desired training. We provide all the configurations used for our hyper-parameter grid-search, specifically:
- configurations -> scripts for synthetic rotation dataset.
- configurations -> scripts for synthetic shearing dataset.
- configurations -> scripts for AbdomenCTCT dataset.
Model training is then simply achieved by :
python biomechanical_DLIR/main.py -m biomechanical_DLIR/configs/simulated_configs_grid/RigidityDet/MSE_strainDet0_99.json
Models and logs will be saved under a new directory named results/ .
Finally, models can be evaluated with eval.py (or for full resolution on the AbdomenCTCT dataset: eval_full_res.py).
For more information:
-> python biomechanical_DLIR/main.py -h
-> python biomechanical_DLIR/eval.py -h
-> python biomechanical_DLIR/eval_full_res.py -h
Implementing a custom dataset requires adding a custom dataset class , then calling that dataset in the json object. Likewise, custom models can be added.
@misc{kheil2025biomechanicalconstraintsassimilationdeeplearning,
title={Biomechanical Constraints Assimilation in Deep-Learning Image Registration: Application to sliding and locally rigid deformations},
author={Ziad Kheil and Soleakhena Ken and Laurent Risser},
year={2025},
eprint={2504.05444},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2504.05444},
}