Skip to content
Simone Chiarella edited this page Aug 8, 2024 · 2 revisions

Welcome to the Causality-Medical-Image-Domain-Generalization wiki (sim1-99's version)

This wiki gives some hints to better understand and use the sim1-99's forked version.

NOTE: This version was tested only on Python 3.7. More recent versions of Pythons are not compatible with the code and its dependencies. Requirements list could be missing of a couple of packages.

The two main changes with respect to the original code version are:

  1. Implementation of the fetal dataset option
  2. Give up of the original segmentation task in favor of the GIN and GIN-IPA 3D data augmentation

1. Fetal Dataset

  • dataloaders/FetalDataset.py is a loader for fetal MRI nifti images with 8 labels. Since segmentation is not the target, train-val-test split is [1.0, 0.0, 0.0].

  • data/fetal_resample.py resamples the images to a given size.

2. Data Augmentation

  • exp_scripts/feta_gin_ipa.sh sets the setting for running the algorithm. EXP_TYPE determines if GIN or GIN-IPA is run. ALL_TRS set the domains the augmentation is performed on.

  • Input images and labels have to be stored in a same folder having the same name as the chosen domain (i.e. "C"). Furthermore, images and labels must have names like image_*.nii.gz and label_*.nii.gz, respectively. exp_scripts/copy_and_rename.py can be adapted to do exactly that.

  • configs_exp.py specifies a lot of settings which are mostly overwritten by the settings in exp_scripts/feta_gin_ipa.sh. Take a look at them, though.

  • dev_traintest_ginipa.py and models/exp_trainer.py were heavily modified to give up segmentation and store the augmented 3D images.