[Mne_analysis] Brainvision events

Phillip Alday phillip.alday at mpi.nl
Tue Sep 22 10:26:34 EDT 2020
Search archives:

mne.events_from_annotations returns a tuple of (events_array,
event_id_dict).


You need:


events, events_mapping = mne.events_from_annotations(raw, event_id='auto')



On 22/09/2020 16:20, Daniel Cabral wrote:
>
>         External Email - Use Caution        
>
> Hi,
> I have been struggling to find the events from my files. Here is what
> I've got so far:
> I am attaching a vhdr file with the markers
> import mne
>
> mne.set_log_level('WARNING')
> fname = "go.nogo.01.vhdr"
> raw = mne.io.read_raw_brainvision(fname, preload=True)
>
> montage =
> mne.channels.make_standard_montage('standard_1020')raw.set_montage(montage,
> raise_if_subset = False)
>
> ica = mne.preprocessing.ICA(n_components=15, random_state=97)
> ica.fit(raw.copy().filter(1,40))
> ica.plot_sources(raw);
> ica.plot_components()
>
> raw = ica.apply(raw.copy(), exclude = ica.exclude)
>
> raw.plot();
>
> events = mne.events_from_annotations(raw, event_id='auto')
> events;
> tmin, tmax = -0.2, 0.5
>
> events_nogo_sed = [88,89,90,91,92,93,94,95,96,97,98,99,100,
>                           101,102,103,104,105,106,107,108,109,110,
>                           111,112,113]
>
> epochs = mne.Epochs(raw, events, events_nogo_sed, tmin, tmax)
>
> TypeError: events should be a NumPy array of integers, got <class 'tuple'>
>
>
>
>
> *Daniel Cabral.*
>
> PhD student
> Graduate Teaching Assistant
> Performance and Exercise Psychophysiology lab
> School of Kinesiology
> Auburn University
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200922/6966fecf/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200922/6966fecf/attachment.bin 
-------------- next part --------------
        External Email - Use Caution        
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200922/6966fecf/attachment-0001.html 


More information about the Mne_analysis mailing list