[Mne_analysis] using find_ch_connectivity for spatio-temporal clustering
Denis A. Engemann
denis-alexander.engemann at inria.fr
Wed Jul 31 17:20:06 EDT 2019
External Email - Use Caution
Hi Dillan,
if you do not untuple the output of the function like this:
connect_matrix, names = mne.channels.find_ch_connectivity(epochs.info,ch_type='eeg’)
you should pass
connect_matrix[0]
into the clustering permutation function.
Check here for the function signature:
https://www.martinos.org/mne/stable/generated/mne.channels.read_ch_connectivity.html#mne.channels.read_ch_connectivity
Hope that helps,
Denis
> On Jul 31, 2019, at 11:03 PM, Dillan Cellier <cellierdillan at gmail.com> wrote:
>
> External Email - Use Caution
>
>
> Hello MNE users,
>
> I am attempting to use the function mne.channels.find_ch_connectivity() to generate a matrix of the channel connectivity. I'd like to use this matrix as an input to mne.stats.spatio_temporal_cluster_1samp_test() for the 'connectivity' argument.
>
> I am getting an error when I feed the output of find_ch_connectivity into spatio_temporal_cluster_1samp_test.
>
> Here is my code:
>
> connect_matrix=mne.channels.find_ch_connectivity(epochs.info,ch_type='eeg')
>
>
> type(connect_matrix[0])
> --> out: scipy.sparse.csr.csr_matrix
>
>
> obs,clusters,cluster_pv,H=mne.stats.spatio_temporal_cluster_1samp_test( array_of_diffs, connectivity=connect_matrix, n_permuntations=10000)
> --> ValueError: if a connectivity matrix is given, it must be a scipy sparse matrix
>
> It seems that I am expected to input a different type of scipy sparse matrix for the connectivity argument in the spatio_temporal_cluster_1samp function, but I am unsure which one and how I might do so.
>
> Or, if anyone has suggestions for how else I might construct a connectivity matrix to pass into the spatio_temporal_cluster_1samp function, I would greatly appreciate it!
>
> Thank you, and best wishes,
> Dillan Cellier
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
More information about the Mne_analysis
mailing list