diff --git a/fitlins/workflows/base.py b/fitlins/workflows/base.py index d1ce2abe..ce1e4477 100644 --- a/fitlins/workflows/base.py +++ b/fitlins/workflows/base.py @@ -9,10 +9,6 @@ from ..interfaces.utils import MergeAll -def join_dict(base_dict, dict_list): - return [{**base_dict, **iter_dict} for iter_dict in dict_list] - - def init_fitlins_wf(bids_dir, derivatives, out_dir, space, exclude_pattern=None, include_pattern=None, model=None, participants=None, base_dir=None, name='fitlins_wf'): @@ -55,13 +51,6 @@ def init_fitlins_wf(bids_dir, derivatives, out_dir, space, exclude_pattern=None, 'type': 'preproc', 'suffix': 'bold', 'space': space}), name='getter') - # Accumulate metadata - l1_metadata = pe.MapNode( - niu.Function(function=join_dict), - iterfield=['base_dict', 'dict_list'], - name='l1_metadata', - run_without_submitting=True) - l1_model = pe.MapNode( FirstLevelModel(), iterfield=['session_info', 'contrast_info', 'bold_file', 'mask_file'], @@ -130,8 +119,6 @@ def init_fitlins_wf(bids_dir, derivatives, out_dir, space, exclude_pattern=None, (loader, l1_model, [('session_info', 'session_info')]), (getter, l1_model, [('bold_files', 'bold_file'), ('mask_files', 'mask_file')]), - (getter, l1_metadata, [('entities', 'base_dict')]), - (l1_model, l1_metadata, [('contrast_metadata', 'dict_list')]), (l1_model, plot_design, [('design_matrix', 'data')]), ]) @@ -195,7 +182,7 @@ def init_fitlins_wf(bids_dir, derivatives, out_dir, space, exclude_pattern=None, (loader, select_entities, [('entities', 'inlist')]), (select_entities, getter, [('out', 'entities')]), (select_entities, ds_model_warnings, [('out', 'entities')]), - (l1_metadata, collate, [('out', 'contrast_metadata')]), + (l1_model, collate, [('contrast_metadata', 'contrast_metadata')]), (select_entities, ds_design, [('out', 'entities')]), (plot_design, ds_design, [('figure', 'in_file')]), (select_contrasts, plot_l1_contrast_matrix, [('out', 'contrast_info')]), @@ -213,7 +200,7 @@ def init_fitlins_wf(bids_dir, derivatives, out_dir, space, exclude_pattern=None, wf.connect([ (models[-1], model, [('contrast_maps', 'stat_files')]), - (l1_metadata, model, [('out', 'stat_metadata')]), + (l1_model, model, [('contrast_metadata', 'stat_metadata')]), (model, collate, [('contrast_metadata', 'contrast_metadata')]), ])