Skip to content

FIX: Correct fNIRS interpolation with reordered picks#13856

Merged
larsoner merged 8 commits intomne-tools:mainfrom
Kallemakela:FIX-fnirs-interpolation-reordered-picks
Apr 23, 2026
Merged

FIX: Correct fNIRS interpolation with reordered picks#13856
larsoner merged 8 commits intomne-tools:mainfrom
Kallemakela:FIX-fnirs-interpolation-reordered-picks

Conversation

@Kallemakela
Copy link
Copy Markdown
Contributor

@Kallemakela Kallemakela commented Apr 21, 2026

Reference issue (if any)

Fixes #13857.

What does this implement/fix?

Fixes an indexing bug in _interpolate_bads_nirs

Before this change, _interpolate_bads_nirs mixed up channel indices in the underlying raw object and a local distance matrix when fNIRS channels were reordered by _validate_nirs_info(). This resulted in interpolation based on wrong channels.

This fix maps raw object indices to local distance matrix indices when reading and writing data.

@Kallemakela Kallemakela marked this pull request as ready for review April 21, 2026 13:07
Copy link
Copy Markdown
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll commit and mark for merge-when-green, thanks in advance @Kallemakela !

Comment thread doc/changes/dev/13856.bugfix.rst Outdated
@larsoner larsoner enabled auto-merge (squash) April 23, 2026 15:10
@larsoner larsoner merged commit 66c8e0b into mne-tools:main Apr 23, 2026
32 checks passed
@welcome
Copy link
Copy Markdown

welcome Bot commented Apr 23, 2026

🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪

@Kallemakela Kallemakela deleted the FIX-fnirs-interpolation-reordered-picks branch April 23, 2026 16:31
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.

BUG: fNIRS interpolation mixes reordered and raw channel indices

2 participants