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

DOC: Point out that inverse modeling needs an average reference projector ready to not raise an error #12420

Merged
merged 10 commits into from
Feb 6, 2024
1 change: 1 addition & 0 deletions doc/changes/devel/12401.other.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify in tutorial '55_setting_eeg_reference' that an average reference projector ready is required to not raise an error during inverse modeling, by :newcontrib:`Nabil Alibou`
drammock marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@

.. _Motofumi Fushimi: https://github.com/motofumi-fushimi/motofumi-fushimi.github.io

.. _Nabil Alibou: https://github.com/nabilalibou

.. _Natalie Klein: https://github.com/natalieklein

.. _Nathalie Gayraud: https://github.com/ngayraud
Expand Down
11 changes: 7 additions & 4 deletions tutorials/preprocessing/55_setting_eeg_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
# :meth:`~mne.io.Raw.set_eeg_reference` with ``ref_channels='average'``. Just
# as above, this will not affect any channels marked as "bad", nor will it
# include bad channels when computing the average. However, it does modify the
# :class:`~mne.io.Raw` object in-place, so we'll make a copy first so we can
# :class:`~mne.io.Raw` object in-place, so we'll make a copy first, so we can
# still go back to the unmodified :class:`~mne.io.Raw` object later:

# sphinx_gallery_thumbnail_number = 4
Expand Down Expand Up @@ -241,9 +241,12 @@
# the source modeling is performed. In contrast, applying an average reference
# by the traditional subtraction method offers no such guarantee.
#
# For these reasons, when performing inverse imaging, *MNE-Python will raise
# a ``ValueError`` if there are EEG channels present and something other than
# an average reference strategy has been specified*.
# .. important:: For these reasons, when performing inverse imaging, MNE-Python
# will raise a ``ValueError`` if there are EEG channels present
# and something other than an average reference projector strategy
# has been specified. To ensure correct functioning consider
# calling :meth:`~mne.io.Raw.set_eeg_reference` with
# ``(projection=True)`` to add an average reference projector.
drammock marked this conversation as resolved.
Show resolved Hide resolved
#
# .. LINKS
#
Expand Down
Loading