ENH: add PCA-based motion correction for fNIRS (motion_correct_pca)#13691
Draft
leonardozaggia wants to merge 7 commits intomne-tools:mainfrom
Draft
ENH: add PCA-based motion correction for fNIRS (motion_correct_pca)#13691leonardozaggia wants to merge 7 commits intomne-tools:mainfrom
leonardozaggia wants to merge 7 commits intomne-tools:mainfrom
Conversation
603d7b1 to
b9d182c
Compare
This was referenced Feb 25, 2026
Member
|
For us to incorporate this, I think we would need explicit permission from a Homer3 maintainer to relicense (the Homer3 software license agreement looks custom, mostly the same as BSD-2 but with an extra paragraph at the end). When we incorporate BSD-licensed code we typically add names and link to the donor project inline in the source file(s) where the adapted/translated code ends up. @leonardozaggia can you tag someone here with relevant authority to give that permission? |
Author
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.
Reference issue (if any)
What does this implement/fix?
Adds
motion_correct_pca(aliaspca) tomne.preprocessing.nirsforPCA-based motion correction of fNIRS data.
The function extracts motion-artifact segments, performs SVD across all
fNIRS channels, removes the dominant principal components explaining the
top
nSVfraction of variance, and reinserts the cleaned segments.Based on Homer3 v1.80.2
hmrR_MotionCorrectPCA(Huppert et al. 2009).Returns the corrected Raw, the normalised singular values, and the number
of components removed.
Additional information
nSVaccepts a fraction (0 < nSV < 1) for variance-explained thresholdor an integer for exact component count.
to mne.preprocessing.nirs: