Hello,
The code below specifies the model for one run (i.e. func1 is the input for ‘functional_runs’). However, I would like to input the files from both run 1 and run 2 (i.e ‘func1’ and ‘func2’).
This obviously involves concatonating them in some way e.g. with some sort of self made concatonate function (see Connect node with multiple output files to another node)
However, I am not sure exactly how this function would fit into my workflow. I have tried writing a few functions but always come back to the same problem… the node has two inputs but just one output!
Any help would be much appreciated.
Many thanks,
Paul
########## code extract ###############
infosource = Node(IdentityInterface(fields=[‘subject_id’,
‘contrasts’],
contrasts=contrast_list),
name=“infosource”)
infosource.iterables = [(‘subject_id’, subject_list)]
templates = {‘func1’: opj(preproc_dir,‘sub-{subject_id}_run-01_bold.nii’),
‘func2’: opj(preproc_dir,‘sub-{subject_id}_run-02_bold.nii’)
}
sf_func = Node(SelectFiles(templates,
base_directory=output_dir,
sort_filelist=True),
name=“sf_func”)
modelspec = Node(SpecifySPMModel(concatenate_runs=True, # FALSE
input_units=‘secs’,
output_units=‘secs’,
time_repetition=TR,
high_pass_filter_cutoff=128),
#functional_runs = [func1, func2],
#subject_info = [evs_run1, evs_run2],
#realignment_parameters = [rp_run1, rp_mov2]),
name=“modelspec”)
l1analysis = Workflow(name=‘l1analysis’)
l1analysis.base_dir = working_dir
l1analysis.connect([(infosource, sf_func, [(‘subject_id’, ‘subject_id’)]),
(sf_func, modelspec, [(‘func1’,‘functional_runs’)])])