Skip to content

Feature/td nirs snirf#13938

Open
jcrdubois wants to merge 14 commits into
mne-tools:mainfrom
jcrdubois:feature/TD-nirs_snirf
Open

Feature/td nirs snirf#13938
jcrdubois wants to merge 14 commits into
mne-tools:mainfrom
jcrdubois:feature/TD-nirs_snirf

Conversation

@jcrdubois
Copy link
Copy Markdown

@jcrdubois jcrdubois commented Jun 1, 2026

Closes #11064

What does this implement/fix?

read TD-fNIRS files, e.g. from Kernel Flow, with MNE.
Adds Hb, histograms, and moments support

TODO

jcrdubois added 8 commits May 29, 2026 13:38
Add support for time-domain NIRS data types including:
- TD gated histograms (fnirs_td_gated_amplitude)
- TD moments (intensity, mean, variance)
- Processed hemoglobin data (HbO/HbR)

Updates constants, channel picking, covariance, defaults, and the
SNIRF reader/tests to handle these new data types.
The old files (Portal_2021_11) don't conform to the SNIRF spec —
they store HbO/HbR in micromolar without declaring dataUnit. Rather
than adding heuristics, remove these tests. The files can be fixed
upstream by adding a proper dataUnit field to the HDF5.
Check shape, channel type, photon count range, and that channel
metadata (wavelength, time_delay * width) are populated.
TD gated channels measure photon counts from single-photon counting
detectors, not voltages. Use FIFF_UNIT_UNITLESS (matching
fnirs_td_moments_intensity) instead of FIFF_UNIT_V.
@jcrdubois jcrdubois mentioned this pull request Jun 1, 2026
13 tasks
@larsoner
Copy link
Copy Markdown
Member

larsoner commented Jun 1, 2026

@jcrdubois I merged the constants PR, I agree it's time to get this in! We wanted some example in mne-nirs ideally to make use of this functionality, in the end mne-tools/mne-nirs#586 never did IIRC. What do you think about adding one there first?

@jcrdubois
Copy link
Copy Markdown
Author

jcrdubois commented Jun 1, 2026

@jcrdubois I merged the constants PR, I agree it's time to get this in! We wanted some example in mne-nirs ideally to make use of this functionality, in the end mne-tools/mne-nirs#586 never did IIRC. What do you think about adding one there first?

@larsoner added a TD moments example here
cc @JohnGriffiths

I don't have a gated dataset available publicly yet, but maybe this is enough to demonstrate the moments?

Comment thread mne/_fiff/tests/test_constants.py Outdated
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.

2 participants