1

我是 MNE Python 的新手,我正在使用来自 EEGlab(Matlab)的 .set 文件进行源估计分析。数据来自 EasyCaps 的 66 个通道(64 个 EEG 和 2 个 EOG),具有 10-20 个 IS。在 Matlab 中,EEG.chanlocs 正确显示了每个电极的坐标(标签、类型、theta、半径、X、Y、Z、sph_theta、sph_phi、sph_radius、urchin、ref)。但似乎我无法在 MNE Python 中读取这些位置。

import mne

#The .set files are imported ok
data_path = r"D:\EEGdata";
fname = data_path + '\ppt10.set'
mydata = mne.io.read_epochs_eeglab(fname)

#The data look ok, and channel labels are correctly displayed
mydata
mydata.plot()
mydata.ch_names

#But the channel locations are not found
mydata.plot_sensors()     #RuntimeError: No valid channel positions found

关于如何从 .set 文件中读取频道位置的任何建议?或者,如何根据 EEG.chanlocs 中的坐标手动创建位置?

我也尝试使用默认的蒙太奇 10-20,只选择我使用的频道,但我无法让它工作。

#Create a montage based on the standard 1020, which includes 94 electrode labels in upper case
montage = mne.channels.make_standard_montage('standard_1020')
[ch_name.upper() for ch_name in mydata.ch_names] #it correctly convert the channel labels into upper case
mydata.ch_names = [ch_name.upper() for ch_name in mydata.ch_names] #doesn't work
#File "<ipython-input-62-69a7053dc310>", line 1, in <module>
#mydata.ch_names=[ch_name.upper() for ch_name in mydata.ch_names]
#AttributeError: can't set attribute

montage = mne.channels.make_standard_montage('standard_1020',mydata.ch_names]

我还认为我可以使用转换工具将 .set 文件转换为 .fif 文件。我检查了在线文档,但找不到这样的工具。任何想法?

4

1 回答 1

0

我有一个类似的问题,我通过mydata.set_montage(montage)在运行前添加一行来解决mydata.plot_sensors()。您不需要将频道名称转换为大写,因为它们在 MNE 中不区分大小写

于 2021-10-10T23:13:14.397 回答