<div dir="ltr">Dear Brian,<div><br></div><div>It seems my colleagues have been using EEG.etc as such a user-added data.</div><div><br></div><div>I have a present for you Brian. See below. These are the tricks to deal with EEG.event without using for loop.</div><div><br></div><div>Makoto</div><div><br></div><div>%%%%%%%%%%</div><div style="font-size:12.8000001907349px">% rename events-this is a new effective method!</div><div style="font-size:12.8000001907349px">    allEvent = cell2mat({EEG.event.type}');</div><div style="font-size:12.8000001907349px">    idx2049 = find(allEvent==2049); [EEG.event(idx2049).type] = deal(8049);</div><div style="font-size:12.8000001907349px">    idx2050 = find(allEvent==2050); [EEG.event(idx2050).type] = deal(8050);</div><div><span style="font-size:12.8000001907349px">    idx2051 = find(allEvent==2051); [EEG.event(idx2051).type] = deal(8051);</span></div><div><br></div><div>% another trick</div><div style="font-size:12.8000001907349px">dummyA = num2cell(EEGsuggestedLatencyForFixationOnsets);</div><div><span style="font-size:12.8000001907349px">[EEG.event(Idx).latency] = dummyA{:};</span> </div><div><br></div><div><div style="font-size:12.8000001907349px">% adding 400ms to specific events</div><div style="font-size:12.8000001907349px">allEvent = {EEG.event.type}';</div><div style="font-size:12.8000001907349px">stroopOnsetIdx  = find(strcmp(allEvent, 'VolMov_fixationbegin'));<br></div><div style="font-size:12.8000001907349px">stroopOnsetLatencyInFrame  = [EEG.event(stroopOnsetIdx).latency]';</div><div style="font-size:12.8000001907349px">modifiedValues = num2cell(bsxfun(@plus, stroopOnsetLatencyInFrame, 400),2);</div><div style="font-size:12.8000001907349px">[EEG.event(stroopOnsetIdx).latency] = modifiedValues{:};</div></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"><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 style="font-size:12.8000001907349px">%%%%%%%%%%%%%%%%%%</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 23, 2015 at 9:51 AM, Brian Scally <span dir="ltr"><<a href="mailto:scallybrian@gmail.com" target="_blank">scallybrian@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I've added a variable to the EEG.epoch structure, e.g. EEG.epoch.index, and coded each epoch for identification later. When I split the set into two new sets of epochs, the variable I added gets lost and the original epochs are no longer coded. Is there a way I can retain that information? Have tried all checkset commands etc.</div><div><br></div><div>Cheers<span class="HOEnZb"><font color="#888888"><br>-- <br><div>Brian</div>
</font></span></div></div>
<br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" 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>