Skip to content

Conversation

@Edouard2laire
Copy link
Contributor

Adds initial support for NIRS (Near-Infrared Spectroscopy) data processing within the BIDS export functionality.

This includes:

  • Recognizing NIRS data based on channel types.
  • Extracting NIRS-specific metadata (optode counts).
  • Creating 'nirs' subfolder and using '_nirs' suffix.
  • Exporting data to the SNIRF format.
  • Generating an optodes coordinate file.
  • Creating an events TSV file.

Note: I rebased the change from #812 to this branch so i can continue working on it while @JBusgang is busy with classes.

Adds initial support for NIRS (Near-Infrared Spectroscopy) data processing within the BIDS export functionality.

This includes:
- Recognizing NIRS data based on channel types.
- Extracting NIRS-specific metadata (optode counts).
- Creating 'nirs' subfolder and using '_nirs' suffix.
- Exporting data to the SNIRF format.
- Generating an optodes coordinate file.
- Creating an events TSV file.
Adds functionality to export Brainstorm channel files in the BIDS _channels.tsv format, specifically tailored for NIRS data. This enhancement supports the BIDS standard for NIRS data organization.
Adds coordinate system information in json format for NIRS data (ScanRAS exclusively).
Improved export channel option using export_channel, replacing 'out_channel_bids'.
- Adds section of code to generate the .tsv file by calling out_nirs_channel
- Fixes detector labels (previously labelled 'S' instead of 'D')
- Changes channel type to NIRSCWAMPLITUDE, a valid BIDS raw data type. Potential improvement in future to add other valid data types.
- out_nirs_channel header explanation now uses the correct fields
- process_export_bids CreateMegJson has been working, no need for this note.
- Checks datasettype is either 'raw' or 'derivative'
- if not one of the two accepted values, defaults to 'raw' as per BIDS documentation and gives a warning.
- Adds 'FiducialsCoordinates' field with NAS, LPA, and RPA coordinates to coordsystem.json from ChannelMat.SCS
- Sets other fiducials coordinate metadata fields in coordsystem.json
@Edouard2laire Edouard2laire marked this pull request as draft September 30, 2025 15:34
@Edouard2laire
Copy link
Contributor Author

Edouard2laire commented Nov 11, 2025

ok. it's ready for review.

There are still some issue with the coordinate system, but I will fix them in a following PR so we can address the coordinates for EEG/MEG and Nirs at the same time.

I also want to move to matlab_bids to generate the file name and reoganize the process but in a other PR :)

@Edouard2laire Edouard2laire marked this pull request as ready for review November 11, 2025 20:24
@Edouard2laire Edouard2laire changed the title [export bids] Adds basic NIRS support (two) [export bids] Adds basic NIRS support Nov 11, 2025
@Edouard2laire
Copy link
Contributor Author

Edouard2laire commented Nov 11, 2025

One thing i dont understand is why the fiducials are not preserved after export/import :

image

Actually, our import for channel is kind of a mess and wrong for nirs. i am not sure how to fix it though.... I guess we need to have the script import the channel.tsv as it contains the info. but it also needs to read the json for the coordinate system.

@Edouard2laire
Copy link
Contributor Author

ok. so exporting in CTF is somehow fixing the coordinates.

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