read_custom_montage neuroscan compumedics file


I am trying to get MNE to read my montage from a compumedics neuroscan EEG system, but it cannot seem to identify the channel locations from my file. I have Windows 11 and am using Curry 9 to record EEG data. My “chanlocs” file is a .csv with ‘label’ for channels, x,y,z coordinates and other measures.

Here is my code:
fname = ‘chanlocs’
path_chan = r’C:\Users.…\chanlocs.csv’
montage = mne.channels.read_custom_montage(path_chan)

And the error:
ValueError Traceback (most recent call last)
Input In [58], in <cell line: 4>()
1 fname = ‘chanlocs’
2 path_chan = r’C:\Users\Louise\Desktop\eeg data\n-back\chanlocs.csv’
----> 4 montage = mne.channels.read_custom_montage(path_chan)

File ~\Anaconda3\envs\mne\lib\site-packages\mne\channels\, in read_custom_montage(fname, head_size, coord_frame)
1396 montage = _read_brainvision(fname, head_size)
1398 elif ext in SUPPORTED_FILE_EXT[‘xyz’]:
→ 1399 montage = _read_xyz(fname)
1401 if coord_frame is not None:
1402 coord_frame = _coord_frame_const(coord_frame)

File ~\Anaconda3\envs\mne\lib\site-packages\mne\, in _read_xyz(fname)
390 ch_names.append(ch_name)
391 pos.append((x, y, z))
→ 392 d = _check_dupes_odict(ch_names, np.array(pos, dtype=float))
393 return make_dig_montage(ch_pos=d)

ValueError: could not convert string to float: ‘’

Here is a snapshot of what the csv file looks like:

I have edited the csv file to have x,y,z in the first columns and channel labels in the last. Same error occurs. Any help is greatly appreciated!

Hello @louisestolz and welcome to the forum!

Could you please share the original CSV file here? Open it in a text editor (not in a spreadsheet program), paste the contents here, select what you’ve pasted, and click on the Preformatted text button in the toolbar. Thanks!


Hi Richard,

Thank you for your response! I actually resolved the issue since the code was correct, but I had an outdated file from Compumedics - attached is the updated QuickCap64 montage for future reference.


|Label|x (mm)|y (mm)|z (mm)|

Thanks for sharing! So the file contains literally those | characters??? You sure this wasn’t edited by hand by someone?