You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
make it easier to specify adjacency in permutation_cluster_test #9364
I tried to do a time-frequency permutation_cluster_test over 126 channels for different observations and for two groups.
So I have 4D data (observations, times, frequencies, channels) for two groups of users but it didn't work.
ValueError: adjacency (len 126) must be of the correct size, i.e. be equal to or evenly divide the number of tests (75600). If adjacency was computed for a source space, try using the fwd["src"] or inv["src"] as some original source space vertices can be excluded during forward computation
at line 606 of "mne/stats/cluster_level.py" file.
(and 75600 is evenly dividable by 126, but "got_times" is different from "n_times" for the dimension more)
It seems like at most there can be three dimensions and not four.
I thought that with this version it was possible to do it.
The problem here is that the adjacency for your data needs to have dimensions (126*6) x (126*6). After a conversation with @larsoner we're thinking the best fix would be to provide a helper function that would contstruct the larger adjacency matrix for you, by allowing you to easily specify sensible parameters like "no adjacency between frequency bins", "standard lattice connectivity along the time axis", and "here is a sparse adjacency matrix for the channels axis" and have it construct the larger adjacency matrix for you.
Activity
drammock commentedon Apr 30, 2021
The problem here is that the adjacency for your data needs to have dimensions
(126*6) x (126*6). After a conversation with @larsoner we're thinking the best fix would be to provide a helper function that would contstruct the larger adjacency matrix for you, by allowing you to easily specify sensible parameters like "no adjacency between frequency bins", "standard lattice connectivity along the time axis", and "here is a sparse adjacency matrix for the channels axis" and have it construct the larger adjacency matrix for you.drammock commentedon Apr 30, 2021
actually @GiovanniGr it turns out we already have this function:
mne.stats.combine_adjacencythat will do what you need:This works for me:
It can also create regular lattice adjacency along a particular dimension, by passing an
intgiving the size of that dimension.drammock commentedon Apr 30, 2021
actually, I think I can see room for improvement. re-opening.