From 8afcddf912afe57eb32206aac9e5cd6790362f06 Mon Sep 17 00:00:00 2001 From: NicolasGensollen Date: Thu, 7 Nov 2024 11:02:11 +0100 Subject: [PATCH] more fixes --- .../pipelines/pet_surface/pet_surface_pipeline.py | 2 +- .../t1_volume_create_dartel_pipeline.py | 14 ++++++++------ clinica/utils/input_files.py | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/clinica/pipelines/pet_surface/pet_surface_pipeline.py b/clinica/pipelines/pet_surface/pet_surface_pipeline.py index 5140095b7..b51e0599c 100644 --- a/clinica/pipelines/pet_surface/pet_surface_pipeline.py +++ b/clinica/pipelines/pet_surface/pet_surface_pipeline.py @@ -212,7 +212,7 @@ def _build_input_node_cross_sectional(self): if pet_errors: all_errors.append(format_clinica_file_reader_errors(pet_errors)) - patterns = [query_pattern_factory(QueryPatternName.T1_FREESURFER_ORIG_NU)] + patterns = [query_pattern_factory(QueryPatternName.T1_FREESURFER_ORIG_NU)()] patterns.extend( [ query_pattern_factory( diff --git a/clinica/pipelines/t1_volume_create_dartel/t1_volume_create_dartel_pipeline.py b/clinica/pipelines/t1_volume_create_dartel/t1_volume_create_dartel_pipeline.py index f4efd2215..5fa9f5c57 100644 --- a/clinica/pipelines/t1_volume_create_dartel/t1_volume_create_dartel_pipeline.py +++ b/clinica/pipelines/t1_volume_create_dartel/t1_volume_create_dartel_pipeline.py @@ -51,7 +51,7 @@ def _build_input_node(self): import nipype.pipeline.engine as npe from clinica.utils.exceptions import ClinicaException - from clinica.utils.input_files import t1_volume_dartel_input_tissue + from clinica.utils.input_files import QueryPatternName, query_pattern_factory from clinica.utils.inputs import clinica_list_of_files_reader from clinica.utils.stream import cprint from clinica.utils.ux import ( @@ -91,16 +91,18 @@ def _build_input_node(self): fields=self.get_input_fields(), mandatory_inputs=True ), ) - + patterns = [ + query_pattern_factory(QueryPatternName.T1_VOLUME_DARTEL_INPUT_TISSUE)( + tissue_number + ) + for tissue_number in self.parameters["dartel_tissues"] + ] try: d_input = clinica_list_of_files_reader( self.subjects, self.sessions, self.caps_directory, - [ - t1_volume_dartel_input_tissue(tissue_number) - for tissue_number in self.parameters["dartel_tissues"] - ], + patterns, ) # d_input is a list of size len(self.parameters['dartel_tissues']) # Each element of this list is a list of size len(self.subjects) diff --git a/clinica/utils/input_files.py b/clinica/utils/input_files.py index f099ec459..1afed92dc 100644 --- a/clinica/utils/input_files.py +++ b/clinica/utils/input_files.py @@ -303,7 +303,7 @@ def get_dwi_preprocessed_brainmask(*args, **kwargs) -> QueryPattern: def get_dwi_fmap_phasediff_file(filetype: Union[str, DWIFileType]) -> QueryPattern: filetype = DWIFileType(filetype) return QueryPattern( - f"fmap/sub-*_ses-*_phasediff.{filetype.value}", + f"fmap/sub-*_ses-*_phasediff.{filetype.value}*", f"phasediff {filetype.value} file", "", )