Skip to content

Commit

Permalink
DOC: Point out that inverse modeling needs an average reference proje…
Browse files Browse the repository at this point in the history
…ctor ready to not raise an error (#12420)

Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
  • Loading branch information
3 people committed Feb 6, 2024
1 parent acab264 commit 9f0dfef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/changes/devel/12420.other.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify in the :ref:`EEG referencing tutorial <tut-set-eeg-ref>` that an average reference projector ready is required for inverse modeling, by :newcontrib:`Nabil Alibou`
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
12 changes: 8 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,13 @@
# 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:`set_eeg_reference(projection=True)
# <mne.io.Raw.set_eeg_reference>` to add an average
# reference as a projector.
#
# .. LINKS
#
Expand Down

0 comments on commit 9f0dfef

Please sign in to comment.