# Assistance regarding montage

**URL:** <https://mne.discourse.group/t/assistance-regarding-montage/2195>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [May 21, 2020, 8:47pm UTC](https://mne.discourse.group/t/assistance-regarding-montage/2195 "2020-05-21T20:47:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 21, 2020, 8:47pm UTC](https://mne.discourse.group/t/assistance-regarding-montage/2195/1 "2020-05-21T20:47:57Z")

</div>

External Email - Use Caution

Hello,

I'm not sure whether this is the appropriate forum, but I think some of my  
MNE questions are a bit too specialized for stackoverflow.

I have an EEG file I've read in and I wish to create and plot a montage,  
whose coordinates I've created manually. Everything works fine until the  
last line, where I try to plot the montage, and I'm not sure of the source  
of my problem:

import mne as mn  
#channel coordinates expressed as list of points in R^3 with z=0.  
channel\_coords=[(-.25,.7,0),(.25,.7,0),(-.27,.35,0),(.27,.35,0),(-.32,0,0),(.32,0,0),(-.3,-.35,0),(.3,-.35,0),(-.22,-.7,0),(.22,-.7,0),

(-.6,.43,0),(.6,.43,0),(-.73,0,0),(.73,0,0),(-.6,-.43,0),(.6,-.43,0),

(0,.32,0),(0,0,0),(0,-.32,0),(-.9,0,0),(.9,0,0),(-.5,0,0),(.5,0,0)]  
directory='/Users/fishbacp/Jupyter December 2019/Phase 1 EEG Data/11.edf'  
raw = mn.io.read\_raw\_edf(directory, preload=True)  
channels=raw.info["ch\_names"]  
#I know which particular channels I wish to drop.  
bad\_channels=['E', 'LIO', 'RIO', 'X1', 'X2', 'X3', 'X4', 'X5', 'X6', 'X7',  
'X8', 'X9', 'X10', 'X11', 'O2%', 'HR', 'DC03', 'DC04', 'EEG Mark1', 'EEG  
Mark2', 'BP1', 'BP2','Events/Markers']  
raw\_temp=raw.copy()  
raw\_temp.drop\_channels(bad\_channels)  
channels=raw\_temp.info["ch\_names"]  
print(len(channels))  
print(len(channel\_coords))  
ch={channels[i]:channel\_coords[i] for i in range(len(channels))}  
montage=mn.channels.make\_dig\_montage(ch)  
mn.viz.plot\_montage(montage)

The last line of my error message reads AttributeError: 'tuple' object has  
no attribute 'copy'

Thanks for any help spotting my error.

Paul F.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 21, 2020, 9:30pm UTC](https://mne.discourse.group/t/assistance-regarding-montage/2195/2 "2020-05-21T21:30:23Z")

</div>

External Email - Use Caution

Hi Paul,  
Try adding:

import numpy as np  
channel\_coords = [np.array(x) for x in channel\_coords]

This makes each entry in your channel coords list into a numpy array instead of a tuple. That format is specified in the docstring make\_dig\_montage function, but apparently doesn't raise an error until you try to plot it.

-- dan  
Daniel McCloy  
[https://dan.mccloy.info](https://dan.mccloy.info)  
Research Scientist  
Institute for Learning and Brain Sciences  
University of Washington

??? Original Message ???

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 22, 2020, 12:11pm UTC](https://mne.discourse.group/t/assistance-regarding-montage/2195/3 "2020-05-22T12:11:49Z")

</div>

External Email - Use Caution

Thanks so much Dan--this was very helpful!
