[Mne_analysis] Assistance regarding montage

Paul Fishback fishbacp at mail.gvsu.edu
Fri May 22 08:11:49 EDT 2020
Search archives:

        External Email - Use Caution        

Thanks so much Dan--this was very helpful!

On Thu, May 21, 2020 at 5:30 PM Dan McCloy <dan at mccloy.info> wrote:

>         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
> Research Scientist
> Institute for Learning and Brain Sciences
> University of Washington
>
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Thursday, May 21, 2020 1:47 PM, Paul Fishback <fishbacp at mail.gvsu.edu>
> wrote:
>
> *        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.
> --
> Professor of Mathematics, Grand Valley State University
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis



-- 
Professor of Mathematics, Grand Valley State University
President, Pi Mu Epsilon National Honorary Mathematics Society, Inc.

Department of Mathematics (MAK C-2-408)
Grand Valley State University
1 Campus Dr.
Allendale, MI 49401
fishbacp at mail.gvsu.edu
616.331.2040
616.331.3120 (fax)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200522/afb22f5d/attachment.html 


More information about the Mne_analysis mailing list