mne-tools / mne-nirs

Process Near-Infrared Spectroscopy Data in MNE
https://mne.tools/mne-nirs/
BSD 3-Clause "New" or "Revised" License
79 stars 35 forks source link

How to use MNE-NIRS with MNE-BIDS? #252

Closed erdalkaraca closed 3 years ago

erdalkaraca commented 3 years ago

I am using read_raw_nirx to read a subject's fnirs data. Is there an (convenient) way to use write_raw_snirf in combination with BIDSPath from mne-bids package?

A quick and dirty way would be

rob-luke commented 3 years ago

Hi Erdal,

Thanks for your interest in using MNE-BIDS and MNE-NIRS. I also saw that you recently reviewed the fNIRS BIDS proposal document, we appreciate your help!

First, the fNIRS BIDS proposal is in development. The proposed specification may change at any moment based on community feedback and should NOT be considered stable. Similarly, the current MNE-BIDS draft pull request for fNIRS often lags behind BIDS extension proposal, typically we received community feedback then the specification is updated and then the code is updated.

Disclaimers aside, the BIDS document was recently updated and I will be updating the MNE-BIDS code (https://github.com/mne-tools/mne-bids/pull/406) in the coming weeks. I also have an example dataset where I demonstrate how to use write_raw_snirf in conjunction with BIDSPath as you enquired about. See this file and associated repository...

https://github.com/rob-luke/BIDS-NIRS-Tapping/blob/184225ea5d292d169b0bf7f1e77bf6c29934b114/code/raw-to-bids.py

But this will create files that are incompatible with the latest draft of the BEP that was edited last week. We are taking the BIDS proposal to the wider community next month and will then present it to the BIDS steering committee. Until it is accepted you should expect regular small changes to the specification. I dont update the code (both MNE-NIRS PR and also the BIDS validator) with every document change, I update the code at what I consider milestones of the document.

I think this conversation is really about MNE-BIDS support, so I will close the comment here and feel free to open up discussion in that repository.

rob-luke commented 3 years ago

One further comment that may be of use to you. The latest changes in the BIDS specification were to how the channel types were stored. So this is where you may find the greatest difference between the specification and the code (until I update it in near future).