<div dir="ltr">Hey Tarik,<div><br></div><div>I'm doing well, thanks! Hope everything is well with you too. I hadn't had a chance to respond yet, but actually Benedikt's solution worked for me, but thank you for your comments as well! That being said, I was not familiar with eegh as you suggest with option 1, and would not have known where to edit the function such as you suggest in option 2 (and which may be very helpful in the future), so again thanks! The reason why I'm doing this on continuous data rather than epoched data, is that because this is an EEG and eye tracking coregistration study, the number of events in the data prior to when the saccade and fixation events are created from the gaze samples are minimal, i.e. it wouldn't be practical to epoch around the page onset and offset triggers and potentially reject a whole page-reading worth of EEG-data, but also the data need to be as clean as possible prior to defining the saccades and fixations.</div><div><br></div><div>Thanks,</div><div>Max</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 5, 2017 at 5:32 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">Hello Max, hoping all is well. Here are some notes below that should<br>
help you move forward. Cheers!<br>
<br>
<br>
<br>
<br>
Overall, you might need to be loading and updating EEG structures in<br>
memory via commands such as<br>
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG,<br>
CURRENTSET,'overwrite','on','<wbr>gui','off');<br>
and via eeg checkset.<br>
See what you get when you run directly from the GUI and then type<br>
eegh. You will see the necessary updating commands to emulate there.<br>
<br>
For accessing and using the TMPREJ info here's some suggestions:<br>
<br>
*********************Try these any of these three<br>
options***********************<wbr>*********<br>
OPTION 1:<br>
Type eegh after you run the visual detection. You can type via script<br>
to command line, and then grab the ouput, which contains the time<br>
periods that were rejected. So if you parse the output of eegh and<br>
grab the times, you should be fine. This can be done all by script.<br>
<br>
OPTION 2<br>
One way is to go into your copy of pop_eegplot, and try adding the<br>
following line<br>
    'savethesetimes=TMPREJ;' ...<br>
before this line:<br>
               'clear EEGTMP tmpcom;' ];<br>
In my case it seems like it started saving these out into<br>
"savethesetimes" after I ran pop_eegplot from the gui and selected<br>
some periods. You could tweak this further.<br>
If you can read matlab code, you can see that this area is where the<br>
function treats non-trialled continuous data, and applies TMPREJ info<br>
using another eeglab function, eeg_reject. So you could save the data<br>
as a variable for use in the future with your other (same) files.<br>
<br>
<br>
OPTION 3<br>
Alternatively, try running Reject Continuous data but with very high<br>
thresholds, which should throw up a window to review with no<br>
selections<br>
<br>
options = {'elecrange',[1:128], 'freqlimit', {  [0 10] [35 128]  },<br>
'epochlength', .5, 'overlap', .5, 'contiguous', 2<br>
,'addlength',2,'taper','<wbr>hamming'};<br>
[EEG, selectedregions] = pop_rejcont( EEG, 'threshold', [10 10],<br>
'eegplot', 'on', 'verbose', 'off', options{:} );<br>
<br>
At this point, the function will run, and then should throw up an<br>
eegplot window that you can review, and add or remove periods to.<br>
Then close and overwrite the file. Note that "selectedregions" will<br>
contain the selected time periods that were removed.<br>
<br>
<br>
OPTION 4<br>
Alternatively you can try to run eegplot or pop_eegplot with the<br>
correct flag from the command line (see documentation) so it saves<br>
marked periods to the EEG.reject variable and does not reject the<br>
trials.<br>
<br>
OPTION 5<br>
If you were working with trial data things would be a little easier.<br>
   *run trial artifact detection, then...<br>
 if ~isempty(EEG.reject.rejjp) || ~isempty(EEG.reject.rejkurt) ||<br>
~isempty(EEG.reject.rejthresh)<br>
EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1);<br>
theinfoAboutWhichTrialswereRem<wbr>oved = EEG.reject.rejglobal; %this saves<br>
marked trial info across all artifact measures in eeglab<br>
 EEG = pop_rejepoch( EEG, EEG.reject.rejglobal ,0);<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:small"><div>Max Cantor<br></div>Graduate Student</div><div style="font-size:small">Cognitive Neuroscience of Language Lab</div><span style="font-size:small">University of Colorado Boulder</span><br></div></div>
</div>