Repository navigation
Add Python DataFilter.rereference_channels for EEG/EXG - #870
Open
OgarkovAnton wants to merge 2 commits into
Open
OgarkovAnton wants to merge 2 commits into
OgarkovAnton wants to merge 2 commits into
Conversation
Implements brainflow-dev#619 with a Python-only helper that subtracts the mean of selected reference channels from non-excluded channels, plus unit tests and CI coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Andrey1994
self-requested a review
November 2, 2026 23:05
Andrey1994
requested changes
Nov 2, 2026
Andrey1994
left a comment
Member
There was a problem hiding this comment.
hi and thanks!
https://brainflow.readthedocs.io/en/stable/BrainFlowDev.html should be a good starting point about how c++ methods are called from other languages in brainflow, this should follow the same pattern instead of implementing it in python directly
| :type excluded_channels: list or tuple or ndarray or None | ||
| :return: new 2d array with the same shape as ``data`` | ||
| :rtype: NDArray[Shape["*, *"], Float64] | ||
| :raises ValueError: if ``data`` is not a non-empty 2d array, ``reference`` is empty, |
Member
There was a problem hiding this comment.
instead of implementing it in the python layer directly it should follow the workflow as for other methods(should be done in c++ and other languages should call it from there)
Move channel re-referencing from a Python-only helper into the native DataHandler C API with an in-place channels/reference_channels API, then expose it through C++ and the other language bindings per review on brainflow-dev#619. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #619 with a Python-only helper that subtracts the mean of selected reference channels from non-excluded channels, plus unit tests and CI coverage.