Skip to content

Commit

Permalink
fix BIDS file format for pet (aramis-lab#545)
Browse files Browse the repository at this point in the history
* fix BIDS file format

* unit test pet_linear_nii
  • Loading branch information
thibaultdvx authored Mar 22, 2024
1 parent 1d789af commit a8f2ea5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clinicadl/utils/clinica_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
30 changes: 30 additions & 0 deletions tests/unittests/utils/test_clinica_utils.py
Original file line number Diff line number Diff line change
@@ -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,
}

0 comments on commit a8f2ea5

Please sign in to comment.