mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.71k stars 1.32k forks source link

Error in "Spatiotemporal permutation F-test on full sensor data" tutorial #12927

Open joebathelt opened 6 hours ago

joebathelt commented 6 hours ago

Proposed documentation enhancement

First, thank you for developing MNE-Python and for all the work that went into creating such comprehensive and useful tutorials.

I recently completed the spatiotemporal clustering tutorial for full sensor data using MNE version 1.8. However, when I reached the clustering step, I encountered an error at Line 312 that prevented the clustering from completing successfully:

Exception ignored in: 'scipy.sparse.csgraph._traversal._connected_components_undirected'
Traceback (most recent call last):
  File "/opt/homebrew/anaconda3/envs/LonelyEEG/lib/python3.11/site-packages/mne/stats/cluster_level.py", line 304, in _get_components
    _, components = connected_components(adjacency)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Buffer dtype mismatch, expected 'ITYPE_t' but got 'long'

It seems the issue is related to the format or type of the adjacency matrix, but I’m unsure how to resolve it. Could you please advise on what might be causing this error and any steps I could take to fix it?

welcome[bot] commented 6 hours ago

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴