[Mne_analysis] Annotations for Events

Bianca Islas biancaisla1 at gmail.com
Sat Jan 4 18:24:01 EST 2020
Search archives:

        External Email - Use Caution        

Yes, entirely different.  I first define an event_dict.  My reading in the .cnt file is verbatim:

`raw = mne.io.read_raw_cnt(input_fname=raw_fname, eog=('VEO', 'HEO',), misc=('SCR', 'SCL',), ecg=('HR',), 
                          emg=('PA-L-SCAL', 'PA-L-EAR', 'PA-R-SCAL', 'PA-R-EAR', 'ORB-NOSE', 'ORB-EAR', 'COR-NOSE', 'COR-EAR', 'ZYG-MOUTH', 'ZYG-EAR',), 
                          data_format='int32', date_format='dd/mm/yy', preload=True)
events = mne.events_from_annotations(raw_corrected, event_id=event_dict)
print(events, raw_corrected) #corrected raw data after ICA`

Implementing `event_id=int` into `events_from_annotations`, as in your code, was the difference.  This is not in the documentation for this function. So I’m glad we were able to cover it here.  Thank you for your time and patience in clearing this up!

Bianca Islas

From: Alexandre Gramfort
Sent: Saturday, January 4, 2020 8:50 AM
To: Bianca Islas
Cc: mne_analysis at nmr.mgh.harvard.edu
Subject: Re: Annotations for Events

hi,

I tried

import mne

raw = mne.io.read_raw_cnt('st003_PAMR_s1079_20080319.cnt')
events, event_id = mne.events_from_annotations(raw, event_id=int)
print(events)
print(event_id)

and it worked fine.

are you doing anything differently?

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200104/1666e06f/attachment.html 


More information about the Mne_analysis mailing list