# spatio-temporal cluster on sensor level?

**URL:** <https://mne.discourse.group/t/spatio-temporal-cluster-on-sensor-level/796>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [August 15, 2014, 12:52pm UTC](https://mne.discourse.group/t/spatio-temporal-cluster-on-sensor-level/796 "2014-08-15T12:52:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 15, 2014, 12:52pm UTC](https://mne.discourse.group/t/spatio-temporal-cluster-on-sensor-level/796/1 "2014-08-15T12:52:39Z")

</div>

Hello MNE (python) user,

I have another question related to mne\_python v.08

I was wondering if there is a script for running Permutation t-test with  
spatio-temporal clustering on sensor data?

I found one for source level (which looks brilliant), however for sensor  
level, I found "only" temporal clustering on 1 specific sensor.

Thanks for your help

Elisabeth

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 15, 2014, 1:09pm UTC](https://mne.discourse.group/t/spatio-temporal-cluster-on-sensor-level/796/2 "2014-08-15T13:09:25Z")

</div>

Dear Elisabeth,

with regard to data organization, you can proceed exactly as with the  
source space examples, just replace vertices with channels.  
The critical difference amounts to how to define the neighboring spatiall  
features, a.k.a. connectivity.  
To compute this information you should use the FieldTrip neigbour  
definitions. You can read those using this function:  
[http://martinos.org/mne/stable/generated/mne.read\_ch\_connectivity.html#mne.read\_ch\_connectivity](http://martinos.org/mne/stable/generated/mne.read_ch_connectivity.html#mne.read_ch_connectivity)

for exmple like this for a 4D/BTi 248 channels magnetometer system:

neighbor\_file = 'fieldtrip/template/neighbours/bti248\_neighb.mat'

connectivity = mne.channels.read\_ch\_connectivity(neighbor\_file)

In case you have missing channels, you can define those to return the  
connectivity matrix of the subset of remaining channels:

connectivity = mne.channels.read\_ch\_connectivity(neighbor\_file, picks=picks)

The rest is the same, make sure your data matrices match the contrast type  
(F vs T test) and make sure that the last dimension carries the spatial  
information.

I hope that helps (we'll soon add a corresponding example).

Best,  
Denis

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [August 15, 2014, 1:27pm UTC](https://mne.discourse.group/t/spatio-temporal-cluster-on-sensor-level/796/3 "2014-08-15T13:27:00Z")

</div>

hi,

it would be great to have an example for this feature. Any volunteer?

Cheers,  
Alex
