diff --git a/clinicadl/utils/clinica_utils.py b/clinicadl/utils/clinica_utils.py index 3cf0a5f97..16525427f 100644 --- a/clinicadl/utils/clinica_utils.py +++ b/clinicadl/utils/clinica_utils.py @@ -156,7 +156,7 @@ def pet_linear_nii( information = { "pattern": str( Path("pet_linear") - / f"*_trc-{acq_label}_pet_space-MNI152NLin2009cSym{description}_res-1x1x1_suvr-{suvr_reference_region}_pet.nii.gz" + / f"*_trc-{acq_label}_space-MNI152NLin2009cSym{description}_res-1x1x1_suvr-{suvr_reference_region}_pet.nii.gz" ), "description": "", "needed_pipeline": "pet-linear", diff --git a/tests/unittests/utils/test_clinica_utils.py b/tests/unittests/utils/test_clinica_utils.py new file mode 100644 index 000000000..3c617d199 --- /dev/null +++ b/tests/unittests/utils/test_clinica_utils.py @@ -0,0 +1,30 @@ +import pytest + + +@pytest.mark.parametrize( + "acq_label,suvr_reference_region,uncropped_image,expected_pattern", + [ + ( + "18FFDG", + "cerebellumPons2", + True, + "pet_linear/*_trc-18FFDG_space-MNI152NLin2009cSym_res-1x1x1_suvr-cerebellumPons2_pet.nii.gz", + ), + ( + "18FAV45", + "pons", + False, + "pet_linear/*_trc-18FAV45_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_suvr-pons_pet.nii.gz", + ), + ], +) +def test_pet_linear_nii( + acq_label, suvr_reference_region, uncropped_image, expected_pattern +): + from clinicadl.utils.clinica_utils import pet_linear_nii + + assert pet_linear_nii(acq_label, suvr_reference_region, uncropped_image) == { + "description": "", + "needed_pipeline": "pet-linear", + "pattern": expected_pattern, + }