# read\_custom\_montage neuroscan compumedics file

**URL:** <https://mne.discourse.group/t/read-custom-montage-neuroscan-compumedics-file/5179>\
**Category:** Support & Discussions\
**Tags:** montage, data-import\
**Created:** [June 30, 2022, 1:05am UTC](https://mne.discourse.group/t/read-custom-montage-neuroscan-compumedics-file/5179 "2022-06-30T01:05:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![louisestolz](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/louisestolz/32/1659_2.png) [@louisestolz](https://mne.discourse.group/u/louisestolz)\
**Post date:** [June 30, 2022, 1:05am UTC](https://mne.discourse.group/t/read-custom-montage-neuroscan-compumedics-file/5179/1 "2022-06-30T01:05:28Z")

</div>

Hello,

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\montage.py:1399, 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\channels\_standard\_montage\_utils.py:392, 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:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/8/85cf21837b1d051f453071bc7b15c482b5895f38.png)

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!

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [June 30, 2022, 6:36am UTC](https://mne.discourse.group/t/read-custom-montage-neuroscan-compumedics-file/5179/2 "2022-06-30T06:36:35Z")

</div>

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!

Richard

---

<div class="post-metadata">

**Author:** ![louisestolz](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/louisestolz/32/1659_2.png) [@louisestolz](https://mne.discourse.group/u/louisestolz)\
**Post date:** [July 1, 2022, 1:09pm UTC](https://mne.discourse.group/t/read-custom-montage-neuroscan-compumedics-file/5179/3 "2022-07-01T13:09:54Z")

</div>

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.

Louise

```python
|Label|x (mm)|y (mm)|z (mm)|
|---|---|---|---|
|Fp1|-29|104.536|33.1255|
|Fpz|1|109.203|38.6223|
|Fp2|30|104.651|34.1187|
|AF3|-34|101.932|62.625|
|AF4|36|101.054|63.734|
|F11|-74|46.771|-30.6181|
|F7|-70|61.8921|30.0395|
|F5|-66|68.4593|60.4841|
|F3|-52|76.7816|88.7107|
|F1|-28|84.0625|107.998|
|Fz|2|88.7299|113.494|
|F2|31|84.8243|105.895|
|F4|53|78.6525|87.4859|
|F6|66|69.684|62.3549|
|F8|70|61.2459|33.1351|
|F12|74|44.4855|-24.3113|
|FT11|-80|18.5638|-39.413|
|FC5|-77|39.5866|71.902|
|FC3|-62|47.61|106.204|
|FC1|-34|54.3605|129.58|
|FCz|3|57.2728|137.295|
|FC2|37|54.129|127.593|
|FC4|63|48.3719|104.102|
|FC6|77|40.6956|72.7796|
|FT12|79|16.394|-32.1129|
|T7|-84|3.51988|38.8537|
|C5|-83|8.38021|80.5715|
|C3|-69|14.7642|118.085|
|C1|-37|18.882|144.788|
|Cz|3|22.0258|154.489|
|C2|40|19.6438|142.685|
|C4|69|15.7575|117.969|
|C6|83|9.48921|81.4491|
|T8|84|3.98277|42.8268|
|TP7|-82|-26.0471|44.3119|
|CP5|-81|-25.3914|84.5061|
|CP3|-67|-22.9805|122.482|
|CP1|-36|-20.8493|149.417|
|CPz|3|-17.8212|158.125|
|CP2|40|-18.1009|147.083|
|CP4|67|-19.0074|122.019|
|CP6|80|-21.1868|86.0298|
|TP8|82|-24.591|48.1693|
|M1|-76|-41.2549|8.83346|
|M2|77|-38.4583|15.555|
|P7|-73|-54.5051|50.6477|
|P5|-68|-55.6527|84.0046|
|P3|-56|-55.1609|114.15|
|P1|-30|-54.7173|135.241|
|Pz|2|-52.9139|142.078|
|P2|32|-52.7307|135.009|
|P4|56|-53.1743|113.919|
|P6|68|-52.5571|84.6507|
|P8|72|-52.1714|53.3961|
|PO7|-54|-77.6496|59.3847|
|PO3|-37|-79.559|94.8439|
|POz|2|-78.7007|110.852|
|PO4|37|-78.6814|93.7349|
|PO8|55|-75.5473|60.1466|
|O1|-29|-91.8544|67.0803|
|Oz|1|-94.0242|74.3804|
|O2|30|-90.7454|67.9578|
|Cb1|-28|-92.8091|32.9615|
|Cb2|31|-90.7069|33.7234|

```

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [July 1, 2022, 1:57pm UTC](https://mne.discourse.group/t/read-custom-montage-neuroscan-compumedics-file/5179/4 "2022-07-01T13:57:18Z")

</div>

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