本文整理汇总了Python中mne.VolSourceEstimate.plot方法的典型用法代码示例。如果您正苦于以下问题:Python VolSourceEstimate.plot方法的具体用法?Python VolSourceEstimate.plot怎么用?Python VolSourceEstimate.plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.VolSourceEstimate
的用法示例。
在下文中一共展示了VolSourceEstimate.plot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_plot_volume_source_estimates
# 需要导入模块: from mne import VolSourceEstimate [as 别名]
# 或者: from mne.VolSourceEstimate import plot [as 别名]
def test_plot_volume_source_estimates():
"""Test interactive plotting of volume source estimates."""
forward = read_forward_solution(fwd_fname)
sample_src = forward['src']
vertices = [s['vertno'] for s in sample_src]
n_verts = sum(len(v) for v in vertices)
n_time = 2
data = np.random.RandomState(0).rand(n_verts, n_time)
vol_stc = VolSourceEstimate(data, vertices, 1, 1)
for mode in ['glass_brain', 'stat_map']:
with pytest.warns(None): # sometimes get scalars/index warning
fig = vol_stc.plot(sample_src, subject='sample',
subjects_dir=subjects_dir,
mode=mode)
# [ax_time, ax_y, ax_x, ax_z]
for ax_idx in [0, 2, 3, 4]:
_fake_click(fig, fig.axes[ax_idx], (0.3, 0.5))
fig.canvas.key_press_event('left')
fig.canvas.key_press_event('shift+right')
with pytest.raises(ValueError, match='must be one of'):
vol_stc.plot(sample_src, 'sample', subjects_dir, mode='abcd')
vertices.append([])
surface_stc = SourceEstimate(data, vertices, 1, 1)
with pytest.raises(ValueError, match='Only Vol'):
plot_volume_source_estimates(surface_stc, sample_src, 'sample',
subjects_dir)
with pytest.raises(ValueError, match='Negative colormap limits'):
vol_stc.plot(sample_src, 'sample', subjects_dir,
clim=dict(lims=[-1, 2, 3], kind='value'))