How to add digitised optode positions/channels to fNIRS data (cortivision)

  • MNE version: 1.5.1
  • operating system: e.g. macOS 13.4.1

I am using a Cortivision fNIRS device to record data and a Structure Sensor Pro to record 3D coordinates of optodes. I would like to know how I can most easily read in the digitised coordinates and replace the coordinates that are specified in the .snirf file.

So far I have been successful at reading in and plotting coordinates for the optodes. I read in a .csv which contains ch_name (optode name), x, z, y per optode, using the following snippet:

# read in coordinates + plot
coords = mne.channels.read_custom_montage(fname = '...',
                                          head_size=1,
                                          coord_frame='mri')
coords.plot();

# replace original coordinates with digited coordinates + plot
raw_intensity = raw_intensity.set_montage(coords)
raw_intensity.plot_sensors();

But then set_montage() isn’t actually replacing the original position information from the .snirf file. From other posts here, I think this is because the coordinates for optodes have the names of single optodes (e.g., S1, S2) and not channel names (e.g., S1_D1 760, S1_D1 850), which the function expects.

Question: Would it be smarter to format a .csv of the channel coordinates (halfway-point between optodes), with each position duplicated for the two wavelengths (760 and 850) with the exact channel names, rather than optode positions? Or is there a way to use the optode positions to generate the channel information, perhaps in the way that mne-nirs does it when reading a .snirf? The latter would help visualise optodes and points of measurement over the brain.

Thanks very much in advance!

@rob-luke Do you maybe know a good way to approach this? Cheers :blush:

Just reviving this. If anyone has a good suggestion on how to import the xyz/optode in MNE that would be fantastic! Def relevant with all the photogrammetry presented at fNIRS2024.