Skip to content

Support fNIRS data with more than two wavelengths (e.g. Shimadzu devices or broadband fNIRS) #9816

Open

Description

@ryssamoffat

Describe the new feature or enhancement

Support for fNIRS data acquired with three wavelengths, specifically from Shimadzu fNIRS devices.

Describe your proposed implementation

Using mne-python v0.24.dev0 and mne-nirs v0.1.2.dev, read_raw_snirf() will not load fNIRS data with 3 wavelengths (780, 805, 830) and expects only 2 wavelengths. The error message is "NIRS channels not ordered correctly. Channels must be ordered as source detector pairs with alternating frequencies: 780 & 805"

Using previous versions of mne-python (0.21.2) and mne-nirs (v0.0.1), it was possible to load the 3-wavelength data then to use drop_channels() to remove the channels associated with wavelength 830 before proceeding.

Here is some some sample data: sample_shimadzu_data.snirf

Thanks in advance!

Activity

  1. welcome commented on Oct 8, 2021

    @welcome

    Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

  2. larsoner commented on Oct 8, 2021

    @larsoner
    Member

    @rob-luke ideas?

  3. rob-luke commented on Oct 8, 2021

    @rob-luke
    Member

    Thanks Ryssa,

    Could you provide a few more pieces of info:

    • What is the exact piece of hardware that you are using, model name etc
    • What is the acquisition software and version you are using?
    • Does the acquisition software export directly in SNIRF format?
    • If not, can you provide the script to convert the data to SNIRF

    But the report is clear and makes sense to me. Thank you for sharing the data, that enabled me to reproduce the error locally. Currently MNE only supports two wavelength systems. We added additional checks and warnings in the last year, so that is why you now get an error.

    We could add support for multi wavelength fNIRS data. This would require a medium amount of effort from someone, primarily in the Beer Lambert conversion to haemoglobin, and updating our sanity checks throughout the functions. The PR would need to have some research done on to how this extra information is usually utilised, I have some guesses, but it should be properly investigated including in literature and comparison to other software packages like Homer.

    But if you are happy to simply throw away the third wavelength and use MNE as it is now, then it would be considerably less work to update the SNIRF reader to not assume two wavelengths. If we update the SNIRF reader to read arbitrary number of wavelengths (or let user specify the wavelengths they want) would that be sufficient to start with @ryssamoffat?

  4. ryssamoffat commented on Oct 22, 2021

    @ryssamoffat
    Author

    Hi Rob,

    Hardware: Shimadzu LightNIRS

    Acquisition Software: Shimadzu's own software called "fNIRS", v1.0 (version numbers do not seem to be updated).
    Data can be exported for use in other software as a TXT file with either with raw intensity (column for each of the 3 wavelengths) or haemoglobin values (columns for HbO, HbR and HbT).

    Conversion to SNIRF: Shimadzu provided a script for conversion to NIRS, to which I added the Homer 3 functions to further convert the data to SNIRF. The Shim2Nirs2Snirf.m script requires an SD file with the probe position information. Both can be found here.

    Feature request: Added support for multiwavelength fNIRS data would be wonderful.
    In the mean time, the option to load more than two wavelengths and discard one would be very helpful for setting up pipelines!

    Please let me know if you need any more information.

  5. rob-luke commented on Oct 24, 2021

    @rob-luke
    Member

    Thanks Ryssa for the details,

    I think we should add support for processing fNIRS data with an arbitrary number of wavelengths in MNE. Broadband fNIRS was a big topic at the recent fNIRS 2021 conference and will be added to more commercial devices and be utilised by more labs. Adding support for multiple wavelengths in the SNIRF file is definetly the way to go, rather than adding support for each vendor format individually. @ryssamoffat could your team open a pull request to make this change? If not, then I can chip away at it, but with no specific timeline.

    A short term pragmatic solution may be to take the haemoglobin concentrations as exported by the vendor software and read them using the instructions at https://mne.tools/dev/auto_tutorials/io/30_reading_fnirs_data.html#custom-data-import (being sure to drop the HbT column).

  6. ryssamoffat commented on Oct 24, 2021

    @ryssamoffat
    Author

    Thanks Rob. Unfortunately we won't be able to open a pull request.
    As for the suggestion to load the haemoglobin concentrations, I'll start with that, thank you!

  7. rob-luke commented on Oct 24, 2021

    @rob-luke
    Member

    Ok, and I will note in this thread as we make steps towards this goal.

  8. changed the title [-]Reading fNIRS data with 3 wavelengths (Shimadzu devices)[/-] [+]Read fNIRS SNIRF files data with more than two wavelengths (e.g. Shimadzu devices or broadband fNIRS)[/+] on Oct 24, 2021
  9. changed the title [-]Read fNIRS SNIRF files data with more than two wavelengths (e.g. Shimadzu devices or broadband fNIRS)[/-] [+]Support fNIRS data with more than two wavelengths (e.g. Shimadzu devices or broadband fNIRS)[/+] on Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions