Created
August 11, 2016 16:07
-
-
Save dongqunxi/daca753366c592927ff789c03aa6ed0b to your computer and use it in GitHub Desktop.
Get functional labels with the help of spatial-temporal clustering.
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
# Generate source_estimate from significant clusters | |
stc = summarize_clusters_stc(clu, p_thre, tstep=tstep, | |
tmin=tmin, vertices=fsave_vertices, | |
subject='fsaverage') | |
# Generate thresholded source estimate | |
stc_sub = stc.copy().mean() | |
data = np.zeros(stc_sub.data.shape) | |
data[:, 0] = stc.data[:, 0] | |
abs_data = abs(data) | |
abs_data[abs_data < thr] = 0 | |
stc_sub.data.setfield(abs_data, np.float32) | |
# Generate functional labels | |
lh_labels, rh_labels = mne.stc_to_label(stc_sub, src=src, smooth=True, | |
subjects_dir=subjects_dir, connected=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment