Can CW amplitude be changed to haemoglobin for files loaded with read_raw_snirf()?

Is there a way to get from the CW amplitude assumed by rawSNIRF objects to oxy/deoxy haemoglobin without actually implementing the optical density and MLBB functions? And is it a good idea?

I’m trying to find the best way to load fNIRS data acquired with a Shimadzu spectrometer. As discussed in this mne-python issue, the data can be extracted in as raw intensity values or haemoglobin concentration, both with 3 columns per channel (for 3 wavelengths or HbO/HbR/HbT). mne-nirs doesn’t yet support more than two wavelengths, so @rob-luke’s suggestion was to load the haemoglobin-concentration data into mne following the custom data import instructions.

I have experimented with loading the haemoglobin-concentration data using read_raw_snirf() and the custom method that requires a CSV file. Using read_raw_snirf(), the montage information, sampling frequency, channel names, trigger information etc. are preserved.

Following the custom instructions, the data has to be reshaped and all the individual pieces of information have added manually, all allowing for more mistakes to slip in. To add these pieces of information manually, I’ve been copying+pasting them from the .info from files loaded with read_raw_snirf(), which makes me think read_raw_snirf() might be the better approach overall.

Is there a way to change channel information be changed from ‘CW amplitude’ to ‘oxy/deoxyhaemoglobin’? I did see the warnings on the mne.Info page, but thought it might still be worth asking.

Many thanks!

Is there a way to change channel information be changed from ‘CW amplitude’ to ‘oxy/deoxyhaemoglobin’?

I think you could use the set_channel_types() function to achieve this. You can pass it a mapping for the type you wish. So you will want to map to the types hbo and hbr. Here is the link to the function…

Currently the read_raw_snirf function only reads raw continuous wave date. It would be good to extend this to reading other data types supported in SNIRF too. SNIRF files support storing HBO and hbr as what they define as processed types. There is already a PR to add support for reading processed snirf data at Feature/td nirs snirf by Zahra-M-Aghajan · Pull Request #9661 · mne-tools/mne-python · GitHub but it is not ready to be merged yet as it also includes adding new types of data. It would be probably quicker to open a dedicated PR just for reading SNIRF files which contain HBO and hbr data, as this change is relatively small.

Please let us know if the set_channel_type approach works for you,

Thanks Rob!

set_channel_type() does change the channel type successfully, but at the same time it scales the data by 1e6 (determined by using raw.to_data_frame() before and after changing the channel type to inspect the values).

Is there a way to avoid scaling the data when changing the channel type?

@rob-luke, do you have any ideas about this scaling issue?

MNE expects the data in SI base units. Sounds like you are loading the data as uMol instead of Mol. Youll need to either scale the data before loading it or simply scale the data after loading it.

Please start new threads when asking a different question so that others can easily find answers when they have the same query.