Dear All,
I have a preprocessing worklfow that appears to run without any problems. I then connect this to the 1st level workflow:
metaflow.connect([(preproc, l1analysis, [('realign.realignment_parameters',
'modelspec.realignment_parameters'),
('smooth.smoothed_files',
'modelspec.functional_runs'),
('art.outlier_files',
'modelspec.outlier_files'),
The inputs are then connected to this:
metaflow.connect([(infosource, selectfiles, [('subject_id', 'subject_id'), ('session_id', 'session_id')]),
(selectfiles, preproc, [('func', 'reset_origin_func.niftis')]),
(selectfiles, preproc, [('struc', 'reset_origin_struc.niftis')]),
(infosource, getsubjectinfo, [('subject_id', 'subject_id')]),
(getsubjectinfo, l1analysis, [('subject_info', 'modelspec.subject_info')]),
(infosource, l1analysis, [('contrasts', 'conestimate.contrasts')]),
It seems that it is at the connection between getsubejctinfo and l1analysis the pipeline stumbles: I receive an error message:
"TypeError: can't multiply sequence by non-int of type 'float'
Interface SpecifySPMModel failed to run."
The firstlevel node that it fails on is:
modelspec = Node(SpecifySPMModel(concatenate_runs=False,
input_units='secs', output_units='secs',
time_repetition=TR,
high_pass_filter_cutoff=128),
name="modelspec")
I wondered if this may be related to me inputting the task details incorrectly - this is the getsubjectinfo function that connects to the modelspec node:
def get_subject_info(subject_id):
from nipype.interfaces.base import Bunch
condition_names = ['rest', 'control', 'stress']
onsets_run1 = [[0, 220.5], [10.5, 231], [98.7, 319.2]]
onsets_run3 = [[0], [10.5], [98.7]]
onset_list = [(onsets_run1), (onsets_run1), (onsets_run3)]
durations_run1 = [[10.5],[88.2],[98.7]]
durations_run3 = [[10.5],[88.2],[342.3]]
durations_list = [(durations_run1), (durations_run1), (durations_run3)]
subjectinfo = []
for r in range(1):
subjectinfo.insert(r,
Bunch(conditions=condition_names,
onsets=[onset_list[r]],
durations=[durations_list[r]],
amplitudes=None,
tmod=None,
pmod=None,
regressor_names=None,
regressors=None))
return subjectinfo
getsubjectinfo = Node(Function(input_names=['subject_id'], output_names=['subject_info'],
function=get_subject_info),
name='getsubjectinfo')]
From the error message I wondered whether some timings were being inputted as a string but this doesn’t seem to be the case.
Any help most appreciated!
Many Thanks
Rob