mne画脑地形图出现Digmontage错误No digitization points found
生活随笔
收集整理的這篇文章主要介紹了
mne画脑地形图出现Digmontage错误No digitization points found
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
0 導入相關包
import mne import matplotlib.pyplot as plt import numpy as np1 數據集
數據集用的是bbci competition IV 2b左右手想象 下載地址
2 讀取gdf文件
mne就提供了讀取gdf文件的函數read_raw_gdf
raw = mne.io.read_raw_gdf(path+file) raw.load_data()3 獲取需要事件和事件id
查看官方給的description文件得知 768是靜息狀態 769左手想象 770右手想象
custom_mapping = {'768': 9, '769': 10, '770': 11} (events_from_annot,event_dict) = mne.events_from_annotations(raw, event_id=custom_mapping) print(event_dict)4 去除眼電通道數據
raw.drop_channels([ 'EOG:ch01', 'EOG:ch02', 'EOG:ch03'])5 構建epoch數據
epochs = mne.Epochs(raw, events=events_from_annot, event_id=event_dict,proj=True,baseline=(None, 0), preload=True,tmin=-0.2,tmax=0.5) print(epochs)6 構建evoked數據
evoked = epochs.average() evoked.plot(time_unit='s') plt.show()7 為evoked數據設置電極位置信息
evoked.set_montage('standard_1020')
出現報錯
8 解決辦法
跳過第7步 顯式創建info結構 并且設置電極位置信息
ch_names = ['C3', 'C4', 'Cz'] ch_types = ['eeg'] * 3 info = mne.create_info(ch_names, ch_types=ch_types, sfreq=250) info.set_montage('standard_1020')9 畫地形圖
evoked的數據結構是 通道數*采樣點數 其中一個采樣點對應一個地形圖
mne.viz.plot_topomap(evoked.data[:, 0], info,show=False)總結
以上是生活随笔為你收集整理的mne画脑地形图出现Digmontage错误No digitization points found的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: TPS27081ADDCR具有电平转换和
- 下一篇: html如何给div加边框