非官方中文翻译
本页译自 MNE-Python 官方文档:
查看英文原文 ↗。
文档版权归 MNE Developers 所有(BSD-3-Clause)。
说明
转到末尾下载完整示例代码。
对 EEG 使用对侧参考#
有些研究者不为所有通道使用同一个参考电极,而是把每个半球的 EEG 电极参考到对侧半球的一个电极(通常是乳突骨上的电极,这在睡眠研究中很常见)。这里演示如何设置对侧 EEG 参考。
# Authors: The MNE-Python contributors.
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.
import mne
ssvep_folder = mne.datasets.ssvep.data_path()
ssvep_data_raw_path = (
ssvep_folder / "sub-02" / "ses-01" / "eeg" / "sub-02_ses-01_task-ssvep_eeg.vhdr"
)
raw = mne.io.read_raw(ssvep_data_raw_path, preload=True)
_ = raw.set_montage("easycap-M1")
Extracting parameters from /home/circleci/mne_data/ssvep-example-data/sub-02/ses-01/eeg/sub-02_ses-01_task-ssvep_eeg.vhdr...
Setting channel info structure...
Reading 0 ... 467579 = 0.000 ... 467.579 secs...
TP9 与 TP10 靠近乳突,因此用作对侧参考通道;随后创建左右半球分组。
raw.rename_channels({"TP9": "M1", "TP10": "M2"})
# this splits electrodes into 3 groups; left, midline, and right
ch_names = mne.channels.make_1020_channel_selections(raw.info, return_ch_names=True)
# remove the ref channels from the lists of to-be-rereferenced channels
ch_names["Left"].remove("M1")
ch_names["Right"].remove("M2")
最后进行参考设置:中线通道参考到两个乳突通道的均值;左、右半球分别参考到单个对侧乳突通道。
# midline referencing to mean of mastoids:
mastoids = ["M1", "M2"]
rereferenced_midline_chs = (
raw.copy()
.pick(mastoids + ch_names["Midline"])
.set_eeg_reference(mastoids)
.drop_channels(mastoids)
)
# contralateral referencing (alters channels in `raw` in-place):
for ref, hemi in dict(M2=ch_names["Left"], M1=ch_names["Right"]).items():
mne.set_bipolar_reference(raw, anode=hemi, cathode=[ref] * len(hemi), copy=False)
# strip off '-M1' and '-M2' suffixes added to each bipolar-referenced channel
raw.rename_channels(lambda ch_name: ch_name.split("-")[0])
# replace unreferenced midline with rereferenced midline
_ = raw.drop_channels(ch_names["Midline"]).add_channels([rereferenced_midline_chs])
EEG channel type selected for re-referencing
Applying a custom ('EEG',) reference.
EEG channel type selected for re-referencing
Creating RawArray with float64 data, n_channels=13, n_times=467580
Range : 0 ... 467579 = 0.000 ... 467.579 secs
Ready.
Added the following bipolar channels:
O1-M2, PO9-M2, P7-M2, P3-M2, CP5-M2, CP1-M2, T7-M2, C3-M2, FC1-M2, FC5-M2, F3-M2, F7-M2, Fp1-M2
EEG channel type selected for re-referencing
Creating RawArray with float64 data, n_channels=13, n_times=467580
Range : 0 ... 467579 = 0.000 ... 467.579 secs
Ready.
Added the following bipolar channels:
O2-M1, PO10-M1, P8-M1, P4-M1, CP6-M1, CP2-M1, C4-M1, T8-M1, FC2-M1, FC6-M1, F4-M1, F8-M1, Fp2-M1
确认通道位置仍然正确:
fig = raw.plot_sensors(show_names=True, sphere="eeglab")

Approximating Fpz location by mirroring Oz along the X and Y axes.