Nipype: how to concatenate runs correctly in SPM model

Hi everyone,

I have 8 runs in my study for each participant and I want to concatenate first 4 and last 4 runs when estimating the model. I’m using Nipype with fmriprep data and when preparing the first level analysis I saw that SPM has a concatenate_runs option. I was wondering how to use that option correctly. I’m a newcomer to the fmri analysis, so bear with me :slight_smile:

I specified subject specific events and nuisance regressors for each run (using the Bunch function), as if I was estimating them separately. Following the example in the docs I place 4 runs in a list:

s.inputs.subject_info = [run1_bunch, run2_bunch, run3_bunch, run4_bunch]

According to that example, and looking at the SpecifySPMModel code (github link), I don’t have to adjust onset times - it is done automatically, right?

What happens if I happen to have different sets of nuisance regressors - e.g. cosine drift variables often differ between runs and I have outlier variables in some runs? As far as I can see in the nipype code, it cannot account for this, right? I did try out the analysis and I got errors and I suspect its because of this. What would be a correct procedure here? I presume making sure I have same regressors in each run and setting them to 0 in the runs where they don’t exist should be OK (I’m a bit unsure about this for the cosine variables…).

SPM documentation says that run specific dummy variables are created automatically when runs are concatenated. Looking at the nipype code it seems this is done as well, but wanted to make sure? SPM docs also say something about “It will also correct the high-pass filter and temporal non-sphericity calculations to account for the original session lengths” which I don’t get at all.

Hrvoje