# Reading user-defined events

**URL:** <https://mne.discourse.group/t/reading-user-defined-events/2394>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [December 7, 2020, 6:46pm UTC](https://mne.discourse.group/t/reading-user-defined-events/2394 "2020-12-07T18:46:14Z")\
**Posts on this page:** 4\
**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:** [December 7, 2020, 6:46pm UTC](https://mne.discourse.group/t/reading-user-defined-events/2394/1 "2020-12-07T18:46:14Z")

</div>

External Email - Use Caution

Hello group!

Basic Question:  
I have meg\_raw.fif files where I have manually marked events using the mne\_browse\_raw interface.  
Is there a way to read these ?user-defined? events in mne-python directly?

Thanks,  
Candida Ustine

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20201207/62fd6255/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20201207/62fd6255/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:** [December 7, 2020, 8:17pm UTC](https://mne.discourse.group/t/reading-user-defined-events/2394/2 "2020-12-07T20:17:38Z")

</div>

External Email - Use Caution

hi,

where did you store the events?

maybe look at mne.read\_events  
[https://secure-web.cisco.com/1H4xjY3kTZomrm236jNRsDOXU0IlIzI74SPolrlvipl7lOWO2QjhBwEldhcI6XgsStghPwAjnjqBGteTa4uzCMum4jOF\_H5wFqSi7Unbru9UKX3XQhRolUD1nplmO-sRWXC-ibk4q57WuQBRJLrkqzCF7beBoMzDL2iEziZ2hN49QCsAfLah4FzepKK33rGBdW4jSSgD\_bLZ6Uc6VfN75\_XMcHejz4kC0avhrJ01LMoXdiMQA4-V5uKJIn29DMFOItxhP5vcNUGJg-QzRj\_Noxg/https%3A%2F%2Fmne.tools%2Fstable%2Fgenerated%2Fmne.read\_events.html](https://secure-web.cisco.com/1H4xjY3kTZomrm236jNRsDOXU0IlIzI74SPolrlvipl7lOWO2QjhBwEldhcI6XgsStghPwAjnjqBGteTa4uzCMum4jOF_H5wFqSi7Unbru9UKX3XQhRolUD1nplmO-sRWXC-ibk4q57WuQBRJLrkqzCF7beBoMzDL2iEziZ2hN49QCsAfLah4FzepKK33rGBdW4jSSgD_bLZ6Uc6VfN75_XMcHejz4kC0avhrJ01LMoXdiMQA4-V5uKJIn29DMFOItxhP5vcNUGJg-QzRj_Noxg/https%3A%2F%2Fmne.tools%2Fstable%2Fgenerated%2Fmne.read_events.html)

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:** [December 8, 2020, 4:48pm UTC](https://mne.discourse.group/t/reading-user-defined-events/2394/3 "2020-12-08T16:48:44Z")

</div>

External Email - Use Caution

Hi Alex,

Thanks!! Sorry, I was not clear earlier!  
These are the sleep or epileptic spike events marked in the raw data and  
they are not written into the STIM channels... Honestly, I am not sure  
where in the data structure they are stored. Mne\_browse\_raw recognises  
these events as annotations when opening the raw file.

Until now, I have been opening the raw.fif file in mne\_browse\_raw and then  
using its save function to export the these user-defined events to a  
-eve.fif/txt file - which I then read using mne.read\_events() in python.

I wanted to know if there is a direct way to read these marked events  
directly from the raw.fif file in mne python - perhaps using the  
mne.find\_events function (I saw that it requires a STIM channel) Is there a  
workaround? Sorry if I am missing something!

Thanks!!  
[image: image.png]  
[image: image.png]

---

<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:** [December 8, 2020, 8:00pm UTC](https://mne.discourse.group/t/reading-user-defined-events/2394/4 "2020-12-08T20:00:20Z")

</div>

External Email - Use Caution

ok so if you managed to save a -eve.fif file you can use mne.read\_events

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