diff --git a/narps_open/pipelines/team_4TQ6.py b/narps_open/pipelines/team_4TQ6.py index 93906ac5..409a4805 100644 --- a/narps_open/pipelines/team_4TQ6.py +++ b/narps_open/pipelines/team_4TQ6.py @@ -429,6 +429,19 @@ def get_group_level_analysis_sub_workflow(self, method): ) group_level.connect(select_files, 'cope', get_copes, 'input_str') + # Function Node elements_in_string + # Get masks for these subjects + # Note : using a MapNode with elements_in_string requires using clean_list to remove + # None values from the out_list + get_masks = MapNode(Function( + function = elements_in_string, + input_names = ['input_str', 'elements'], + output_names = ['out_list'] + ), + name = 'get_masks', iterfield = 'input_str' + ) + group_level.connect(select_files, 'masks', get_masks, 'input_str') + # Function Node elements_in_string # Get variance of the estimated copes (varcope) for these subjects # Note : using a MapNode with elements_in_string requires using clean_list to remove @@ -455,7 +468,7 @@ def get_group_level_analysis_sub_workflow(self, method): # Merge Node - Merge masks for further intersection merge_masks = Node(Merge(), name = 'merge_masks') merge_masks.inputs.dimension = 't' - group_level.connect(select_files, 'masks', merge_masks, 'in_files') + group_level.connect(get_masks, ('out_list', clean_list), merge_masks, 'in_files') # MultiImageMaths Node - Create a group mask by # computing the intersection of all subject masks. @@ -517,6 +530,7 @@ def get_group_level_analysis_sub_workflow(self, method): get_group_subjects.inputs.list_2 = self.subject_list group_level.connect(get_group_subjects, 'out_list', get_copes, 'elements') group_level.connect(get_group_subjects, 'out_list', get_varcopes, 'elements') + group_level.connect(get_group_subjects, 'out_list', get_masks, 'elements') # Function Node get_one_sample_t_test_regressors # Get regressors in the equalRange and equalIndifference method case @@ -537,6 +551,7 @@ def get_group_level_analysis_sub_workflow(self, method): # Indeed the SelectFiles node asks for all (*) subjects available get_copes.inputs.elements = self.subject_list get_varcopes.inputs.elements = self.subject_list + get_masks.inputs.elements = self.subject_list # Setup a two sample t-test specify_model.inputs.contrasts = [