Skip to content

Commit 9f0dfef

Browse files
nabilaliboudrammocklarsoner
authored
DOC: Point out that inverse modeling needs an average reference projector ready to not raise an error (#12420)
Co-authored-by: Daniel McCloy <[email protected]> Co-authored-by: Eric Larson <[email protected]>
1 parent acab264 commit 9f0dfef

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

doc/changes/devel/12420.other.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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`

doc/changes/names.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@
390390

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

393+
.. _Nabil Alibou: https://github.com/nabilalibou
394+
393395
.. _Natalie Klein: https://github.com/natalieklein
394396

395397
.. _Nathalie Gayraud: https://github.com/ngayraud

tutorials/preprocessing/55_setting_eeg_reference.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
# :meth:`~mne.io.Raw.set_eeg_reference` with ``ref_channels='average'``. Just
132132
# as above, this will not affect any channels marked as "bad", nor will it
133133
# include bad channels when computing the average. However, it does modify the
134-
# :class:`~mne.io.Raw` object in-place, so we'll make a copy first so we can
134+
# :class:`~mne.io.Raw` object in-place, so we'll make a copy first, so we can
135135
# still go back to the unmodified :class:`~mne.io.Raw` object later:
136136

137137
# sphinx_gallery_thumbnail_number = 4
@@ -241,9 +241,13 @@
241241
# the source modeling is performed. In contrast, applying an average reference
242242
# by the traditional subtraction method offers no such guarantee.
243243
#
244-
# For these reasons, when performing inverse imaging, *MNE-Python will raise
245-
# a ``ValueError`` if there are EEG channels present and something other than
246-
# an average reference strategy has been specified*.
244+
# .. important:: For these reasons, when performing inverse imaging, MNE-Python
245+
# will raise a ``ValueError`` if there are EEG channels present
246+
# and something other than an average reference projector strategy
247+
# has been specified. To ensure correct functioning consider
248+
# calling :meth:`set_eeg_reference(projection=True)
249+
# <mne.io.Raw.set_eeg_reference>` to add an average
250+
# reference as a projector.
247251
#
248252
# .. LINKS
249253
#

0 commit comments

Comments
 (0)