<div dir="ltr">Dear Jodie,<div><br></div><div>I suggest you file your request for EEGLAB developpers.</div><div><a href="https://sccn.ucsd.edu/bugzilla/">https://sccn.ucsd.edu/bugzilla/</a><br></div><div><br></div><div>That being said, here are my tricks to efficiently deal with EEGLAB events. Just for your information.</div><div><br></div><div>Makoto</div><div><br></div>% rename events<br>    allEvent = cell2mat({EEG.event.type}');<br>    idx2049 = find(allEvent==2049);<br>    [EEG.event(idx2049).type] = deal(8049);<br><br>% replace latency<br>   dummyA = num2cell(EEGsuggestedLatencyForFixationOnsets);<br>   [EEG.event(Idx).latency] = dummyA{:};<div><br></div><div><span style="font-size:12.8000001907349px">% adding 400ms to the event latencies</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">    allEvent = {EEG.event.type}';</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">    % unique(allEvent)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">    stroopOnsetIdx  = find(strcmp(allEvent, 'S 71')|strcmp(allEvent, 'S 72')|strcmp(allEvent, 'S     73')|strcmp(allEvent, 'S 74'));</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">    stroopOnsetLatencyInFrame  = [EEG.event(stroopOnsetIdx).</span><span style="font-size:12.8000001907349px">latency]';</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">    modifiedValues = bsxfun(@plus, stroopOnsetLatencyInFrame, 400);</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">    [EEG.event(stroopOnsetIdx).</span><span style="font-size:12.8000001907349px">latency] = modifiedValues{:};</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><div style="font-size:12.8000001907349px"> % extract event labels and time stamps</div><div style="font-size:12.8000001907349px">    allEventLabels = mobilab.allStreams.item{eventStreanIdx}.event.label;</div><div style="font-size:12.8000001907349px">    eventTimeStamp = mobilab.allStreams.item{eventStreanIdx}.timeStamp; % in second</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"> % import event markers and latency to EEG.event</div><div style="font-size:12.8000001907349px">    allEventLatency = num2cell((eventTimeStamp-EEG.urxmin)*1000);</div><div style="font-size:12.8000001907349px">    allUrevent      = num2cell(1:length(allEventLatency));</div><div style="font-size:12.8000001907349px">    EEG.event = struct('type', {}, 'latency',{}, 'urevent',{});</div><div style="font-size:12.8000001907349px">    [EEG.event(1,1:length(allEventLabels)).latency] = allEventLatency{:};</div><div style="font-size:12.8000001907349px">    [EEG.event(1,1:length(allEventLabels)).type]    = allEventLabels{:};</div><div style="font-size:12.8000001907349px">    [EEG.event(1,1:length(allEventLabels)).urevent] = allUrevent{:};</div><div style="font-size:12.8000001907349px">    EEG = eeg_checkset(EEG,'eventconsistency');</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 27, 2015 at 2:33 AM, Jodie Feil <span dir="ltr"><<a href="mailto:Jodie.Feil@weizmann.ac.il" target="_blank">Jodie.Feil@weizmann.ac.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Dear All,
<div><br>
</div>
<div>I was wondering if there is a way/script to remove unwanted epochs once the data has been cleaned and is stored within a STUDY design. Whereby, t<span style="font-size:10pt">he list of the epochs/latencies which I would like to remove are categorised
 according to the raw data (pre-cleaned) and I would like to remove these specific epochs/latencies from the cleaned data (where a number of other epochs may have been removed manually during cleaning). </span></div>
<div><br>
</div>
<div>For example, I have EEG data which includes the cortical response of both correct and incorrect performance on a behavioural task. I would now like to remove the epochs corresponding to the incorrect trials. I have a list of the epochs/latency of the incorrect
 trials (however, this is indexed according to the raw data) and I was wondering where, following cleaning, the original epochs/latencies would be stored within the STUDY design. I thought perhaps this could be done through EEG.epoch within the STUDY structure.
 However, I am not sure how to write the script to remove the unwanted epochs without causing problems to the STUDY structure. </div>
<div><br>
</div>
<div>If it is too difficult within the STUDY structure, is there a way to script this easily for extraction from individual files?</div>
<div><br>
</div>
<div>Thank you for your time.</div>
<div><br>
</div>
<div>Kind regards,<br>
Jodie</div>
<div>
<div><br>
<div style="font-family:Tahoma;font-size:13px">
<p class="MsoNormal" style="margin-bottom:0.0001pt;background-color:white"><font size="2"><span style="font-family:'Times New Roman',serif;color:rgb(34,34,34)">---------------------</span><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)"></span></font></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;background-color:white"><font size="2"><span style="font-family:'Times New Roman',serif;color:rgb(34,34,34)">Jodie Naim-Feil</span><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)"></span></font></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;background-color:white"><font size="2"><span style="font-family:'Times New Roman',serif;color:rgb(34,34,34)">Post-doctoral Fellow</span><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)"></span></font></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;background-color:white"><font size="2"><span style="font-family:'Times New Roman',serif;color:rgb(34,34,34)">Research group of Prof. Elisha Moses</span><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)"></span></font></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;background-color:white"><font size="2"><span style="font-family:'Times New Roman',serif;color:rgb(34,34,34)">Department of Physics of Complex Systems</span><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)"></span></font></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;background-color:white"><font size="2"><span style="font-family:'Times New Roman',serif;color:rgb(34,34,34)">Weizmann Institute of Science</span><span style="font-family:Arial,sans-serif;color:rgb(34,34,34)"></span></font></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;background-color:white"><span style="font-family:'Times New Roman',serif;color:rgb(34,34,34)"><font size="2">76100 Rehovot, Israel</font></span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#222222"></span></p>
</div>
</div>
</div>
</div>
</div>

<br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div>