博主在尝试MNE的SSP(Signal Space Projection)教程时,遇到pycharm中无法正确显示示例图的问题。尽管尝试了更换mne版本、安装依赖库、切换源等方法,仍然无法解决第二排图像空白和图像拼接问题。分析可能与matplotlib版本和源代码中matplotlib.pyplot.subplots及enumerate方法有关。博主期待社区的帮助,并提出希望MNE官方提供涉及库的版本信息以简化问题定位。
摘要由CSDN通过智能技术生成
MNE SSP learning recording——Example: Environmental noise reduction from empty-room recordings(https://mne.tools/stable/auto_tutorials/preprocessing/50_artifact_correction_ssp.html#tut-artifact-ssp)
记录以下在这次学习中出现的问题(未解决),欢迎指出问题!
1. pycharm上编写如下代码:
import os
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.preprocessing import(create_eog_epochs, create_ecg_epochs,
compute_proj_ecg, compute_proj_eog)
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder,'MEG','sample','sample_audvis_raw.fif')# sample_data_raw_file = sample_data_raw_file.replace("\\", "/")
raw = mne.io.read_raw_fif(sample_data_raw_file)
system_projs = raw.info['projs']
raw.del_proj()
empty_room_file = os.path.join(sample_data_folder,'MEG','sample','ernoise_raw.fif')
empty_room_raw = mne.io.read_raw_fif(empty_room_file)
empty_room_raw.del_proj()for average in(False,True):
empty_room_raw.plot_psd(average=average, dB=False, xscale='log')
plt.show()
empty_room_projs = mne.compute_proj_raw(empty_room_raw, n_grad=3, n_mag=3)
mne.viz.plot_projs_topomap(empty_room_projs, colorbar=True, vlim='joint',
info=empty_room_raw.info)
plt.show()
fig, axs = plt.subplots(2,3)for idx, _projs inenumerate([system_projs, empty_room_projs[3:]]):
mne.viz.plot_projs_topomap(_projs, axes=axs[idx], colorbar=True,
v