# Combining epochs from mutliple runs

**URL:** https://mne.discourse.group/t/combining-epochs-from-mutliple-runs/612
**Category:** Mailing List Archive (read-only)
**Tags:** list-archive
**Created:** [August 27, 2013, 9:09pm UTC](https://mne.discourse.group/t/combining-epochs-from-mutliple-runs/612 "2013-08-27T21:09:49Z")
**Posts on this page:** 6
**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: [August 27, 2013, 9:09pm UTC](https://mne.discourse.group/t/combining-epochs-from-mutliple-runs/612/1 "2013-08-27T21:09:49Z")

</div>

Hi All,  
Is there an easy way to combine epochs from multiple runs in mne-python?  
I looked around but could not find an easy way.  
Thank you,

Chiran Doshi, MS  
MEG system technologist  
Department of Neurology  
Boston Childrens Hospital  
Phone: 781-216-1136  
Fax: 781-216-1172

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20130827/84a64270/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20130827/84a64270/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: [August 27, 2013, 9:26pm UTC](https://mne.discourse.group/t/combining-epochs-from-mutliple-runs/612/2 "2013-08-27T21:26:29Z")

</div>

hi Chiran,

there is no such thing. The recommended way is to pass a list of raw  
files to Raw.  
Something like

raw = mne.fiff.Raw(['raw1.fif', 'raw2.fif'], ...)

then you can build Epochs from raw the usual way.

Hope this helps  
Alex

---

<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: [August 27, 2013, 9:28pm UTC](https://mne.discourse.group/t/combining-epochs-from-mutliple-runs/612/3 "2013-08-27T21:28:03Z")

</div>

Dear Chiran,

you might want to use raw.append:

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

and the create regular epochs from the resulting Raw object.

HTH,

Denis

---

<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: [August 27, 2013, 9:37pm UTC](https://mne.discourse.group/t/combining-epochs-from-mutliple-runs/612/4 "2013-08-27T21:37:09Z")

</div>

Hi Denis,

The problem is that I have all events in .eve files. How do you think I should combine them?

Does adding the length of appended raw file to the events sound like a good solution?

Chiran Doshi, MS  
MEG system technologist  
Department of Neurology  
Boston Childrens Hospital  
Phone: 781-216-1136  
Fax: 781-216-1172

---

<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: [August 27, 2013, 9:56pm UTC](https://mne.discourse.group/t/combining-epochs-from-mutliple-runs/612/5 "2013-08-27T21:56:11Z")

</div>

Consider using mne.concatenate\_events():

[http://martinos.org/mne/generated/mne.concatenate\_events.html#mne.concatenate\_events](http://martinos.org/mne/generated/mne.concatenate_events.html#mne.concatenate_events)

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: [August 27, 2013, 10:05pm UTC](https://mne.discourse.group/t/combining-epochs-from-mutliple-runs/612/6 "2013-08-27T22:05:25Z")

</div>

Alternatively, if your \*-eve.fif files aren't any special (in terms of  
events combined / pre-computed, that is, not readable from the trigger  
channels) you can always compute them on the fly:

raw = Raw(['my-raw1.fif', 'my-raw2.fif', 'my-raw3.fif'])  
mne.find\_events(raw)

Cheers,  
Denis
