Skip to content

Instantly share code, notes, and snippets.

@matt-erhart
Created March 3, 2014 21:46
Show Gist options
  • Save matt-erhart/9335307 to your computer and use it in GitHub Desktop.
Save matt-erhart/9335307 to your computer and use it in GitHub Desktop.
aparc_label_name = 'G_oc-temp_med-Lingual'
stc_mean = stc.copy().crop(tmin, tmax).mean()
# use the stc_mean to generate a functional label
# region growing is halted at 60% of the peak value within the
# anatomical label / ROI specified by aparc_label_name
label = mne.labels_from_parc('fsaverage', parc='aparc.a2009s',
regexp=aparc_label_name)
stc_mean_label = stc_mean.in_label(label[0][1])
data = np.abs(stc_mean_label.data)
stc_mean_label.data[data < 0.6 * np.max(data)] = 0.
func_labels, _ = mne.stc_to_label(stc_mean_label, src=src, smooth=5,connected=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment