mne_bids.inspect_dataset() does not open a browse window and only plots a 2D plot instead

MNE version v1.5.1
macOS-12.5-arm64-arm-64bit
MNE BIDS v0.14
Spyder 5.5.4

Hi, I’m starting to work with MNE and the mne_bids package. I would like to interactively mark channels as described in this tutorial: 03. Interactive data inspection and bad channel selection β€” MNE-BIDS 0.15.0.dev48+ge8eb7a7f documentation. However, mne_bids.inspect_dataset() does not work as expected. No browse window opens.

Everything seems fine until this point. My data is in BIDS format, I can find and read the data and meta data. However, when I want to browse the data, no interactive window appears. I do get a 2D plot under β€˜plots’ in Spyder, which looks like what the browser window would normally show, including channel labels and plausible voltage traces; but I cannot do anything with it interactively.

Output in the console upon running mne_bids.inspect_dataset(bids_path, l_freq=1.0, h_freq=30.0) is:

inspect_dataset(bids_path, l_freq=1.0, h_freq=30.0)
Reading 0 ... 969099  =      0.000 ...   969.099 secs...
Finding segments below or above PTP threshold.
Using matplotlib as 2D backend.

I get the feeling that others have struggled as well with some visualization tools or might even had the same problem, but I haven’t found a solution to my particular problem that I could understand or implement. I would be grateful if somebody has an idea if this looks like an issue with uninstalled dependencies, wrong package versions, or settings in Spyder.

I ran python -c "import mne; mne.sys_info()" in the terminal to give you more information on packages:

Platform             macOS-12.5-arm64-arm-64bit
Python               3.11.6 | packaged by conda-forge | (main, Oct  3 2023, 10:37:07) [Clang 15.0.7 ]
Executable           /Users/jjm/miniforge3/envs/mne/bin/python
CPU                  arm (10 cores)
Memory               32.0 GB

Core
β”œβ˜‘ mne               1.5.1
β”œβ˜‘ numpy             1.24.4 (OpenBLAS 0.3.24 with 10 threads)
β”œβ˜‘ scipy             1.11.3
β”œβ˜‘ matplotlib        3.8.0 (backend=MacOSX)
β”œβ˜‘ pooch             1.7.0
β””β˜‘ jinja2            3.1.2

Numerical (optional)
β”œβ˜‘ sklearn           1.3.1
β”œβ˜‘ numba             0.57.1
β”œβ˜‘ nibabel           5.1.0
β”œβ˜‘ nilearn           0.10.2
β”œβ˜‘ dipy              1.7.0
β”œβ˜‘ openmeeg          2.5.6
β”œβ˜‘ pandas            2.1.1
β””β˜ unavailable       cupy

Visualization (optional)
β”œβ˜‘ pyvista           0.42.3 (OpenGL 4.1 Metal - 76.3 via Apple M1 Max)
β”œβ˜‘ pyvistaqt         0.0.0
β”œβ˜‘ vtk               9.2.6
β”œβ˜‘ qtpy              2.4.0 (PyQt5=5.15.8)
β”œβ˜‘ pyqtgraph         0.13.3
β”œβ˜‘ mne-qt-browser    0.6.0
β”œβ˜‘ ipywidgets        8.1.1
β”œβ˜‘ trame_client      2.12.5
β”œβ˜‘ trame_server      2.12.0
β”œβ˜‘ trame_vtk         2.5.9
β”œβ˜‘ trame_vuetify     2.3.1
β””β˜ unavailable       ipympl

Ecosystem (optional)
β”œβ˜‘ mne-bids          0.14
β”œβ˜‘ mne-icalabel      0.6.0
β””β˜ unavailable       mne-nirs, mne-features, mne-connectivity, mne-bids-pipeline

OK, after a cup of tea I was able to solve this issue myself. If anyone experiences the same issue, what solved it for me was:

In Spyder, go to Preferences > IPython console > Graphics tab > Graphics backend and choose β€œautomatic” if you only have β€œinline” activated. This should then enable your backend to use Qt5 for interactive plots.

It worked for me. Do let me know if anyone thinks this is a bodge not a fix and my problem is indicative of a real package version issue or otherwise.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.