correction included below<div>
<div><br></div><br><div class="gmail_quote">On Tue, May 15, 2012 at 9:45 PM, Tarik S Bel-Bahar <span dir="ltr"><<a href="mailto:tarikbelbahar@gmail.com" target="_blank">tarikbelbahar@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>Greetings Marco,</div><div>this should be straightforward as a script, hope the outline below helps you generate your own script. </div>

<div>Let us know if you succeed!</div><div><br></div><div>1. Make a loop that hunts for the the first, second, etc... instances of event A that marks the beginning of all trials.</div>
<div>2. Having found the first Event A, find the first Event B (which should be the start and end of 1 trial, according to you)</div><div>3. Take the latency value (in samples or milliseconds), of each of the two events.</div>


<div>4. Make a list of periods to drop for this trial, which should include the </div><div>Time of Event A      and        the Time of Event A + 10Seconds   [this would be one period to "drop"]  </div></blockquote>

<div>   Time of Event B      and        the   Time of Event B - 10Seconds   </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div> [this would be the second period to "drop" for that file]</div>


<div>5. Update a list of times with these two sets of start and end values from Step 4.</div><div>6. Continue through the loop, adding to the array that holds the start and end values for the periods to drop.</div><div>7. Add an event if you need it to mark the start of each of your new "trimmed" trials. For example, the Time of Event A + 10 Seconds + 1 sample</div>


<div>could be the place to put a new marker event for later epoching.</div><div>8. Reject the times you have collected.</div><div>9. Now Epoch based on other existing events within the trials.</div><div><br></div><div><br>


</div><div>All of the baove you can build by doing a simple example from the GUI, then using eeg history information to build your own script.</div><div><br></div><div>Also,<b> alternatively,</b> you <b>could </b>be able to also consider an alternative option,</div>


<div>which simply would mean epoching on Event A,</div><div>but setting the times to be  +10 seconds to plus however many seconds after Event A +10 seconds you want to go.</div><div>This would work if your trial time of interest was not too variable, in other words, if the time</div>


<div>between the first and last ten seconds in each trial were.</div><div><br></div><div>As a last point, if you are using ICA, remember that you may be throwing out data that would be useful for a successful ICA decomposition.</div>


<div><br></div><div><br></div><div><br></div><div>then copying out eegh  (eeg history), and then </div><div class="HOEnZb"><div class="h5"><div><br></div><br>
<br><br><div class="gmail_quote">On Mon, May 14, 2012 at 2:33 PM, Marco Montalto <span dir="ltr"><<a href="mailto:montaltomarco@onvol.net" target="_blank">montaltomarco@onvol.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div style="word-wrap:break-word">Dear Arno,<div><br></div><div>I have tried the script you supplied me with but found a problem with it. The first part of the script (EEG=pop_select….) treats the data file as one continuous dataset; it ignores the events that mark the beginning and end of a trial. I would like to remove the first and last ten seconds within the boundaries of a trial delimited by the events marking the beginning and end of a trial. As it is the script merely removes the first 10 seconds of the continuous data and last ten seconds of the same continuous data. Let's say A marks beginning of trial 1 and B marks the end of the same trial - I would like to remove the first and last 10 seconds within the block marked by events A and B. And so on for the rest of trails within the same data file. Is this possible? Is there a way of doing this by using some script? Any help you could provide me with would be greatly appreciated.</div>


<div><br></div><div>Thanks and regards,</div><div>Marco</div><div><div><div><br><div><div>On 11 May 2012, at 05:54, Arnaud Delorme wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word">Hi Marco,<div>
<br></div><div>to do what you want to do, you should type in</div><div><br></div><div>EEG = pop_select(EEG, 'time', [10 EEG.xmax-10]); % remove the first and last 10 seconds</div><div>EEG = eeg_regepoch(EEG, 'recurrence', 2); % divide into 2 seconds non-overlaping blocks</div>


<div><br></div><div>Best,</div><div><br></div><div>Arno</div><div><br></div><div><div><div>On May 5, 2012, at 6:38 PM, Stephen Politzer-Ahles wrote:</div><br><blockquote type="cite">Hi Marco,<br><br>I haven't tried this myself, but you should be able to get any of these epochs from the same event using pop_epoch. Assuming that you have an event marking the beginning of the block, then the first epoch you want (i.e. 10-12 seconds after the event) would be<br>



<br><div style="margin-left:40px">OUTEEG = pop_epoch( EEG, {events}, [10 12]);<br></div><br>the second would be<br><br><div style="margin-left:40px">OUTEEG = pop_epoch( EEG, {events}, [12 14]);<br></div><br>etc.<br><br>Best,<br>



Steve<br><br><div class="gmail_quote">On Sat, May 5, 2012 at 4:33 PM, Marco Montalto <span dir="ltr"><<a href="mailto:montaltomarco@onvol.net" target="_blank">montaltomarco@onvol.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



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" 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" target="_blank">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" target="_blank">eeglablist-request@sccn.ucsd.edu</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Stephen Politzer-Ahles<br>University of Kansas<br>Linguistics Department<br><a href="http://www.linguistics.ku.edu/" target="_blank">http://www.linguistics.ku.edu/</a><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" target="_blank">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" target="_blank">eeglablist-request@sccn.ucsd.edu</a></blockquote></div><br></div></div></blockquote>


</div><br></div></div></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" target="_blank">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" target="_blank">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br>
</div></div></blockquote></div><br></div>