-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOC: clarify average EEG reference behavior and update tutorial note #13664
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
base: main
Are you sure you want to change the base?
Changes from all commits
76687f2
f44ea8f
868960b
fe3841c
a8e92a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Clarify in the documentation that :func:`mne.add_reference_channels` | ||
| should be used before :func:`mne.set_eeg_reference` with | ||
| ``ref_channels="average"`` when the original reference electrode | ||
| is missing. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4103,6 +4103,14 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75): | |||||
| EEG signal by setting ``ref_channels='average'``. Bad EEG channels are | ||||||
| automatically excluded if they are properly set in ``info['bads']``. | ||||||
| For sensor-space analyses, if the original reference electrode is not | ||||||
| present as a channel, the resulting average reference is biased because | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(you may need to reflow the text, this might push the line to be too long, didn't check) |
||||||
| the subtracted signal is divided by n channels instead of n + 1 | ||||||
| (including the reference). For a correct average reference, add a | ||||||
| zero-filled reference channel with :func:`~mne.add_reference_channels` | ||||||
| before calling :func:`~mne.set_eeg_reference`. For further discussion, | ||||||
| see Kim et al. (2023, doi:10.3389/frsip.2023.1064138). | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. search our codebase for |
||||||
| - A single electrode: | ||||||
| Set ``ref_channels`` to a list containing the name of the channel that | ||||||
| will act as the new reference, for example ``ref_channels=['Cz']``. | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -141,6 +141,14 @@ | |||||||
| raw_avg_ref = raw.copy().set_eeg_reference(ref_channels="average") | ||||||||
| raw_avg_ref.plot() | ||||||||
|
|
||||||||
| # .. note:: | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
without this, I don't think the admonition will render correctly --- it will just get treated like a block of code comments |
||||||||
| # When computing an average reference, if the dataset does not include | ||||||||
| # the original reference electrode, the average will be biased because the | ||||||||
| # missing channel is ignored. To avoid this, first add a zero-valued | ||||||||
| # reference channel using :func:`mne.add_reference_channels`. This ensures | ||||||||
| # that all intended channels, including the original reference, contribute | ||||||||
| # correctly to the average. | ||||||||
|
|
||||||||
| # %% | ||||||||
| # .. _section-avg-ref-proj: | ||||||||
| # | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take a look at other changelog entries in this folder, and follow the conventions seen there (e.g., include your name at the end as a link). If you're not in
doc/changes/names.incyet, add yourself there too.