I am using Ubuntu 22.04 (WSL2) on Windows 10. My Kernel crashes when running stc.plot.
I was testing the stc.plot
by testing the MNE example code Visualize source time courses (stcs). MNE example stc file was loaded and plot in the code.
It seems to me is the problem of backend or I miss some information packages for Ubuntu, but I can not find out the reason. It seems that pyvista is installed properly. I can execute pyvista example in my Jupyter notebook.
Here is the testing code:
import matplotlib.pyplot as plt
import numpy as np
import mne
from mne import read_evokeds
from mne.datasets import fetch_hcp_mmp_parcellation, sample
from mne.minimum_norm import apply_inverse, read_inverse_operator
data_path = sample.data_path()
meg_path = data_path / "MEG" / "sample"
subjects_dir = data_path / "subjects"
fname_evoked = meg_path / "sample_audvis-ave.fif"
fname_stc = meg_path / "sample_audvis-meg"
fetch_hcp_mmp_parcellation(subjects_dir)
stc = mne.read_source_estimate(fname_stc, subject="sample")
initial_time = 0.1
brain = stc.plot(
subjects_dir=subjects_dir,
initial_time=initial_time,
clim=dict(kind="value", lims=[3, 6, 9]),
smoothing_steps=7,
)
It returns:
Using pyvistaqt 3d backend.
Using control points [ 5.01632618 6.06303297 21.63565434]
The Kernel crashed while executing code in the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.
The Jupyter log can not specify the error reson:
[error] Disposing session as kernel process died ExitCode: undefined, Reason:
However, if I use matplotlib
for my backend, the figure can be returned.
mpl_fig = stc.plot(
subjects_dir=subjects_dir,
initial_time=0,
backend="matplotlib",
verbose="error",
smoothing_steps=7,
)
The figure can be returned:
- MNE version: 1.8.0
- operating system: Ubuntu 22.04 on WSL2
Further system_info:
Platform Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python 3.9.19 | packaged by conda-forge | (main, Mar 20 2024, 12:50:21) [GCC 12.3.0]
Executable /home/gs/miniconda3/envs/eeg_env/bin/python3.9
CPU x86_64 (6 cores)
Memory 31.3 GBCore
โโ mne 1.8.0 (latest release)
โโ numpy 1.26.4 (OpenBLAS 0.3.27 with 6 threads)
โโ scipy 1.13.1
โโ matplotlib 3.9.2 (backend=qtagg)Numerical (optional)
โโ sklearn 1.5.1
โโ numba 0.60.0
โโ nibabel 5.2.1
โโ nilearn 0.10.4
โโ dipy 1.9.0
โโ openmeeg 2.5.12
โโ pandas 2.2.2
โโ h5io 0.2.4
โโ h5py 3.11.0
โโ unavailable cupyVisualization (optional)
โโ pyvista 0.44.1 (OpenGL 4.5 (Core Profile) Mesa 24.1.5 via llvmpipe (LLVM 18.1.8, 256 bits))
โโ pyvistaqt 0.11.1
โโ vtk 9.3.1
โโ qtpy 2.4.1 (PyQt5=5.15.8)
โโ pyqtgraph 0.13.7
โโ mne-qt-browser 0.6.3
โโ ipywidgets 8.1.5
โโ trame_client 3.2.5
โโ trame_server 3.0.3
โโ trame_vtk 2.8.10
โโ trame_vuetify 2.6.2
โโ unavailable ipymplEcosystem (optional)
โโ eeglabio 0.0.2-4
โโ edfio 0.4.3
โโ mffpy 0.9.0
โโ pybv 0.7.5
โโ unavailable mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline, neo