FSL PPI analysis with nipype

I want to script a PPI analysis with nipype, but Level1Design does not offer all the features needed for this kind of analysis.

Does someone have a pimped version of Level1Design?

At the moment I can only define one kernel for all conditions. For PPI I need a list of kernels (level1design.inputs.bases), one kernel / condition.

I am thining of an extension of this bases. So I end up with
level1design.inputs.bases=[{‘dgamma’:{‘derivs’: False}, ‘none’:{‘derivs’: False}, ‘ppi’:{0:‘min’, ‘1’:‘mean’}]

hrf kernel for my task, none for the seed, and the interaction of the filtered 0 (task) and 1 (seed)


I worte a quick and dirty hack for testing.nipype

If you want to use it:
Use SpecifyModel to define your task as usual and add the seed time course as regressor :

voi = np.genfromtext('voi_timecourse.txt')
model= SpecifyModel()
model.inputs.subject_info = [Bunch(conditions=['A'],
                            onsets=[range(int(10), int(100), int(25))],

In Level1Design add the interaction between task and seed

level1design = Level1Design()
ppi1 = ['ppi1', ['seed', 'A'], ['mean', 'min']]
level1design.inputs.contrasts=[['ppi', 'T', ['A', 'seed', 'ppi1'] , [1,1,1]]]


1 Like

Has someone successfully run a PPI analysis with nilearn? It seems like nilearn has a lot of useful functionality for functional connectivity analysis but I have been unable to find an example with a PPI analysis.

I would greatly appreciate your help!

Ahoi hoi @Sebastian,

as far as I know, PPI analyses are not possible using nilearn.
Not PPI, but maybe something you might find interesting:
task based networks example and nibetaseries.

HTH, cheers, Peer

1 Like

You may want to check out the tutorial from DartBrains here. They provide a demonstration of how to do PPI in nilearn/python.