[Mne_analysis] Some question about Epochsobjects in mne-python

Denis-Alexander Engemann denis.engemann at gmail.com
Sun Dec 22 08:13:37 EST 2013
Search archives:

Dear Steven,

# epochs IO

for reading epochs use mne.read_epochs


# filtering epochs

this is not supported by the API because you should know what  you do,
when you do it.
If you want to do it the way to do it is to access the epochs data (in
preload mode).

data = epochs.get_date()
n_epochs, n_channels, n_samples = data.shape
data = data.reshape(n_channels, n_epochs * n_samples)
# for example
mne.filter.low_pass_filter(data, 1, 45, copy=False)
epochs._data = data.reshape(n_epochs, n_channels, n_samples)

But this will only be valid if your data are sufficiently highpass
filtered (otherwise artifacts due to epochsing).


is there a certain reason why you prefer to do ICA before filtering?
In my experience ICA will yield better results on filtered data
(removes e.g high-frequency noise and drifts).
Also you can speed up estimation time by not passing each sample using
the decim parameter having filtered the data. For separating signals
between 1 and 45 Hz you don't need 500 samples per second, which of
course depends on the total number of samples.
I often do the decim trick when working with raw data (it internally
decimates a copy of your data which is passed to ICA, not your
original data).

also see:

the line with `ica.decompose_raw`

I hope this helps,

On Sun, Dec 22, 2013 at 1:30 PM, Stephen Politzer-Ahles <spa268 at nyu.edu> wrote:
> Hello,
> I have some epoched data that I created in python (using mne.Epochs) and
> then saved as a .fif file using the save() method of mne.Epochs. After
> saving it, I did some other processing, and now I'd like to load them again.
> But I'm actually not sure how to load these objects? mne.fiff.read_evoked
> doesn't seem to do it (I get an error 'Could not find evoked data'; the full
> traceback is below).
> Also, is it possible to filter an mne.Epochs object? I didn't filter my raw
> data because I wanted to do ICA on the epochs. But now, as far as I can tell
> there is not a built-in filter() method for Epochs like there is for Raw,
> and mne.filter.low_pass_filter() seems to be a low-level function so I'm not
> sure if I should be calling it directly or not.
> (My epochs are much larger than the time window I'm actually interested in,
> so I think it should be ok to filter; but if that's still not recommended,
> then another solution I could try is to run ICA on the epochs, apply those
> ICA weights back onto the raw data, filter the raw data, and then epoch
> again.)
> Thanks,
> Steve
> Stephen Politzer-Ahles
> New York University, Abu Dhabi
> Neuroscience of Language Lab
> http://www.nyu.edu/projects/politzer-ahles/
> _______________________________________________
> 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