nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
749 stars 530 forks source link

How to specify parametric contrast in 1st-level analysis using SPM? #2954

Open mz973 opened 5 years ago

mz973 commented 5 years ago

Summary

Hi all,

This may sound silly but I'm really new to nipype and fMRI analysis in general.

So I created a design matrix for a memory task (1 run) and I'm trying to model the effect of load. The main condition for all trials is named 'memory' and load value is specified through the pmod argument in subjectinfo. When looking at the design matrix from SPM.mat the model is constructed correctly and there is the regressor named 'memory*load' in the matrix.

However, when I tried to specify the contrast, I can only use "cont01 = ['memory', 'T', ['memory'], [1]] " since I only have one condition in the run. It generated error "Inner matrix dimensions must agree", whenever I tried to expand the contrast list to say [0,1,0] (corresponds to the actual number of columns in the design matrix) to specifically look at the effect of the parametric regressor.

So my question is when the 1st level analysis is run, does the result show the effect of the parametric modulater or is it simply the effect of the main regressor 'memory'? And how could I pass on the contrast list to tell SPM to look at effect of the load?

I hope my question makes sense. Please let me know how I can provide more details!

Thanks a lot. Mengya

Actual behavior

Expected behavior

How to replicate the behavior

Script/Workflow details

Please put URL to code or code here (if not too long).

Platform details:

Execution environment

Choose one

carolfs commented 5 years ago

Since I was just struggling with this, here is an example from the documentation for a condition named Famous and a pmod named Lag:

cont1 = ('Famous_lag1', 'T', ['F2xLag^1'], [1])

mz973 commented 5 years ago

Since I was just struggling with this, here is an example from the documentation for a condition named Famous and a pmod named Lag:

cont1 = ('Famous_lag1', 'T', ['F2xLag^1'], [1])

Took weeks but I arrived at the same answer!

Basically if your main condition is called C1 and your pmod P1, and you are interested in the parametric effect, you should do "cont01 = ['contrast_name', 'T', C1xP1^1, [1]]"