diff --git a/narps_open/pipelines/team_98BT.py b/narps_open/pipelines/team_98BT.py index 3cc0675f..2c1a1911 100755 --- a/narps_open/pipelines/team_98BT.py +++ b/narps_open/pipelines/team_98BT.py @@ -706,6 +706,11 @@ def get_group_level_analysis_sub_workflow(self, method): get_equal_indifference_subjects.inputs.list_1 = get_group('equalIndifference') get_equal_indifference_subjects.inputs.list_2 = self.subject_list + # Create a function to complete the subject ids out from the get_equal_*_subjects nodes + # If not complete, subject id '001' in search patterns + # would match all contrast files with 'con_0001.nii'. + complete_subject_ids = lambda l : [f'_subject_id_{a}' for a in l] + # Function Node elements_in_string # Get contrast files for required subjects # Note : using a MapNode with elements_in_string requires using clean_list to remove @@ -778,14 +783,16 @@ def get_group_level_analysis_sub_workflow(self, method): ]) if method == 'equalRange': - group_level_analysis.connect([ - (get_equal_range_subjects, get_contrasts, [('out_list', 'elements')]) - ]) + group_level_analysis.connect( + get_equal_range_subjects, ('out_list', complete_subject_ids), + get_contrasts, 'elements' + ) elif method == 'equalIndifference': - group_level_analysis.connect([ - (get_equal_indifference_subjects, get_contrasts, [('out_list', 'elements')]) - ]) + group_level_analysis.connect( + get_equal_indifference_subjects, ('out_list', complete_subject_ids), + get_contrasts, 'elements' + ) elif method == 'groupComp': estimate_contrast.inputs.contrasts = [ @@ -812,8 +819,12 @@ def get_group_level_analysis_sub_workflow(self, method): group_level_analysis.connect([ (select_files, get_contrasts_2, [('contrasts', 'input_str')]), - (get_equal_range_subjects, get_contrasts, [('out_list', 'elements')]), - (get_equal_indifference_subjects, get_contrasts_2, [('out_list', 'elements')]), + (get_equal_range_subjects, get_contrasts, [ + (('out_list', complete_subject_ids), 'elements') + ]), + (get_equal_indifference_subjects, get_contrasts_2, [ + (('out_list', complete_subject_ids), 'elements') + ]), (get_contrasts, two_sample_t_test_design, [ (('out_list', clean_list), 'group1_files') ]),