Adding additional regressors to SPM modelgen with nipype


I am using nipype to set up my first level analysis, following the tutorials on and the Nipype Beginner’s guide.

I’ve used fmriprep to preprocess my data and now I would like to add the motion parameters (from fmriprep confounds.tsv ) to the SPM model as well as FD (and maybe other parameters from the fmriprep confounds.tsv) as additional regressors to the SPM model. However, I can’t find a way to add additional regressors in the documentation of nipype.algorithms.modelgen.SpecifySPMModel (

Do I have to use a generic model, or is there some other way that I might have missed?

Thanks in advance for your help!

@jAchtzehn you can define them using the subject_info input and defining a ‘regressors’ section.

Here’s an example notebook (courtesy of @ChrisGorgolewski) that does this very thing (see block [95])

I will try that out, thanks!