[Eeglablist] insert events after some markers in EEG data

Raquel London raquel at dragondelapatagonia.com
Wed Oct 5 03:00:07 PDT 2016


Hi Elisa,

I'm not an expert, but let me try to help you. It is a bit difficult to
know how to adapt this script to your data without knowing what your data
looks like.
Maybe you have already done so, but I think to make scripting easier it is
important to acquaint yourself with the EEG structure. Just look around all
the variables (especially in EEG.event for this case particularly) to see
how they are all related to each other and what kind of information is in
them (string, double, etc).

What you want this script to do is find all the events labeled '13', find
their latency and then use those latencies to calculate the latencies for
your added events, right? In the example script, the event label is a
string, so it uses strcmp which compares the given string ('A') to the
strings in EEG.event.type. If your event is not a string, then you
shouldn't use strcmp, but just work with the number 13.

I hope this at least in part helps you towards a solution.

cheers,
Raquel

--
Dragón de la Patagonia
Ramon Barros Luco 688
Puerto Natales - Patagonia - Chile
Oficina: +56-9-94022038
Skype: raquel.london


On Sun, Oct 2, 2016 at 2:32 PM, Elisa Tatti <elisatatti at msn.com> wrote:

> Dear EEGLAB users,
>
> We have  EEG recordings with several markers and I would like to add an
> event coded "33" 2.5 seconds after the onset of all the events "13".
> In the EEGLABlist I read about a script to add events on the base of an
> already existent one but it doesn't work on my data (A_latencies is
> empty).  I suppose that this is because my events are coded as numbers and
> the examples provided here were with "characters" (see below):
>
> %Get the latencies (data point indices) for all 'A' type events...
> A_latencies=[EEG.event(find(strcmp('A',{EEG.event.type}))).latency];
>
> %for each A_latencies add a new event type '1' with a latency of (A_latencies(i)+1.5*EEG.srate)-1...
> for i=1:length(A_latencies);
>     n_events=length(EEG.event);
>     EEG.event(n_events+1).type='1';
>     EEG.event(n_events+1).latency=(A_latencies(i)+1.5*EEG.srate)-1;
>     EEG.event(n_events+1).urevent=n_events+1;
> end
>
> %check for consistency and reorder the events chronologically...
> EEG=eeg_checkset(EEG,'eventconsistency');
>
>
>
> I am starting learning matlab now, so I don't know how to adapt this
> script to my data. Can someone help me?!
>
> Thank you for your consideration.
>
>
> Elisa
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.
> ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20161005/545b06cc/attachment.html>


More information about the eeglablist mailing list