本文整理汇总了Python中mne.SourceEstimate.in_label方法的典型用法代码示例。如果您正苦于以下问题:Python SourceEstimate.in_label方法的具体用法?Python SourceEstimate.in_label怎么用?Python SourceEstimate.in_label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.SourceEstimate
的用法示例。
在下文中一共展示了SourceEstimate.in_label方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from mne import SourceEstimate [as 别名]
# 或者: from mne.SourceEstimate import in_label [as 别名]
# ############################################################################
# construct appropriate brain activity
print('Constructing original (simulated) sources')
tmin, tmax = -0.2, 0.8
vertices = [s['vertno'] for s in src]
n_vertices = sum(s['nuse'] for s in src)
data = np.ones((n_vertices, int((tmax - tmin) * sfreq)))
stc = SourceEstimate(data, vertices, -0.2, 1. / sfreq, subject)
# limit activation to a square pulse in time at two vertices in space
labels = [read_labels_from_annot(subject, 'aparc.a2009s', hemi,
regexp='G_temp_sup-G_T_transv')[0]
for hi, hemi in enumerate(('lh', 'rh'))]
stc = stc.in_label(labels[0] + labels[1])
stc.data.fill(0)
stc.data[:, np.where(np.logical_and(stc.times >= pulse_tmin,
stc.times <= pulse_tmax))[0]] = 10e-9
# ############################################################################
# Simulate data
# Simulate data with movement
with warnings.catch_warnings(record=True):
raw = Raw(fname_raw, allow_maxshield=True)
raw_movement = simulate_movement(raw, fname_pos_orig, stc, trans, src, bem,
interp='zero', n_jobs=6, verbose=True)
# Simulate data with no movement (use initial head position)
raw_stationary = simulate_movement(raw, None, stc, trans, src, bem,