Skip to content

Take online reference channel into account for average reference + add re-referencing for raw/continuous data#1184

Open
jschepers wants to merge 7 commits intomne-tools:mainfrom
s-ccs:upstream/main
Open

Take online reference channel into account for average reference + add re-referencing for raw/continuous data#1184
jschepers wants to merge 7 commits intomne-tools:mainfrom
s-ccs:upstream/main

Conversation

@jschepers
Copy link
Contributor

To ensure that the correct number of channels is considered for the average re-referencing (mne-tools/mne-python#13618) I added the following functionality:

  • I introduced a function set_initial_average_reference that optionally adds the online reference (specified by the user in the config file) to the data before computing an average reference. The function uses an average reference projection but does not apply it yet.
  • The application of the projection happens outside of the function. Afterwards, optionally one can drop the reconstructed online reference channel again. Note: if it's not dropped then there will be one more channel in the data than before.
  • I also implemented that the reference specified in the config file is also applied to the raw/continuous data (not only to the epoched data). Thereby this issue fixes Re-referencing for raw (continuous) data only seems to be applied in certain cases #1169.
  • After a few discussions we decided to add the re-referencing before the application of the ICA and not do add it again afterwards because currently it's not completely clear to us whether that's desired or even appropriate.

I'm happy to hear what you think about this approach.

Cheers,
Judith

@autofix-ci
Copy link
Contributor

autofix-ci bot commented Feb 17, 2026

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-referencing for raw (continuous) data only seems to be applied in certain cases

1 participant