本文整理汇总了Python中mne.viz方法的典型用法代码示例。如果您正苦于以下问题:Python mne.viz方法的具体用法?Python mne.viz怎么用?Python mne.viz使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne
的用法示例。
在下文中一共展示了mne.viz方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plot_td_dics
# 需要导入模块: import mne [as 别名]
# 或者: from mne import viz [as 别名]
def plot_td_dics(events_id, bipolar, tmin_plot, tmax_plot, freq_bins):
from mne.viz import plot_source_spectrogram
from mne.source_estimate import _make_stc
# Plotting source spectrogram for source with maximum activity
# Note that tmin and tmax are set to display a time range that is smaller than
# the one for which beamforming estimates were calculated. This ensures that
# all time bins shown are a result of smoothing across an identical number of
# time windows.
region = 'bipolar_electrodes' if bipolar else 'regular_electrodes'
data_fol = os.path.join(SUBJECT_MEG_FOL, 'subcorticals', 'dics', 'all_{}'.format(region))
stcs = []
for event in events_id.keys():
stcs.append(tf.load_stcs(event, freq_bins, data_fol, MRI_SUBJECT))
# plot_source_spectrogram(stcs[-1], freq_bins, tmin=tmin_plot, tmax=tmax_plot,
# source_index=None, colorbar=True)
stcs_diff = []
for stc1, stc2 in zip(stcs[0], stcs[1]):
stc_diff = _make_stc(stc1.data - stc2.data, vertices=stc1.vertices,
tmin=stc1.tmin, tstep=stc1.tstep, subject=stc1.subject)
stcs_diff.append(stc_diff)
plot_source_spectrogram(stcs_diff, freq_bins, tmin=tmin_plot, tmax=tmax_plot,
source_index=None, colorbar=True)