當前位置: 首頁>>代碼示例>>Python>>正文


Python mne.viz方法代碼示例

本文整理匯總了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) 
開發者ID:pelednoam,項目名稱:mmvt,代碼行數:25,代碼來源:beamformers_electrodes_tweak.py


注:本文中的mne.viz方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。