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.