Clarification of finite impulse response function in nilearn

Hi There,

I am hoping to get more information on the meaning of the ‘fir’ documentation from nilearn here: Analysis of an fMRI dataset with a Finite Impule Response (FIR) model - Nilearn

The doc indicates that fir_delays = [1, 2, 3] corresponds to 3-step functions on the [1 * t_r, 4 * t_r] seconds interval.

I may be missing something really basic, but can someone explain why this wouldn’t be 3-step functions on the [1 * t_r, 3 * t_r] seconds interval? How to you specify a longer hemodynamic response function range with more ‘tents’ like -regress_basis_multi ‘TENT(0,12,7)’ in AFNI?

Apologies in advance for potentially a basic question.


Along these lines, does ‘fir’ in nilearn read/use the duration from the stimulus timing file?

Sorry, I’m not familiar with AFNI parametrization, but my understanding is that you are specifying 3 step functions covering three time intervals: [1 * TR, 2TR], [2 TR, 3TR], [3 * TR, 4TR], added to the stimulus onset. Depending on the asynchony between stimulus onset and the frame times, these intervals will be sampled slightly differently: it’s not necessarily a vector of zeros with a single one.
for instance, if frame times are np.arange(len) * TR, and that a stimulus occurs at TR / 2, then the regressors corresponding to the above intervals will be sampled as [0, .5, .5, 0 …], [0, 0, .5, .5, 0 …] and [0, 0, 0, .5, .5, 0 …].
Hope this makes sense.

Hi Bertrand,

Thank you for your response!!
Am I also to understand then if you use a fir in nilearn then nilearn isn’t using the duration column in a stimulus timing file?

It does use it. In essence, the model remains convolutional.