[Mne_analysis] EOG Artifact markers

Martin Luessi mluessi at nmr.mgh.harvard.edu
Tue Nov 27 21:22:06 EST 2012
Search archives:

Hi Vincent,

You can save the events using mne.write_events and later load them again 
using mne.read_events

The error your are getting is strange, I can't see anything wrong, as 
all you changed is the file name. What matplotlib (pylab) version are 
you using?

Best,

Martin

On 11/27/12 19:57, Vincent wrote:
> Hello,
>
> I am using theEOG artifact example script
> <http://martinos.org/mne/auto_examples/preprocessing/plot_find_eog_artifacts.html> but
> having a little trouble with the output. First, am I right in assuming
> that the "mne.artifacts.find_eog_events(raw, event_id)" section adds
> markers to the input fif file? If not, what is the best way to save
> them? Second, I've modified only the part of the script that specifies
> the input file, yet the script finishes with errors:
>
> Traceback (most recent call last):
>    File "plot_find_eog_artifacts.py", line 39, in <module>
>      pl.plot(1e3 * epochs.times, np.squeeze(data).T)
>    File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 2467,
> in plot
>      ret = ax.plot(*args, **kwargs)
>    File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 3893, in
> plot
>      for line in self._get_lines(*args, **kwargs):
>    File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 322, in
> _grab_next_args
>      for seg in self._plot_args(remaining, kwargs):
>    File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 300, in
> _plot_args
>      x, y = self._xy_from_xy(x, y)
>    File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 242, in
> _xy_from_xy
>      raise ValueError("x and y can be no greater than 2-D")
> ValueError: x and y can be
>
> The actual locating of the EOG artifacts seems to process okay (it finds
> 28 artifacts in this case and the output to screen looks like that in
> the example on the website), instead it's just the plotting with
> matplotlib at the end that fails. Any ideas why?
>
>
> About the section of the script I modified. I didn't do too much, just
> changed anything that specified the input file. I changed from this:
>
> importnumpyasnp
> importpylabaspl
> importmne
> frommneimportfiff
> frommne.datasetsimportsample
> data_path=sample.data_path('..')
>
> ###############################################################################
> # Set parameters
> raw_fname  =  data_path  +  '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
>
> to look like this:
>
> import numpy as np
> import pylab as pl
> import mne
> from mne import fiff
>
> ###############################################################################
> # Set parameters
> raw_fname = '/home/vrupp/Desktop/YA/restMEG/YA001/YA001_rest_raw_sss.fif'
>
> but otherwise I have left it as is.
>
> Thank you in advance for any help offered.
>
> ::vincent
>
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>


-- 
Martin Luessi, Ph.D.

Research Fellow

Department of Radiology
Athinoula A. Martinos Center for Biomedical Imaging
Massachusetts General Hospital
Harvard Medical School
149 13th Street
Charlestown, MA 02129

Fax: +1 617 726-7422



More information about the Mne_analysis mailing list