Created
February 19, 2020 11:01
-
-
Save kingjr/90de3691cd62392836493f5d2621e0da to your computer and use it in GitHub Desktop.
cluster test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stats(X, n_jobs=-1, seed=0, **kwargs): | |
from mne.stats import spatio_temporal_cluster_1samp_test | |
X = np.asarray(X) | |
if X.ndim==2: | |
X = X[:, :, None] | |
_, clusters, c_pv, _ = spatio_temporal_cluster_1samp_test( | |
X, n_jobs=n_jobs, seed=seed, out_type='mask', **kwargs | |
) | |
p_vals = [(mask*p + (mask==0)) for mask, p in zip(clusters, c_pv) | |
if p < .05] | |
return np.min(p_vals, axis=0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment