diff --git a/clinica/pipelines/dwi/preprocessing/fmap/pipeline.py b/clinica/pipelines/dwi/preprocessing/fmap/pipeline.py index c016b569d..dc94e7b9a 100644 --- a/clinica/pipelines/dwi/preprocessing/fmap/pipeline.py +++ b/clinica/pipelines/dwi/preprocessing/fmap/pipeline.py @@ -139,9 +139,7 @@ def _build_input_node(self): if len(self.subjects): print_images_to_process(self.subjects, self.sessions) cprint( - f"List available in {self.base_dir / self.name / 'participants.tsv'}" - ) - cprint( + f"List available in {self.base_dir / self.name / 'participants.tsv'}\n" "Computational time will depend of the number of volumes in your DWI dataset and the use of CUDA." ) diff --git a/clinica/pipelines/statistics_surface/pipeline.py b/clinica/pipelines/statistics_surface/pipeline.py index 7939898ec..45c45eaaf 100644 --- a/clinica/pipelines/statistics_surface/pipeline.py +++ b/clinica/pipelines/statistics_surface/pipeline.py @@ -114,6 +114,7 @@ def get_output_fields(self) -> List[str]: def _build_input_node(self): """Build and connect an input node to the pipeline.""" from clinica.utils.exceptions import ClinicaException + from clinica.utils.input_files import QueryPattern from clinica.utils.inputs import clinica_list_of_files_reader # Check if already present in CAPS @@ -133,26 +134,28 @@ def _build_input_node(self): ) # Check input files - surface_query = [] + patterns: list[QueryPattern] = [] # clinica_files_reader expects regexp to start at subjects/ so sub-*/ses-*/ is removed here fwhm = str(self.parameters["full_width_at_half_maximum"]) for direction, hemi in zip(["left", "right"], ["lh", "rh"]): cut_pattern = "sub-*/ses-*/" query = {"subject": "sub-*", "session": "ses-*", "hemi": hemi, "fwhm": fwhm} pattern_hemisphere = self.parameters["custom_file"] % query - surface_based_info = { - "pattern": pattern_hemisphere[ - pattern_hemisphere.find(cut_pattern) + len(cut_pattern) : - ], - "description": f"surface-based features on {direction} hemisphere at FWHM = {fwhm}", - } - surface_query.append(surface_based_info) + patterns.append( + QueryPattern( + pattern_hemisphere[ + pattern_hemisphere.find(cut_pattern) + len(cut_pattern) : + ], + f"surface-based features on {direction} hemisphere at FWHM = {fwhm}", + "", + ) + ) try: clinica_list_of_files_reader( self.subjects, self.sessions, self.caps_directory, - surface_query, + patterns, ) except ClinicaException as e: raise RuntimeError(e) diff --git a/clinica/pipelines/t1_volume_parcellation/t1_volume_parcellation_pipeline.py b/clinica/pipelines/t1_volume_parcellation/t1_volume_parcellation_pipeline.py index 284df607b..697bb8514 100644 --- a/clinica/pipelines/t1_volume_parcellation/t1_volume_parcellation_pipeline.py +++ b/clinica/pipelines/t1_volume_parcellation/t1_volume_parcellation_pipeline.py @@ -49,9 +49,9 @@ def _build_input_node(self): import nipype.interfaces.utility as nutil import nipype.pipeline.engine as npe - from clinica.utils.exceptions import ClinicaCAPSError, ClinicaException - from clinica.utils.input_files import t1_volume_template_tpm_in_mni - from clinica.utils.inputs import clinica_file_filter, clinica_file_reader + from clinica.utils.exceptions import ClinicaException + from clinica.utils.input_files import QueryPatternName, query_pattern_factory + from clinica.utils.inputs import clinica_file_filter from clinica.utils.stream import cprint from clinica.utils.ux import ( print_groups_in_caps_directory, @@ -66,16 +66,16 @@ def _build_input_node(self): f"Group {self.parameters['group_label']} does not exist. " "Did you run t1-volume or t1-volume-create-dartel pipeline?" ) - + pattern = query_pattern_factory(QueryPatternName.T1_VOLUME_TEMPLATE_TPM_IN_MNI)( + group_label=self.parameters["group_label"], + tissue_number=1, + modulation=self.parameters["modulate"], + ) gm_mni, self.subjects, self.sessions = clinica_file_filter( self.subjects, self.sessions, self.caps_directory, - t1_volume_template_tpm_in_mni( - group_label=self.parameters["group_label"], - tissue_number=1, - modulation=self.parameters["modulate"], - ), + pattern, ) read_parameters_node = npe.Node(