This is the official implementation of the model introduced in the paper "3D MTransINR: a 3D Modality Translation model based on Implicit Neural Representations", which was presented in the 1st Conference of the Spanish Society of Artificial Intelligence in Biomedicine (CIABiomed 2025).
It is highly recommended to create a new environment to install the requirements so it does not affect your other projects.
pip install -r requirements.txt- Create your own dataset class in the folder data. Ensure data intensity is normalized to [-1, 1].
- Create a configuration file in configs.
- Add the required imports to your dataset class in the file train.py.
- To train the model use the following line changing the arguments as needed (they are explained in the train.py file):
python train.py --name name_of_your_experiment --config_file ./configs/brats_flair_to_t1t1cet2.json --label_nc 1 --output_nc 3 --batchSize 1 --L1_loss --hr_depth 5 --hr_width 64 --latent_dim 256 --use_gan --latent_code_regularization --checkpoints_dir /path/to/dir/ --encoder resunet --lr 0.0001 --lr_scheduler constant --niter 400If you have a computing time limit, you may resume the training with the option "--continue_train":
python train.py --name name_of_your_experiment --config_file ./configs/brats_flair_to_t1t1cet2.json --label_nc 1 --output_nc 3 --batchSize 1 --L1_loss --hr_depth 5 --hr_width 64 --latent_dim 256 --use_gan --latent_code_regularization --checkpoints_dir /path/to/dir/ --encoder resunet --lr 0.0001 --lr_scheduler constant --niter 400 --continue_trainNote that Weights and Biases (W&B) is used to monitor the training. If you do not have an account and do not wish to create one, comment all the code that refers to the wandb library and remember to save all the information so you can monitor the process.
- To test the model use the test.py file with the arguments that match the training process.
The model architecture is the following:
For more information, please read the article.
This code is based on CoNeS.
The code of the 3D Residual U-Net has been extracted from pytorch-3dunet.
