本文整理汇总了Python中mne.io.Raw.drop_channels方法的典型用法代码示例。如果您正苦于以下问题:Python Raw.drop_channels方法的具体用法?Python Raw.drop_channels怎么用?Python Raw.drop_channels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.io.Raw
的用法示例。
在下文中一共展示了Raw.drop_channels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_equalize_channels
# 需要导入模块: from mne.io import Raw [as 别名]
# 或者: from mne.io.Raw import drop_channels [as 别名]
def test_equalize_channels():
"""Test equalization of channels
"""
raw1 = Raw(fif_fname, preload=True)
raw2 = raw1.copy()
ch_names = raw1.ch_names[2:]
raw1.drop_channels(raw1.ch_names[:1])
raw2.drop_channels(raw2.ch_names[1:2])
my_comparison = [raw1, raw2]
equalize_channels(my_comparison)
for e in my_comparison:
assert_equal(ch_names, e.ch_names)
示例2: test_drop_channels_mixin
# 需要导入模块: from mne.io import Raw [as 别名]
# 或者: from mne.io.Raw import drop_channels [as 别名]
def test_drop_channels_mixin():
"""Test channels-dropping functionality
"""
raw = Raw(fif_fname, preload=True)
drop_ch = raw.ch_names[:3]
ch_names = raw.ch_names[3:]
ch_names_orig = raw.ch_names
dummy = raw.drop_channels(drop_ch, copy=True)
assert_equal(ch_names, dummy.ch_names)
assert_equal(ch_names_orig, raw.ch_names)
assert_equal(len(ch_names_orig), raw._data.shape[0])
raw.drop_channels(drop_ch)
assert_equal(ch_names, raw.ch_names)
assert_equal(len(ch_names), len(raw._cals))
assert_equal(len(ch_names), raw._data.shape[0])
示例3: test_needs_eeg_average_ref_proj
# 需要导入模块: from mne.io import Raw [as 别名]
# 或者: from mne.io.Raw import drop_channels [as 别名]
def test_needs_eeg_average_ref_proj():
"""Test checking whether a recording needs an EEG average reference"""
raw = Raw(raw_fname, add_eeg_ref=False, preload=False)
assert_true(_needs_eeg_average_ref_proj(raw.info))
raw = Raw(raw_fname, add_eeg_ref=True, preload=False)
assert_true(not _needs_eeg_average_ref_proj(raw.info))
# No EEG channels
raw = Raw(raw_fname, add_eeg_ref=False, preload=True)
eeg = [raw.ch_names[c] for c in pick_types(raw.info, meg=False, eeg=True)]
raw.drop_channels(eeg)
assert_true(not _needs_eeg_average_ref_proj(raw.info))
# Custom ref flag set
raw = Raw(raw_fname, add_eeg_ref=False, preload=False)
raw.info['custom_ref_applied'] = True
assert_true(not _needs_eeg_average_ref_proj(raw.info))
示例4: dict
# 需要导入模块: from mne.io import Raw [as 别名]
# 或者: from mne.io.Raw import drop_channels [as 别名]
condition = "interupt"
reject_params = dict(grad=4000e-13, # T / m (gradiometers)
mag=4e-12 # T (magnetometers)
)
# SETTINGS
#raw = Raw(save_folder + "%s_%s_filtered_mc_tsss-raw.fif" % (subject,
# condition),
# preload=True)
raw = Raw(maxfiltered_folder + "%s_%s_mc_tsss-raw.fif" % (subject,
condition),
preload=True)
raw.drop_channels(raw.info["bads"])
raw.notch_filter(n_freq, n_jobs=n_jobs)
raw.filter(l_freq, h_freq, n_jobs=n_jobs)
raw.save(save_folder + "%s_%s_filtered_mc_tsss-raw.fif" % (subject,
condition),
overwrite=True)
# ICA Part
ica = ICA(n_components=0.99, method='fastica', max_iter=256)
picks = mne.pick_types(raw.info, meg=True, eeg=False, eog=False, emg=False,
bio=False, stim=False, exclude='bads')