mne-connectivity 3d plots crashing

  • MNE version: 1.5
  • operating system: Ubuntu 22.04.3 LTS VirtualBox

Platform Linux-6.2.0-31-generic-x86_64-with-glibc2.35

Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]

Executable /usr/bin/python3

CPU x86_64 (4 cores)

Memory 6.9 GB

Core

β”œβ˜‘ mne 1.5.0

β”œβ˜‘ numpy 1.25.2 (unknown linalg bindings (threadpoolctl module not found: No module named β€˜threadpoolctl’))

β”œβ˜‘ scipy 1.11.2

β”œβ˜‘ matplotlib 3.7.2 (backend=QtAgg)

β”œβ˜‘ pooch 1.7.0

β””β˜‘ jinja2 3.1.2

Numerical (optional)

β”œβ˜‘ pandas 2.0.3

β””β˜ unavailable sklearn, numba, nibabel, nilearn, dipy, openmeeg, cupy

Visualization (optional)

β”œβ˜‘ pyvista 0.41.1 (OpenGL 4.5 (Core Profile) Mesa 23.0.4-0ubuntu1~22.04.1 via llvmpipe (LLVM 15.0.7, 128 bits))

β”œβ˜‘ pyvistaqt 0.11.0

β”œβ˜‘ vtk 9.2.6

β”œβ˜‘ qtpy 2.4.0 (PyQt5=5.15.2)

β””β˜ unavailable ipyvtklink, ipympl, pyqtgraph, mne-qt-browser

Ecosystem (optional)

β”œβ˜‘ mne-connectivity 0.5.0

β””β˜ unavailable mne-bids, mne-nirs, mne-features, mne-icalabel, mne-bids-pipeline

Hello! I am trying to get the mne-connectivity library to work, but everytime I run the plot_sensors_connectivity function the plot opens then crashes immediately. I am able to open a pyvista plot using:

from pyvista import examples
globe = examples.load_globe()
globe.plot()

So I know pyvista is working.
I am also getting this warning:
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

import os
import pandas as pd
import numpy as np
import mne
from mne_connectivity.viz import plot_sensors_connectivity
import pyvista
import pyvistaqt
import matplotlib.pyplot as plt

mne.viz.set_3d_backend('pyvistaqt')
# Display five rows and columns pandas
pd.set_option('display.max_rows', 5)
pd.set_option('display.max_columns', 5)
df = pd.read_csv('file.csv')

# Remove everyingthing after ' @' in column channels
df['channels'] = df['channels'].str.split(' @').str[0]
# Remove channels column
array = df.drop(columns=['channels'])
# Convert to numpy array
array = array.to_numpy()

info = mne.create_info(ch_names=df['channels'].to_list(), sfreq=1000, ch_types='eeg')
info.set_montage('standard_1020')
# Now, visualize the connectivity in 3D:
plot_sensors_connectivity(info=info, con=array)

I just reinstalled mne using the installer and it worked.

2 Likes