question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support Laplacian referencing for EEG

See original GitHub issue

Describe the new feature or enhancement

Add support for Laplacian (sometimes called local average) referencing for EEG.

Here is one reference: https://doi.org/10.1016/j.ijpsycho.2015.04.023 though it’s part of a special issue on current source density analysis so there are likely other papers worth consulting before implementing.

Describe your proposed implementation

as a new option mne.set_eeg_reference(ref_channels='local') The function would probably also need a new param for the distance threshold.

Describe possible alternatives

could make a dedicated function instead. set_eeg_reference is already overloaded to handle REST referencing (with extra param forward) so I don’t see the harm in extending it to Laplacian as well.

Additional comments

Requested on the forum https://mne.discourse.group/t/laplacian-or-local-average-reference-in-mne/3415

cross-ref to #8481 where Laplacian referencing was mentioned for sEEG, although I think the implementation for that would likely be fairly different, given the shaft-based vs scalp-based electrodes.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mmagnuskicommented, Aug 12, 2021

@paulokanda @drammock Sometimes the terms “Laplacian” and “Current Source Density” are used interchangeably (see for example: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4610715/). Are we sure that in this context CSD (which can be done in mne) is not good enough?

0reactions
larsonercommented, Jun 3, 2022

IIRC the average ref is done within the Laplacian/CSD code internally, so it shouldn’t matter whether or not you apply one first. But feel free to check in code or by example

then it would be useful for visibility to have this as an explicit option in mne.set_eeg_reference()

Since it changes the channel type in MNE it does a bit more than this function/method typically does. I’d rather leave it as a separate function, and just mention it somewhere in the Notes and/or See Also. Would you be up for updating the docstring of set_eeg_reference @DominiqueMakowski to reference the CSD function in some way that makes it more discoverable?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Re-reference EEG and iEEG data - FieldTrip toolbox
The Laplacian re-referencing scheme is relatively similar to the bipolar scheme. It allows to reduce the number of task-correlated channels by ...
Read more >
Comparing Common Average Referencing to Laplacian ...
In this paper the EEG signal was filtered by spatial filter namely CAR and. LAP. CAR is one of the reference-free techniques that...
Read more >
Laplacian or local average reference in mne
I'm configuring a GUI using tkinter. Is that possible to configure laplacian (local average reference) in mne EEG. It is good dealing at...
Read more >
Use of common average reference and large ... - PubMed
Use of common average reference and large-Laplacian spatial-filters enhances EEG signal-to-noise ratios in intrinsic sensorimotor activity.
Read more >
Laplacian reference preprocessing for the 9th channel of EEG ...
... reference adjusts the signal at each electrode by subtracting the average of the neighboring electrodes. The Laplacian method is effective in reducing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found