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


Python Raw.drop_channels方法代码示例

本文整理汇总了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)
开发者ID:Pablo-Arias,项目名称:mne-python,代码行数:15,代码来源:test_raw_fiff.py

示例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])
开发者ID:Pablo-Arias,项目名称:mne-python,代码行数:19,代码来源:test_raw_fiff.py

示例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))
开发者ID:The3DWizard,项目名称:mne-python,代码行数:20,代码来源:test_proj.py

示例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')
开发者ID:MadsJensen,项目名称:RP_scripts,代码行数:33,代码来源:ICA_interactive.py


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