MNE-python《handling bad channels》

MNE-python官网文章《handling bad channels》(以下简称《文章》,来源——文章链接)阅读及个人实操

根据《文章》内代码,并根据个人理解,编写如下代码:

# handling bad channels
import os
from copy import deepcopy
import numpy as np
import mne
import matplotlib.pyplot as plt

# get the sample data
sample_data_path = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_path, 'MEG', 'sample',
                                    'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)

# marking bad channels

# 1.output the stored bad channels
print(raw.info['bads'])
# pick the 'EEG 05'channel for showing in plot
picks = mne.pick_channels_regexp(raw.ch_names, regexp='EEG 05.')
# picks:这里mne.pick_channels_regexp返回的是一个 int型array,
# 存储raw对象ch_names中同regexp value值相似或相同的channel name的Indices
# print('len of picks: ',  len(picks))  # from EEG 050-EEG059,Total number: 10

# raw.plot(order=picks, n_channels=len(picks))
# plt.show()

picks = mne.pi
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值