-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOC: clarify add_reference_channels usage (Takeover #13664) #13846
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
b8cb797
e270d35
5ecd0c0
f261a66
2231721
e110c7c
922c26f
d39b245
c3ecfd2
2bef1d5
dbee994
f26d305
effcec1
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 @@ | ||
| Clarify average EEG reference behavior in documentation for add_reference_channels. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2566,3 +2566,13 @@ @inproceedings{MellotEtAl2024 | |
| year = {2024}, | ||
| address = {Lyon, France} | ||
| } | ||
|
|
||
| @article{AppelhoffSanderson2023, | ||
| author = {Appelhoff, Stefan and Sanderson, Nathan}, | ||
| title = {The importance of adding a zero-filled channel for the reference electrode when re-referencing to average reference}, | ||
| journal = {Frontiers in Signal Processing}, | ||
| year = {2023}, | ||
| doi = {10.3389/frsip.2023.1064138}, | ||
| volume = {3}, | ||
| pages = {1064138} | ||
| } | ||
|
Comment on lines
+2570
to
+2578
Contributor
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. Two things:
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -812,6 +812,8 @@ def add_reference_channels(self, ref_channels): | |
| ------- | ||
| inst : same type as the input data | ||
| The modified instance. | ||
|
|
||
|
|
||
|
Comment on lines
+815
to
+816
Contributor
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. Please remove these blank lines. |
||
| """ | ||
| return add_reference_channels(self, ref_channels, copy=False) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4104,7 +4104,13 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75): | |||||||||||||||||||||||
| - Average reference: | ||||||||||||||||||||||||
| A new virtual reference electrode is created by averaging the current | ||||||||||||||||||||||||
| EEG signal by setting ``ref_channels='average'``. Bad EEG channels are | ||||||||||||||||||||||||
| automatically excluded if they are properly set in ``info['bads']``. | ||||||||||||||||||||||||
| automatically excluded if they are pproperly set in ``info['bads']``. | ||||||||||||||||||||||||
|
Contributor
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
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| "add_reference_channels_note": """.. note:: When performing average referencing in sensor-space analyses and the | ||||||||||||||||||||||||
| original reference electrode is not present as a zero-filled channel, | ||||||||||||||||||||||||
| this must first be added using :func:`~mne.add_reference_channels` | ||||||||||||||||||||||||
| before calling :func:`~mne.set_eeg_reference` to avoid biasing the | ||||||||||||||||||||||||
| reference :footcite:`AppelhoffSanderson2023`. """, | ||||||||||||||||||||||||
|
Comment on lines
+4109
to
+4113
Contributor
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
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - A single electrode: | ||||||||||||||||||||||||
| Set ``ref_channels`` to a list containing the name of the channel that | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,6 +146,13 @@ | |
| # | ||
| # Creating the average reference as a projector | ||
| # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| # .. note:: When performing average referencing in sensor-space analyses and | ||
| # the original reference electrode is not present as a zero-filled | ||
| # channel, this must first be added using | ||
| # :func:`~mne.add_reference_channels` before calling | ||
| # :func:`~mne.set_eeg_reference` to avoid biasing the reference | ||
| # :footcite:`AppelhoffSanderson2023`. | ||
|
Comment on lines
+149
to
+155
Contributor
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. Please copy the changes from the note in the docstring, including the proper formatting. |
||
| # | ||
| # If using an average reference, it is possible to create the reference as a | ||
| # :term:`projector` rather than subtracting the reference from the data | ||
|
|
||
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.
A couple things:
newcontribtag to the end of the text.otherwould be more appropriate.Precise details for all of this are in the contribution guide. Please follow the instructions there.