[Eeglablist] eegplot and TMPREJ

Tarik S Bel-Bahar tarikbelbahar at gmail.com
Fri May 5 16:52:40 PDT 2017


Understood and best wishes!

On Fri, May 5, 2017 at 7:44 PM, Max Cantor <Max.Cantor at colorado.edu> wrote:
> Hey Tarik,
>
> 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.
>
> Thanks,
> Max
>
> On Fri, May 5, 2017 at 5:32 PM, Tarik S Bel-Bahar <tarikbelbahar at gmail.com>
> wrote:
>>
>> Hello Max, hoping all is well. Here are some notes below that should
>> help you move forward. Cheers!
>>
>>
>>
>>
>> Overall, you might need to be loading and updating EEG structures in
>> memory via commands such as
>> [ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG,
>> CURRENTSET,'overwrite','on','gui','off');
>> and via eeg checkset.
>> See what you get when you run directly from the GUI and then type
>> eegh. You will see the necessary updating commands to emulate there.
>>
>> For accessing and using the TMPREJ info here's some suggestions:
>>
>> *********************Try these any of these three
>> options********************************
>> OPTION 1:
>> Type eegh after you run the visual detection. You can type via script
>> to command line, and then grab the ouput, which contains the time
>> periods that were rejected. So if you parse the output of eegh and
>> grab the times, you should be fine. This can be done all by script.
>>
>> OPTION 2
>> One way is to go into your copy of pop_eegplot, and try adding the
>> following line
>>     'savethesetimes=TMPREJ;' ...
>> before this line:
>>                'clear EEGTMP tmpcom;' ];
>> In my case it seems like it started saving these out into
>> "savethesetimes" after I ran pop_eegplot from the gui and selected
>> some periods. You could tweak this further.
>> If you can read matlab code, you can see that this area is where the
>> function treats non-trialled continuous data, and applies TMPREJ info
>> using another eeglab function, eeg_reject. So you could save the data
>> as a variable for use in the future with your other (same) files.
>>
>>
>> OPTION 3
>> Alternatively, try running Reject Continuous data but with very high
>> thresholds, which should throw up a window to review with no
>> selections
>>
>> options = {'elecrange',[1:128], 'freqlimit', {  [0 10] [35 128]  },
>> 'epochlength', .5, 'overlap', .5, 'contiguous', 2
>> ,'addlength',2,'taper','hamming'};
>> [EEG, selectedregions] = pop_rejcont( EEG, 'threshold', [10 10],
>> 'eegplot', 'on', 'verbose', 'off', options{:} );
>>
>> At this point, the function will run, and then should throw up an
>> eegplot window that you can review, and add or remove periods to.
>> Then close and overwrite the file. Note that "selectedregions" will
>> contain the selected time periods that were removed.
>>
>>
>> OPTION 4
>> Alternatively you can try to run eegplot or pop_eegplot with the
>> correct flag from the command line (see documentation) so it saves
>> marked periods to the EEG.reject variable and does not reject the
>> trials.
>>
>> OPTION 5
>> If you were working with trial data things would be a little easier.
>>    *run trial artifact detection, then...
>>  if ~isempty(EEG.reject.rejjp) || ~isempty(EEG.reject.rejkurt) ||
>> ~isempty(EEG.reject.rejthresh)
>> EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1);
>> theinfoAboutWhichTrialswereRemoved = EEG.reject.rejglobal; %this saves
>> marked trial info across all artifact measures in eeglab
>>  EEG = pop_rejepoch( EEG, EEG.reject.rejglobal ,0);
>
>
>
>
> --
> Max Cantor
> Graduate Student
> Cognitive Neuroscience of Language Lab
> University of Colorado Boulder



More information about the eeglablist mailing list