当前位置: 首页>>代码示例>>Python>>正文


Python Raw.add_channels方法代码示例

本文整理汇总了Python中mne.io.Raw.add_channels方法的典型用法代码示例。如果您正苦于以下问题:Python Raw.add_channels方法的具体用法?Python Raw.add_channels怎么用?Python Raw.add_channels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mne.io.Raw的用法示例。


在下文中一共展示了Raw.add_channels方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_data

# 需要导入模块: from mne.io import Raw [as 别名]
# 或者: from mne.io.Raw import add_channels [as 别名]
def _get_data():
    """Helper to get some starting data"""
    # raw with ECG channel
    raw = Raw(raw_fname).crop(0.0, 5.0).load_data()
    data_picks = pick_types(raw.info, meg=True, eeg=True)
    other_picks = pick_types(raw.info, meg=False, stim=True, eog=True)
    picks = np.sort(np.concatenate((data_picks[::16], other_picks)))
    raw = raw.pick_channels([raw.ch_names[p] for p in picks])
    ecg = RawArray(np.zeros((1, len(raw.times))), create_info(["ECG 063"], raw.info["sfreq"], "ecg"))
    for key in ("dev_head_t", "buffer_size_sec", "highpass", "lowpass", "filename", "dig"):
        ecg.info[key] = raw.info[key]
    raw.add_channels([ecg])

    src = read_source_spaces(src_fname)
    trans = read_trans(trans_fname)
    sphere = make_sphere_model("auto", "auto", raw.info)
    stc = _make_stc(raw, src)
    return raw, src, stc, trans, sphere
开发者ID:GrantRVD,项目名称:mne-python,代码行数:20,代码来源:test_raw.py

示例2: _get_data

# 需要导入模块: from mne.io import Raw [as 别名]
# 或者: from mne.io.Raw import add_channels [as 别名]
def _get_data():
    """Helper to get some starting data"""
    # raw with ECG channel
    raw = Raw(raw_fname).crop(0., 5.0, copy=False).load_data()
    data_picks = pick_types(raw.info, meg=True, eeg=True)
    other_picks = pick_types(raw.info, meg=False, stim=True, eog=True)
    picks = np.sort(np.concatenate((data_picks[::16], other_picks)))
    raw = raw.pick_channels([raw.ch_names[p] for p in picks])
    ecg = RawArray(np.zeros((1, len(raw.times))),
                   create_info(['ECG 063'], raw.info['sfreq'], 'ecg'))
    for key in ('dev_head_t', 'buffer_size_sec', 'highpass', 'lowpass',
                'filename', 'dig'):
        ecg.info[key] = raw.info[key]
    raw.add_channels([ecg])

    src = read_source_spaces(src_fname)
    trans = read_trans(trans_fname)
    sphere = make_sphere_model('auto', 'auto', raw.info)
    stc = _make_stc(raw, src)
    return raw, src, stc, trans, sphere
开发者ID:MartinBaBer,项目名称:mne-python,代码行数:22,代码来源:test_raw.py


注:本文中的mne.io.Raw.add_channels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。