本文整理汇总了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
示例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