From 465ad586af4f4a5bf69dc7475e3ce7ee6cf066f8 Mon Sep 17 00:00:00 2001 From: Gensollen Date: Thu, 1 Feb 2024 08:51:39 +0100 Subject: [PATCH] BUG: fix bug with DWI ADC images not removed by ADNI to BIDS (#1061) --- clinica/iotools/converters/adni_to_bids/adni_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clinica/iotools/converters/adni_to_bids/adni_utils.py b/clinica/iotools/converters/adni_to_bids/adni_utils.py index eb7fb72a1..ce8f38580 100644 --- a/clinica/iotools/converters/adni_to_bids/adni_utils.py +++ b/clinica/iotools/converters/adni_to_bids/adni_utils.py @@ -1464,7 +1464,12 @@ def create_file( # Removing images with unsupported suffixes if generated by dcm2niix for suffix in ("ADC", "real", "imaginary"): file_with_bad_suffix = output_path / f"{output_filename}_{suffix}" - if file_with_bad_suffix.with_suffix(".nii").exists(): + if any( + [ + file_with_bad_suffix.with_suffix(s).exists() + for s in (".nii", ".nii.gz") + ] + ): cprint( f"Image with bad suffix {suffix} was generated by dcm2niix " f"for subject {subject} and session {session} : "