mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.72k stars 1.32k forks source link

Add support for NIRx fNIRS data in SNIRF format #9338

Closed rob-luke closed 3 years ago

rob-luke commented 3 years ago

Describe the new feature or enhancement

We currently have a SNIRF reader that works with files produced using the society for fNIRS approved generator/converter.

However, there is quite some flexibility in the specification. Further, we only support a subset of the specifiation (for example we do not support anything other than continuous wave spectroscopy, and we dont support 2D locations).

NIRx now export their data as SNIRF. This is great. However, they do not export some fields that are optional in the spec. And currently our reader expects these data fields. So the reader needs to be modified to be forgiving if these optional fields are missing, or it needs to throw a usefull error.

Describe your proposed implementation

I have recorded some data with a NIRSport2 device in snirf format. I will add this to the test data repository and I will then update our reader to gracefully handle these missing fields.

My initial investigation indicates that the fields we need to not expect are

so this shouldnt be too much work for me.

I will also use this oppurtunity to all other fields we expect are "required" and try not to rely on optional fields.

Additional comments

I am writing this here so everyone knows and does not try to duplicate effort.

I will also address https://github.com/mne-tools/mne-nirs/issues/257

FYI @robquant @HanBnrd @larsoner

rob-luke commented 3 years ago

In the case that these fields are missing I am going to assign the following naming structure...

larsoner commented 3 years ago

All sounds good @rob-luke !