[Mne_analysis] How to get coherence between stc files?

Eric Larson larson.eric.d at gmail.com
Fri Jun 16 11:32:23 EDT 2017
Search archives:

>
> data=np.concatenate((epochs_1.get_data(),epochs_2.get_data()),axis=0)
>>
>> data.shape
>>
>> Out[28]: (320, 308, 3721)
>>
>
Following the nomenclature from the connectivity docs
<https://mne-tools.github.io/stable/generated/mne.connectivity.spectral_connectivity.html#mne.connectivity.spectral_connectivity>,
your input data need to be formatted as (n_epochs, n_signals, n_times).
Keep in mind that the n_signals dimension is usually the spatial one, like
source space vertices, or in your case, channels. So the way you have this
set up, you have 308 spatial channels / signals, each with 320 epochs /
repeats.

I am not sure how the parameter “indices” should be set in my case.
>>
>
Indices should be into the (typically) spatial dimension, i.e. the
n_signals dimension.

I would like to calculate the coherence between each data point in the file
>> 1 and the corresponding data points in the file 2.
>>
>
"data point" is a bit ambiguous -- I assume you mean you want to estimate
the connectivity between *each channel* from the first dataset and *each
channel* in the second dataset....

Since I have 320 epochs after concatenation, I tried:
>>
>> indices=(np.arange(1,160),np.arange(161,320)) (i.e. 160 epochs in each
>> file).
>>
>
... which means this probably isn't set up to do what you want.

What you might want is this:

data=np.concatenate((epochs_1.get_data(),epochs_2.get_data()),axis=1)
data.shape
(160, 616, 3721)

​
This way, you have 616 signals of interest (308 signals / channels from one
condition, 308 from signals / channels from another), each with 160 epochs
/ repeats.

Hopefully from there you can come up with how to get connectivity you want.
For example, if you want each channel only with its corresponding channel
from the other condition (308 estimates), this would be something like:

(np.arange(308), np.arange(308) + 308)

​
If you wanted all channels from condition 1 with all channels from
condition 2 (94864 estimates), this would be something like:

(np.repeat(np.arange(308), 308), np.tile(np.arange(308) + 308, 308))

​
And 308 is a somewhat rare number of data channels -- you might want to
check to make sure you have only data channels picked as Jaakko suggests.

HTH,
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170616/e93812c2/attachment.html 


More information about the Mne_analysis mailing list