Custom fNIRS Montage


  • Python: 3.10.6
  • MNE version: e.g. 1.1.1
  • operating system: Windows 10

For my research I use a Shimadzu Foire-300 and am able to properly create RawArray files. However, I am having issues with creating a proper DIGMontages. I tried to follow your answers on other support discussions but to no result.

Because of the Foire-3000 not returning optical density data we only have a RawArray using hbo and hbr data, setting up the montage and plotting it seems to work reasonably. However when applying the montage to the RawArray I get the following error:

ValueError : ‘S10’ is not in list

and earlier I get a warning:

“Consider setting the channel types to be of EEG/sEEG/ECoG/DBS/fNIRS using inst.set_channel_types before calling inst.set_montage, or omit these channels when creating your montage.”

I feel as if these two messages are connected but don’t know how to solve it. I tried setting channel types to no avail and tried reduce the double hbo/hbr channel names to only include hbo channels.

I looked into the source code and noticed that .set_montage splits the channel names by ‘_’ and then tries to index the channel names by their split[0] and split[1] parts. However it seems to go wrong here and I don’t really know what step I should take to correctly create sensor locations for my data.

I hope to find an answer to a couple of questions:

  • if I have hbr/hbo channels should I set up the digital montage with 51 or 102 channels?
  • Is my set up of channel names and coordinates proper?
  • with my limited fiducials what is the best coordinate frame: mri, head or unknown?

My Code:

dict_ch_pos = {'CH01': [18.592699,1.143265,0.035148],

chan_names = [
'S1_D1 hbo', 'S1_D1 hbr',       # 1
'S2_D1 hbo', 'S2_D1 hbr',       # 2
'S1_D2 hbo', 'S1_D2 hbr',       # 3
'S2_D2 hbo', 'S2_D2 hbr',       # 4
'S3_D2 hbo', 'S3_D2 hbr',       # 5
'S2_D3 hbo', 'S2_D3 hbr',       # 6
'S3_D3 hbo', 'S3_D3 hbr',       # 7
'S4_D3 hbo', 'S4_D3 hbr',       # 8
'S6_D3 hbo', 'S6_D3 hbr',       # 9
'S4_D4 hbo', 'S4_D4 hbr',       # 10
'S7_D4 hbo', 'S7_D4 hbr',       # 11
'S3_D5 hbo', 'S3_D5 hbr',       # 12
'S5_D5 hbo', 'S5_D5 hbr',       # 13
'S6_D5 hbo', 'S6_D5 hbr',       # 14
'S8_D5 hbo', 'S8_D5 hbr',       # 15
'S4_D6 hbo', 'S4_D6 hbr',       # 16
'S6_D6 hbo', 'S6_D6 hbr',       # 17
'S7_D6 hbo', 'S7_D6 hbr',       # 18
'S9_D6 hbo', 'S9_D6 hbr',       # 19
'S5_D7 hbo', 'S5_D7 hbr',       # 20
'S8_D7 hbo', 'S8_D7 hbr',       # 21
'S10_D7 hbo', 'S10_D7 hbr',     # 22
'S6_D8 hbo', 'S6_D8 hbr',       # 23
'S8_D8 hbo', 'S8_D8 hbr',       # 24
'S9_D8 hbo', 'S9_D8 hbr',       # 25
'S11_D8 hbo', 'S11_D8 hbr',     # 26
'S7_D9 hbo', 'S7_D9 hbr',       # 27
'S9_D9 hbo', 'S9_D9 hbr',       # 28
'S12_D9 hbo', 'S12_D9 hbr',     # 29
'S8_D10 hbo', 'S8_D10 hbr',     # 30
'S10_D10 hbo', 'S10_D10 hbr',   # 31
'S11_D10 hbo', 'S11_D10 hbr',   # 32
'S13_D10 hbo', 'S13_D10 hbr',   # 33
'S9_D11 hbo', 'S9_D11 hbr',     # 34
'S11_D11 hbo', 'S11_D11 hbr',   # 35
'S12_D11 hbo', 'S12_D11 hbr',   # 36
'S14_D11 hbo', 'S14_D11 hbr',   # 37
'S10_D12 hbo', 'S10_D12 hbr',   # 38
'S13_D12 hbo', 'S13_D12 hbr',   # 39
'S15_D12 hbo', 'S15_D12 hbr',   # 40
'S11_D13 hbo', 'S11_D13 hbr',   # 41
'S13_D13 hbo', 'S13_D13 hbr',   # 42
'S14_D13 hbo', 'S14_D13 hbr',   # 43
'S16_D13 hbo', 'S16_D13 hbr',   # 44
'S12_D14 hbo', 'S12_D14 hbr',   # 45
'S14_D14 hbo', 'S14_D14 hbr',   # 46
'S13_D15 hbo', 'S13_D15 hbr',   # 47
'S15_D15 hbo', 'S15_D15 hbr',   # 48
'S16_D15 hbo', 'S16_D15 hbr',   # 49
'S14_D16 hbo', 'S14_D16 hbr',   # 50
'S16_D16 hbo', 'S16_D16 hbr',   # 51

#### Fiducials and scaling
nasion = [x*0.01 for x in [11.232580,0.487142,0.482432]]
lpa = [x*0.01 for x in [8.851848,6.727137,10.000131]]
rpa = [x*0.01 for x in [9.345170,-6.998555,8.775833]]
hsp = [x*0.01 for x in [24.690950,-0.762161,11.439560]]

for k, v in dict_ch_pos.items():
  dict_ch_pos[k] = [x*0.01 for x in v]

final_pos = [.]
for x in dict_ch_pos.values():

values = list(dict_ch_pos.values())
locations = dict(zip(chan_names, final_pos))
chan_types = ['hbo', 'hbr'] * 51
channel_types = dict(zip(chan_names, chan_types))

montage = mne.channels.make_dig_montage(ch_pos=locations, nasion=nasion, lpa=lpa, rpa=rpa, coord_frame='head') 

info = mne.create_info(ch_names=chan_names, ch_types=chan_types, sfreq=sfreq)
raw_haemo =, info, verbose=True)['bads'] = ['S2_D3 hbo', 'S2_D3 hbr', 'S3_D3 hbo', 'S3_D3 hbr', 'S4_D3 hbo', 'S4_D3 hbr', 'S6_D3 hbo', 'S6_D3 hbr']


I appreciate everyone’s effort to help and thank you in advance!



Hi Jim,

Thanks for reporting this issue. And it’s great to see someone using MNE with a Shimadzu device. We should write a proper reader for your hardware so you don’t have to load data by hand.

But in the meantime, you need to follow the specific naming of the channels as described in Importing data from fNIRS devices — MNE 1.2.dev0 documentation I hope this will resolve your issue.

Please let us know if this resolves the issue.

Thank you for your reply. I was able to fix it by properly naming it! Problem resolved!

Great to hear! Please let us know if you encounter any other issues. Be extra vigilant as you are using a device that is untested with MNE (although I don’t expect any issues)

1 Like

Everything works excellent, love the software and support. Keep up the good work!

1 Like