[Mne_analysis] Concatenating Epochs objects in Python?

Martin Luessi mluessi at nmr.mgh.harvard.edu
Thu Apr 3 10:12:06 EDT 2014
Search archives:

Hi Steve,

Yes, you are right, concatenating Epochs is currently not supported.
Unless you use "preload=True", it won't actually load the data of the
raw file when creating a Raw object. So you should be able to just use a
list of file names when creating Raw and it should work.

The only time you need "preload=True" is when you want to modify the raw
data, e.g., using filtering. In this case, you could load each raw file,
filter it, save it, and then create a new Raw instance that combines all
the files. Like that, you will only need enough RAM to have a single raw
file fully loaded.

HTH,

Martin

On 04/03/14 09:42, Stephen Politzer-Ahles wrote:
> Hi,
> 
> Is it possible to concatenate multiple Epochs objects in Python? For
> example, if I load one raw fif file and create an object (let's call it
> epochs1) with three epochs A, B, and C, and then I load another raw fif
> file and create epochs2 with three epochs D, E, and F, what I would like
> to do is combine them into a single object with six epochs A, B, C, D, E, F.
> 
> I can't find a method for this in the reference and all I see online is
> this github discussion
> https://github.com/mne-tools/mne-python/issues/120 where it seems like
> this was ultimately not done. Loading multiple raw fif files is not a
> good option for me because my files are very large and I don't have the
> memory to handle it. I suppose another thing I could do is load one raw
> fif file at a time and save its epochs to a new fif file, and then load
> the separate epoched .fif files together (if mne.read_epochs allows
> this) but I am hoping to avoid saving a bunch of files, I'd rather just
> create and concatenate the epochs on the fly if that is possible.
> 
> Thank you,
> 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
> 


-- 
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