Problems using 'set_montage' - fNIRS (Hitachi-raw data)

I am student and just started working on my first fNIRS project. Unfortunately, my supervisors have never used MNE and can’t help me, so I really hope you can!

I am using the following version/system:

  • MNE version: e.g. 1.0.3
  • operating system: Windows 10

I instantiated objects (montage11=left and right hemi., montage11_1=left hemi, montage11_2= right hemi) of DigMontage instance. I then plottet the montage, see image.

After that I tried to use the set_montage method on the raw Hitachi-raw object. The left hemisphere worked perfectly, however I got no error on the right hemisphere (montage11_2).

montage11 = self_montage(file_path='Data/S11/0001.pos', csv_file='Data/S11/0001_edit.csv')

# left hemisphere (Probe 1)
montage11_1 = self_montage(file_path='Data/S11/0001.pos', csv_file='Data/S11/probe1_channel_montage.csv')

# right hemisphere (Probe 2)
montage11_2 = self_montage(file_path='Data/S11/0001.pos', csv_file='Data/S11/probe2_channel_montage.csv')

# mne.set_montage right hemisphere: raises Error - IndexError: index 44 is out of bounds for axis 0 with size 44

Do you know what the problem is and how I can make it work for both hemisphere?

do you have more channels in montage11_1 than in your actual data?


1 Like

Hi Alex,

I have 15 montage/coordinate points for each hemisphere (Source/Detector), I renamed them in the specific S/D form. The data-recording is then inbetween the 1-22, 23-44 points. Do I have to set them to be the channels? And if so how should I name them?

left hemisphere:

right hemisphere:


can you save your montage with the .save method and the info of your data with and share it with us?


Thank you for your fast response and help! I tried to save/write_info but the encoding (utf-8 etc.) seems to be wrong when I try to save it as a .txt file. :thinking:
Best, Rebi

I printed the and now, and get the following: will write to a .fif file. So do“debug-info.fif”, info)

this should work.


1 Like

Oh okay, thank you!
All the infos - debug-info1/debug-info2.fif is in the folder [00-info]
here is my github link:

Best - Rebi

From office hours, this is a limitation with read_raw_hitachi where we should support multiple csv files, one per probe. @rfahrn will open a GitHub issue, and then hopefully we can fix it soon!

1 Like