<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Marco,<div><br></div><div>You can do this a lot more easily using ERPLAB's "Bin Operator" to add / redefine labels based on conditional logic of event, timing, etc. Check out <a href="http://erpinfo.org">erpinfo.org</a> for the plugin.</div><div><br></div><div>The workflow is like this</div><div>- create a "binlist" (list of events in a text file with labels)</div><div>- assign that binlist to a continuous event file</div><div>- epoch the continuous file per the bins assigned, and average to ERPs</div><div>- then you would run conditional code to re-define your bins and apply it to the ERP file. </div><div><br></div><div>for example:</div><div><br></div><div><!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<span class="Apple-style-span" style="font-family: Arial; ">%add ERPLab event structure</span></div><!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<div style="color: rgb(0, 0, 0); font-size: medium;"><span class="Apple-style-span" style="font-family: Arial; ">EEG = pop_creabasiceventlist(EEG, '', {'boundary'}, {-99});</span></div><div style="color: rgb(0, 0, 0); font-size: medium;"><span class="Apple-style-span" style="font-family: Arial; ">% "bindesc.txt" contains numeric and text labels for each event</span></div><div style="color: rgb(0, 0, 0); font-size: medium;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;">EEG = pop_binlister( EEG, 'LANT_bindesc.txt', 'no', '', 0, [], [], 0, 0, 0);</span></div><div style="color: rgb(0, 0, 0); font-size: medium;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;">%cut continuous file into epoched file - resulting in a single file, unlike the epoching of EEGLAB</span></div><div style="color: rgb(0, 0, 0); font-size: medium;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;">EEG = pop_epochbin( EEG , [-1500 1500], [-0.1 0]);; %3-sec epohcs, baselined 100 ms pre-stim</span></div><div style="color: rgb(0, 0, 0); font-size: medium;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium;">EEG = eeg_checkset( EEG );</span></div><div>%Create ERPs</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; font-family: Arial; "><font color="#040404"><font face="Arial"><font size="4"><span style="font-size: 14px; ">ERP = pop_averager( EEG,1,1,1);</span></font></font></font><font face="Arial"><font size="4"><span style="font-size: 14px; "> </span></font></font></div><div>% difference wave subtraction - you can create new ERPs not in the original epochs, here.</div><div><span class="Apple-style-span" style="font-size: 14px; font-family: Arial; ">ERP = pop_binoperator( ERP, {'bin10 = bin1 - bin3 labels OrientingCost LVF' 'bin11 = bin7 - bin9 labels OrientingCost RVF' });</span> <span class="Apple-style-span" style="font-family: Arial; font-size: 14px; "> </span></div><div style="font-family: Arial; "><font color="#040404"><font size="4"><span style="font-size: 14px; ">ERP = pop_savemyerp(ERP, </span></font></font><font color="#040404"><font size="4"><span style="font-size: 14px; ">'erpname'</span></font></font><font color="#040404"><font size="4"><span style="font-size: 14px; ">, inputfilename, </span></font></font><font color="#040404"><font size="4"><span style="font-size: 14px; ">'filename'</span></font></font><font color="#040404"><font size="4"><span style="font-size: 14px; ">, [OUTPUTFILEPATH erpfilename]);</span></font></font></div></div><div> </div><div>Good luck - hope this helps!</div><div><br></div><div>Best,</div><div>andrew</div><div><br></div><div><div><div>On May 5, 2012, at 2:33 PM, Marco Montalto wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Dear List,<br><br>In my experiment I have three conditions and each trial is 30 seconds long. I ignore the first and last 10 seconds of each block and the middle 10-second block I divide into epochs of 2-second duration. Currently I am doing this manually through the EEGLAB GUI by placing an event (with the same 'type' for blocks from the same condition) at every two seconds (in the middle 10-second block) and then extracting epochs around those events. Would anyone know whether there is a more automated and a faster way of doing this? Thanks in advance.<br><br>Regards,<br>Marco Montalto<br>_______________________________________________<br>Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html">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></div></blockquote></div><br></div></body></html>