Skip to content

Commit

Permalink
Select masks from subjects in the analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
bclenet committed Jun 13, 2024
1 parent 74b432c commit 38ba3bb
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion narps_open/pipelines/team_4TQ6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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 = [
Expand Down

0 comments on commit 38ba3bb

Please sign in to comment.