From bfaab327b83efee016c0530cd710b81afbd3744a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Cl=C3=A9net?= Date: Mon, 15 Apr 2024 14:53:41 +0200 Subject: [PATCH] Mask computation for group level --- narps_open/pipelines/team_B5I6.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/narps_open/pipelines/team_B5I6.py b/narps_open/pipelines/team_B5I6.py index 84e53a20..4a66be47 100644 --- a/narps_open/pipelines/team_B5I6.py +++ b/narps_open/pipelines/team_B5I6.py @@ -562,14 +562,16 @@ def get_group_level_analysis_sub_workflow(self, method): # Split Node - Split mask list to serve them as inputs of the MultiImageMaths node. split_masks = Node(Split(), name = 'split_masks') - split_masks.inputs.splits = [1, len(self.subject_list * self.run_list) - 1] + split_masks.inputs.splits = [1, (len(self.subject_list) * len(self.run_list)) - 1] split_masks.inputs.squeeze = True # Unfold one-element splits removing the list group_level.connect(get_masks, ('out_list', clean_list), split_masks, 'inlist') # MultiImageMaths Node - Create a subject mask by - # computing the intersection of all run masks. + # computing the intersection of all run masks + # (all voxels included in at least 80% of masks across all runs). mask_intersection = Node(MultiImageMaths(), name = 'mask_intersection') - mask_intersection.inputs.op_string = '-add %s ' * (len(self.subject_list) - 1) + '' + mask_intersection.inputs.op_string = '-add %s ' * (len(self.subject_list) - 1)\ + + f' -thr {len(self.subject_list) * len(self.run_list) * 0.8} -bin' group_level.connect(split_masks, 'out1', mask_intersection, 'in_file') group_level.connect(split_masks, 'out2', mask_intersection, 'operand_files')