Comparison of synthetic LGE with optimal inversion time vs. conventional LGE via representation learning: Quantification of Bias in Population Analysis
- Python 3.9+
- Clone the repository and enter it:
- git clone https://github.com/creatis-myriad/TI_selection_and_RL
cd TI_selection_and_RL/bin/
- Create a conda environment from the provided file:
- conda env create -f environment.yaml
- Activate it:
- conda activate TI_RL_env
- Data come from the MYOSAIQ challenge.
- The D8 subset was not used.
Below is the command line to get the optimal TI from the dicom files of a patient.
-
Get optimal TI
python get_TIopt.py \ --inputDir_Dicom "/directory/of/patients' dicoms " \ --inputDir_Roi "/directory/of/patients' segmentation masks " \ --method "std+sat" \ --option "std" \ --outputDir "/output/directory" -
Visualize optimal TI
The Figure 1 from the article was made with the command line below.python visu_TIopt.py \ --load_MAG_dicoms_from_dir '/your/input/dir' --load_T1_roi_file '/your/segmentation/file' --load_LGE_file '/your/input/file'
Below are the command lines to run the models:
-
VAE
python training_VAE.py \ --inputDir '/your/input/dir' \ --ref '/the/reference' \ --outputDir "/your/output/dir" \ --latent_dim 8 \ --beta 1 \ --epoch 80 \ --LR 5e-4 \ --split_data 0.15 \ --dcm 1 -
ARVAE
python training_AR-VAE.py \ --inputDir '/your/input/dir' \ --ref '/the/reference' \ --outputDir "/your/output/dir" \ --latent_dim 8 \ --nargs_wloss 2 10 2 20 \ --epoch 80 \ --LR 5e-4 \ --split_data 0.15
Here is the command line to visualize the histogram (Figure 6) and other parameters.
It needs the output from a training, the data that you want to project in the latent space and the file with optimal TIs.
-
Visualization:
python visu_FullSeq_MAG.py \ --input_LS_var 'latent_var_patients.pkl' \ --load_nn_model 'save_model' \ --inputDir '/your/input/dir' \ --data_to_project '/your/data/to/project' \ --ref 'reference.pkl' \ --TIopt 'idx_TIopt_MAG_std+sat_std.pkl' \ --ar_vae 1 \ --fMAG 1


