Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRG: Make Inspector work even if mne-qt-browser is installed #1007

Merged
merged 1 commit into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Detailed list of changes

- Suppress superfluous warnings about MaxShield in many functions when handling Elekta/Neuromag/MEGIN data, by `Richard Höchenberger`_ (:gh:`1000`)

- The MNE-BIDS Inspector didn't work if ``mne-qt-browser`` was installed and used as the default plotting backend, as the Inspector currently only supports the Matplotlib backend, by `Richard Höchenberger`_ (:gh:`1007`)

:doc:`Find out what was new in previous releases <whats_new_previous_releases>`

.. include:: authors.rst
13 changes: 9 additions & 4 deletions mne_bids/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from mne.utils import logger, verbose
from mne.fixes import _compare_version
from mne.viz import use_browser_backend

if _compare_version(mne.__version__, '<', '1.0.dev0'): # pragma: no cover
from mne.preprocessing import annotate_flat
Expand Down Expand Up @@ -155,10 +156,14 @@ def _inspect_raw(*, bids_path, l_freq, h_freq, find_flat, show_annotations):
flat_chans = []

show_options = bids_path.datatype == 'meg'
fig = raw.plot(title=f'{bids_path.root.name}: {bids_path.basename}',
highpass=l_freq, lowpass=h_freq,
show_options=show_options,
block=False, show=False, verbose='warning')

with use_browser_backend('matplotlib'):
fig = raw.plot(
title=f'{bids_path.root.name}: {bids_path.basename}',
highpass=l_freq, lowpass=h_freq,
show_options=show_options,
block=False, show=False, verbose='warning'
)

# Add our own event handlers so that when the MNE Raw Browser is being
# closed, our dialog box will pop up, asking whether to save changes.
Expand Down