Skip to content

Commit

Permalink
couple fxes
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGensollen committed Oct 7, 2024
1 parent 2ce9a46 commit 1f08ae1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
4 changes: 2 additions & 2 deletions clinica/pipelines/pet/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def _check_pipeline_parameters(self) -> None:

def _get_pet_scans_query(self) -> QueryPattern:
"""Return the query to retrieve PET scans."""
from clinica.utils.input_files import bids_pet_nii
from clinica.utils.input_files import get_pet_nifti

return bids_pet_nii(
return get_pet_nifti(
self.parameters["acq_label"], self.parameters["reconstruction_method"]
)
28 changes: 16 additions & 12 deletions clinica/pipelines/statistics_volume/statistics_volume_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from typing import List

from clinica.pipelines.engine import Pipeline
from clinica.utils.input_files import (
QueryPattern,
QueryPatternName,
query_pattern_factory,
)
from clinica.utils.pet import SUVRReferenceRegion, Tracer


Expand Down Expand Up @@ -96,10 +101,6 @@ def _build_input_node(self):
import nipype.pipeline.engine as npe

from clinica.utils.exceptions import ClinicaException
from clinica.utils.input_files import (
pet_volume_normalized_suvr_pet,
t1_volume_template_tpm_in_mni,
)
from clinica.utils.inputs import clinica_file_filter
from clinica.utils.stream import cprint
from clinica.utils.ux import print_begin_image, print_images_to_process
Expand All @@ -117,8 +118,10 @@ def _build_input_node(self):
)

self.parameters["measure_label"] = self.parameters["acq_label"].value
information_dict = pet_volume_normalized_suvr_pet(
acq_label=self.parameters["acq_label"],
pattern = query_pattern_factory(
QueryPatternName.PET_VOLUME_NORMALIZED_SUVR
)(
tracer=self.parameters["acq_label"],
group_label=self.parameters["group_label_dartel"],
suvr_reference_region=self.parameters["suvr_reference_region"],
use_brainmasked_image=True,
Expand All @@ -127,7 +130,9 @@ def _build_input_node(self):
)
elif self.parameters["orig_input_data_volume"] == "t1-volume":
self.parameters["measure_label"] = "graymatter"
information_dict = t1_volume_template_tpm_in_mni(
pattern = query_pattern_factory(
QueryPatternName.T1_VOLUME_TEMPLATE_TPM_IN_MNI
)(
group_label=self.parameters["group_label_dartel"],
tissue_number=1,
modulation=True,
Expand All @@ -141,17 +146,16 @@ def _build_input_node(self):
)
# If custom file are grabbed, information of fwhm is irrelevant and should not appear on final filenames
self.parameters["full_width_at_half_maximum"] = None
information_dict = {
"pattern": self.parameters["custom_file"],
"description": "custom file provided by user",
}
pattern = QueryPattern(
self.parameters["custom_file"], "custom file provided by user", ""
)
else:
raise ValueError(
f"Input data {self.parameters['orig_input_data_volume']} unknown."
)

input_files, self.subjects, self.sessions = clinica_file_filter(
self.subjects, self.sessions, self.caps_directory, information_dict
self.subjects, self.sessions, self.caps_directory, pattern
)

read_parameters_node = npe.Node(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,14 @@ def _build_input_node(self):
import nipype.interfaces.utility as nutil
import nipype.pipeline.engine as npe

from clinica.utils.input_files import QueryPattern
from clinica.utils.inputs import clinica_group_reader

t_map = clinica_group_reader(
self.caps_directory,
{
"pattern": self.parameters["t_map"] + "*",
"description": "statistics t map",
"needed_pipeline": "statistics-volume",
},
QueryPattern(
self.parameters["t_map"] + "*", "statistics t map", "statistics-volume"
),
)

read_parameters_node = npe.Node(
Expand Down

0 comments on commit 1f08ae1

Please sign in to comment.