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

**URL:** <https://mne.discourse.group/t/how-to-add-digitised-optode-positions-channels-to-fnirs-data-cortivision/7758>\
**Category:** Support & Discussions\
**Tags:** fnirs\
**Created:** [October 27, 2023, 2:59pm UTC](https://mne.discourse.group/t/how-to-add-digitised-optode-positions-channels-to-fnirs-data-cortivision/7758 "2023-10-27T14:59:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryssamoffat](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/ryssamoffat/32/912_2.png) [@ryssamoffat](https://mne.discourse.group/u/ryssamoffat)\
**Post date:** [October 27, 2023, 2:59pm UTC](https://mne.discourse.group/t/how-to-add-digitised-optode-positions-channels-to-fnirs-data-cortivision/7758/1 "2023-10-27T14:59:42Z")

</div>

- 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:

```python
# 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!

---

<div class="post-metadata">

**Author:** ![ryssamoffat](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/ryssamoffat/32/912_2.png) [@ryssamoffat](https://mne.discourse.group/u/ryssamoffat)\
**Post date:** [October 31, 2023, 2:24pm UTC](https://mne.discourse.group/t/how-to-add-digitised-optode-positions-channels-to-fnirs-data-cortivision/7758/2 "2023-10-31T14:24:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rhortensius](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@rhortensius](https://mne.discourse.group/u/rhortensius)\
**Post date:** [September 16, 2024, 4:55pm UTC](https://mne.discourse.group/t/how-to-add-digitised-optode-positions-channels-to-fnirs-data-cortivision/7758/3 "2024-09-16T16:55:23Z")

</div>

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.
