[Mne_analysis] Filtering in MNE python

Jon Houck jhouck at unm.edu
Fri Feb 3 17:44:59 EST 2012
Search archives:

Hi all,

I've been trying to filter raw data in MNE python and am getting the error
message: AttributeError: 'Raw' object has no attribute 'ndim'.  The
tutorial exercises have run perfectly  for me, using both the sample data
and my own data, so the most likely cause is user error.  The commands in
ipython are:

import numpy as np
from mne import fiff
from mne import filter
data_path =
'/usr/lib/python2.6/site-packages/mne-0.2.git-py2.6.egg/mne/datasets/sample/MNE-sample-data'
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = fiff.Raw(raw_fname)
raw = filter.band_pass_filter(raw, 1000, 50, 1, filter_length=2048)

What's the correct way to do this?  From the error, I'd guess that I'm
either passing the wrong part the array to the filter, or skipping some
important step.  I'm using mne-tools-mne-python-v0.2-70-g9a72ede in python
2.6, on a machine running 64-bit CentOS 6.  The complete error message is
below.

Thanks for any suggestions,

Jon Houck


/usr/lib/python2.6/site-packages/mne-0.2.git-py2.6.egg/mne/filter.pyc in
band_pass_filter(x, Fs, Fp1, Fp2, filter_length)
    252
    253     xf = _filter(x, Fs, [0, Fs1, Fp1, Fp2, Fs2, Fs / 2], [0, 0, 1,
1, 0, 0],
--> 254                  filter_length)
    255
    256     return xf

/usr/lib/python2.6/site-packages/mne-0.2.git-py2.6.egg/mne/filter.pyc in
_filter(x, Fs, freq, gain, filter_length)
    162         x filtered
    163     """
--> 164     assert x.ndim == 1
    165
    166     # normalize frequencies


AttributeError: 'Raw' object has no attribute 'ndim'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20120203/d332e3cc/attachment.html 


More information about the Mne_analysis mailing list