[Mne_analysis] t-test in source space?

Alexandre Gramfort gramfort at nmr.mgh.harvard.edu
Thu Oct 6 21:35:18 EDT 2011
Search archives:

Hi Will,

> Thanks for the reply. In addition to using the standard scipy.stats functions, it would be nice to be able to take advantage of some of the fancier tools you've developed in mne-python, like the permutation_t_test and permutation_cluster_test functions.

permutation_t_test uses the t-max correction for multiple comparison so should
work easily in the source space.

for the cluster level stats you need to pass a connectivity matrix
to define spatio-temporal cluster. This feature is not very well documented
but I can send you a script if you want to give it a try.

> The examples you give for their usage are in sensor space. I've tried simply feeding them stc data instead, with this kind of usage:
>
> threshold = 2.1
> T_obs, clusters, cluster_p_values, H0 = \
>                permutation_cluster_test([cond1_stc.data, cond2_stc.data],
>                            n_permutations=1000, threshold=threshold, tail=0,
>                            n_jobs=7)

permutation_cluster_test cannot be used this way as the rows in stc.data
do not match the spatial structure of the cortical mesh.

> But when I do, shape(T_obs), I get the following:
> (241,), which I suppose is the number of samples, but no information about the vertices. It's a similar story when I try using permutation_t_test.

you should assemble a matrix where the rows are the observations
in each conditions. That's not what stc.data is. It does not really
make sense to use vertices as observations.

> Am I missing something obvious here, or do these functions simply not work for stc/source files? Perhaps I'm just calling them wrong or misunderstanding the output. Either way, I'd appreciate any help you could give.

hope the comments above help.

Cheers,
Alex




More information about the Mne_analysis mailing list