Skip to content

Commit 7e9310f

Browse files
Dpereaptkhamur-13pre-commit-ci[bot]tsbinnsFarzah11
authored
DOC: clarify add_reference_channels usage (Takeover #13664) (#13846)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Thomas S. Binns <t.s.binns@outlook.com> Co-authored-by: Farzah11 <184847039+Farzah11@users.noreply.github.com>
1 parent ff724e1 commit 7e9310f

5 files changed

Lines changed: 30 additions & 0 deletions

File tree

doc/changes/dev/13846.other.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add notes to :func:`~mne.set_eeg_reference` and :ref:`tut-set-eeg-ref` about the correct procedure to create an average reference, by :newcontrib:`Deep Kaur` and :newcontrib:`Farzah11`.

doc/changes/names.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
.. _David Haslacher: https://github.com/davidhaslacher
7575
.. _David Julien: https://github.com/Swy7ch
7676
.. _David Sabbagh: https://github.com/DavidSabbagh
77+
.. _Deep Kaur: https://github.com/Dpereaptkhamur-13
7778
.. _Demetres Kostas: https://github.com/kostasde
7879
.. _Denis Engemann: https://denis-engemann.de
7980
.. _Dev Parikh: https://github.com/devparikh0506
@@ -103,6 +104,7 @@
103104
.. _Ezequiel Mikulan: https://github.com/ezemikulan
104105
.. _Fahimeh Mamashli: https://github.com/fmamashli
105106
.. _Famous077: https://github.com/Famous077
107+
.. _Farzah11: https://github.com/Farzah11
106108
.. _Farzin Negahbani: https://github.com/Farzin-Negahbani
107109
.. _Federico Raimondo: https://github.com/fraimondo
108110
.. _Federico Zamberlan: https://github.com/fzamberlan

doc/references.bib

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,16 @@ @article{KhanEtAl2018
972972
year = {2018}
973973
}
974974

975+
@article{KimEtAl2023,
976+
author = {Kim, Hyeonseok and Luo, Justin and Chu, Shannon and Cannard, Cedric and Hoffmann, Sven and Miyakoshi, Makoto},
977+
doi = {10.3389/frsip.2023.1064138},
978+
journal={Frontiers in Signal Processing},
979+
pages = {1064138},
980+
title={{ICA}’s bug: How ghost {IC}s emerge from effective rank deficiency caused by {EEG} electrode interpolation and incorrect re-referencing},
981+
volume = {3},
982+
year = {2023},
983+
}
984+
975985
@article{KingDehaene2014,
976986
author = {King, Jean-Rémi and Dehaene, Stanislas},
977987
doi = {10.1016/j.tics.2014.01.002},

mne/utils/docs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4173,6 +4173,13 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
41734173
EEG signal by setting ``ref_channels='average'``. Bad EEG channels are
41744174
automatically excluded if they are properly set in ``info['bads']``.
41754175
4176+
.. note::
4177+
When performing average referencing in sensor-space analyses, the original reference
4178+
electrode should be present as a zero-filled channel. If it is not, this must first
4179+
be added using :func:`~mne.add_reference_channels`, before calling
4180+
:func:`~mne.set_eeg_reference`. This is necessary to avoid biasing the reference
4181+
:footcite:`KimEtAl2023`.
4182+
41764183
- A single electrode:
41774184
Set ``ref_channels`` to a list containing the name of the channel that
41784185
will act as the new reference, for example ``ref_channels=['Cz']``.

tutorials/preprocessing/55_setting_eeg_reference.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@
141141
raw_avg_ref = raw.copy().set_eeg_reference(ref_channels="average")
142142
raw_avg_ref.plot()
143143

144+
# %%
145+
# .. note::
146+
# When performing average referencing in sensor-space analyses, the original reference
147+
# electrode should be present as a zero-filled channel. If it is not, this must first
148+
# be added using :func:`~mne.add_reference_channels`, before calling
149+
# :func:`~mne.set_eeg_reference`. This is necessary to avoid biasing the reference
150+
# :footcite:`KimEtAl2023`, as the subtracted reference signal would be divided by
151+
# ``n_channels`` instead of the correct ``n_channels + 1`` (i.e., including the
152+
# original reference channel).
153+
144154
# %%
145155
# .. _section-avg-ref-proj:
146156
#

0 commit comments

Comments
 (0)