# error filtering biosemi imported file

**URL:** <https://mne.discourse.group/t/error-filtering-biosemi-imported-file/655>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [January 14, 2014, 10:12pm UTC](https://mne.discourse.group/t/error-filtering-biosemi-imported-file/655 "2014-01-14T22:12:47Z")\
**Posts on this page:** 5\
**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:** [January 14, 2014, 10:12pm UTC](https://mne.discourse.group/t/error-filtering-biosemi-imported-file/655/1 "2014-01-14T22:12:47Z")

</div>

Hi everybody,  
I'm working with some biosemi EEG files

the following code:

raw = read\_raw\_edf('bdf\_file.bdf', hpts = 'hpts\_file.hpts')  
fraw = filter.band\_pass\_filter(raw, 1024, 30, 1)

gives me the error:

Traceback (most recent call last):  
&nbsp;&nbsp;File  
"C:\Users\Mauricio\Documents\Dropbox\PhD\scripts\mne-python\preprocessing.py",  
line 9, in \<module\>  
&nbsp;&nbsp;&nbsp;&nbsp;fraw = filter.band\_pass\_filter(raw, 1024, 30, 1)  
&nbsp;&nbsp;File "\<string\>", line 2, in band\_pass\_filter  
&nbsp;&nbsp;File "C:\Python33\lib\site-packages\mne-0.8.git-py3.3.egg\mne\utils.py",  
line 387, in verbose  
&nbsp;&nbsp;&nbsp;&nbsp;ret = function(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "C:\Python33\lib\site-packages\mne-0.8.git-py3.3.egg\mne\filter.py",  
line 624, in band\_pass\_filter  
&nbsp;&nbsp;&nbsp;&nbsp;xf = \_filter(x, Fs, freq, gain, filter\_length, picks, n\_jobs, copy)  
&nbsp;&nbsp;File "C:\Python33\lib\site-packages\mne-0.8.git-py3.3.egg\mne\filter.py",  
line 276, in \_filter  
&nbsp;&nbsp;&nbsp;&nbsp;x, orig\_shape, picks = \_prep\_for\_filtering(x, copy, picks)  
&nbsp;&nbsp;File "C:\Python33\lib\site-packages\mne-0.8.git-py3.3.egg\mne\filter.py",  
line 226, in \_prep\_for\_filtering  
&nbsp;&nbsp;&nbsp;&nbsp;orig\_shape = x.shape  
AttributeError: 'RawEDF' object has no attribute 'shape'

Could somebody tell me what I'm doing wrong?  
What is the right pipeline importing and filtering .bdf files?

All the best,  
Mauricio.  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20140114/b4e9b684/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140114/b4e9b684/attachment.html)

---

<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:** [January 14, 2014, 10:22pm UTC](https://mne.discourse.group/t/error-filtering-biosemi-imported-file/655/2 "2014-01-14T22:22:16Z")

</div>

Hey Mauricio,

You should be able to do "raw.filter(...) " directly on the Raw instance  
(as a method of Raw). Does that make sense?

[http://martinos.org/mne/stable/generated/mne.fiff.Raw.html#mne.fiff.Raw.filter](http://martinos.org/mne/stable/generated/mne.fiff.Raw.html#mne.fiff.Raw.filter)

Eric

---

<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:** [January 14, 2014, 10:56pm UTC](https://mne.discourse.group/t/error-filtering-biosemi-imported-file/655/3 "2014-01-14T22:56:21Z")

</div>

Thanks Eric,  
do I have to type something like this?

raw = read\_raw\_edf('bdf\_file.bdf', hpts = 'hpts\_file.hpts')  
raw.filter(30, 1)

in that case, I have to use  
raw = read\_raw\_edf('bdf\_file.bdf', hpts = 'hpts\_file.hpts', preload =  
'True')

Isn't it? But it's strange because when I read the bdf with preload =  
'True' I don't know if the program crushes or it will take a lot of time  
(I'm loading a 128 channels 50 min EEG on a PC with 8 GB RAM and two 3.4  
GHz processors... it takes to EEGLab just 3 min). I waited for 1 hr and the  
bdf didn't load.

All the best,  
Mauricio.

2014/1/14 Eric Larson \<larson.eric.d at gmail.com\>

> Hey Mauricio,
> 
> You should be able to do "raw.filter(...) " directly on the Raw instance  
> (as a method of Raw). Does that make sense?
> 
> [http://martinos.org/mne/stable/generated/mne.fiff.Raw.html#mne.fiff.Raw.filter](http://martinos.org/mne/stable/generated/mne.fiff.Raw.html#mne.fiff.Raw.filter)
> 
> Eric
> 
> > Hi everybody,  
> > I'm working with some biosemi EEG files
> > 
> > the following code:
> > 
> > raw = read\_raw\_edf('bdf\_file.bdf', hpts = 'hpts\_file.hpts')  
> > fraw = filter.band\_pass\_filter(raw, 1024, 30, 1)
> > 
> > gives me the error:
> > 
> > Traceback (most recent call last):  
> > &nbsp;&nbsp;File  
> > "C:\Users\Mauricio\Documents\Dropbox\PhD\scripts\mne-python\preprocessing.py",  
> > line 9, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;fraw = filter.band\_pass\_filter(raw, 1024, 30, 1)  
> > &nbsp;&nbsp;File "\<string\>", line 2, in band\_pass\_filter  
> > &nbsp;&nbsp;File  
> > "C:\Python33\lib\site-packages\mne-0.8.git-py3.3.egg\mne\utils.py", line  
> > 387, in verbose  
> > &nbsp;&nbsp;&nbsp;&nbsp;ret = function(\*args, \*\*kwargs)  
> > &nbsp;&nbsp;File  
> > "C:\Python33\lib\site-packages\mne-0.8.git-py3.3.egg\mne\filter.py", line  
> > 624, in band\_pass\_filter  
> > &nbsp;&nbsp;&nbsp;&nbsp;xf = \_filter(x, Fs, freq, gain, filter\_length, picks, n\_jobs, copy)  
> > &nbsp;&nbsp;File  
> > "C:\Python33\lib\site-packages\mne-0.8.git-py3.3.egg\mne\filter.py", line  
> > 276, in \_filter  
> > &nbsp;&nbsp;&nbsp;&nbsp;x, orig\_shape, picks = \_prep\_for\_filtering(x, copy, picks)  
> > &nbsp;&nbsp;File  
> > "C:\Python33\lib\site-packages\mne-0.8.git-py3.3.egg\mne\filter.py", line  
> > 226, in \_prep\_for\_filtering  
> > &nbsp;&nbsp;&nbsp;&nbsp;orig\_shape = x.shape  
> > AttributeError: 'RawEDF' object has no attribute 'shape'
> > 
> > Could somebody tell me what I'm doing wrong?  
> > What is the right pipeline importing and filtering .bdf files?
> > 
> > All the best,  
> > Mauricio.
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Mne\_analysis mailing list  
> > Mne\_analysis at nmr.mgh.harvard.edu  
> > [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)
> > 
> > The information in this e-mail is intended only for the person to whom it  
> > is  
> > addressed. If you believe this e-mail was sent to you in error and the  
> > e-mail  
> > contains patient information, please contact the Partners Compliance  
> > HelpLine at  
> > [MyComplianceReport.com: Compliance and Ethics Reporting](http://www.partners.org/complianceline) . If the e-mail was sent to you  
> > in error  
> > but does not contain patient information, please contact the sender and  
> > properly  
> > dispose of the e-mail.

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20140114/9e00e587/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140114/9e00e587/attachment.html)

---

<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:** [January 14, 2014, 11:00pm UTC](https://mne.discourse.group/t/error-filtering-biosemi-imported-file/655/4 "2014-01-14T23:00:43Z")

</div>

Hey Mauricio,

This sounds like it might be an issue with our preloading routines. If you  
can upload a sample EDF file and start an issue on Github with a minimum  
example (it looks like those lines would be it) of the problem, we can work  
out a solution:

[https://github.com/mne-tools/mne-python/issues?state=open](https://github.com/mne-tools/mne-python/issues?state=open)

Thanks,  
Eric

---

<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:** [January 15, 2014, 8:19am UTC](https://mne.discourse.group/t/error-filtering-biosemi-imported-file/655/5 "2014-01-15T08:19:35Z")

</div>

hi,

yes please share the file.

Just to make sure did you type:

raw = read\_raw\_edf('bdf\_file.bdf', hpts = 'hpts\_file.hpts', preload = 'True')

or

raw = read\_raw\_edf('bdf\_file.bdf', hpts = 'hpts\_file.hpts', preload = True)

?

ie. without the '' around the True.

the later is the good way.

Alex
