[Mne_analysis] Mne_analysis Digest, Vol 55, Issue 16

Alexandre Gramfort gramfort at nmr.mgh.harvard.edu
Sat Aug 25 03:52:26 EDT 2012
Search archives:

hi Kambiz,

what you're doing is correct.

filtering param are not independent from rejection values but what you
describe is
weird.

I would plot an epoch after filtering so see what might happen.

>>> data = epochs.get_data()
>>> import pylab as pl
>>> pl.plot(epochs.times, data[0].T)

you might want to share the fif file and the script via dropbox.

Alex

On Sat, Aug 25, 2012 at 12:02 AM, Kambiz Tavabi <ktavabi at uw.edu> wrote:
> Greetings,
> I am trying to filter raw data before extracting epochs and computing
> contrasts.
> I am using:
>      raw = fiff.Raw(f, preload=True) #Setup for reading the raw data
>      events = mne.find_events(raw, stim_channel='STI101')
> Up to this point I get 7 events, which is correct.
>
>      raw.filter(None, 40.0, picks=None, filter_length=4096,
> h_trans_bandwidth=0.5, verbose=5, n_jobs=8) # filter raw
> This command works without error.
>
>      tmin, tmax = -0.1, 0.5
>      reject = dict(grad=3000e-13)
>      epochs = mne.Epochs(raw, events, 1, tmin, tmax, baseline=(None, 0),
> reject=reject) #extract epochs
> I get an output with ~300 epochs, also correct.
>
>      evoked = epochs.average()  # average epochs and get an Evoked dataset.
> If I don't include the mne.filter command I get an unfiltered evoked
> dataset which I can visualize with plot_evoked(evoked).
> If I include the mne.filter command I get the following error during
> averaging:
> /usr/local/mne-python/mne/epochs.py:424: RuntimeWarning: invalid value
> encountered in divide data /= n_events. And no evoked dataset.
> Assuming this procedure is incorrect, how else can I filter raw data on
> the fly (i.e., without saving), and average epochs?
>
> Thanks in advance
> Kambiz
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> 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
> 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.
>



More information about the Mne_analysis mailing list