[Eeglablist] Epochs rejection by script
Tarik S Bel-Bahar
tarikbelbahar at gmail.com
Mon Jul 17 10:10:53 PDT 2017
Hello Antonio,
Try something like the below within your script loop, which throws up a
gui, and then computes epochs-to-remove and then removes them.
The following might also be helpful: Reviewing the eeglab scripting online
tutorials, and the eeg.reject structure in your eeglab files. The
documentation within functions is also useful.
Does the below work for you?
.......
1.Run various artifact-epoch detection methods
then
[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
2. Then, within code, run the function command for showing eegplot of the
epochs.
pop_eegplot( EEG, 1, 1, 1);
3. The user should then be able to walk through the epochs, see the ones
that have been selected and those that have not been, make changes if
necessary, and then should close the gui, and then the code should keep
running the following:
[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); %gives a variable
named as follows with all epochs to reject: EEG.reject.rejglobal
[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
5. run epoch rejection using that list of epochs
for example, as follows
EEG = pop_rejepoch( EEG, EEG.reject.rejglobal ,0);
[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
........
On Mon, Jul 17, 2017 at 5:57 AM, Antonio Maffei <antonio.maffei at phd.unipd.it
> wrote:
> Dear EEGLab users,
>
> I have a problem in the scripting of a pipeline for semi-automated epoch
> rejection.
>
> The step I would like to accomplish are:
>
> 1) Importing the dataset
> 2) Performing epoch rejection based on amplitude
> 3) Performing epoch rejection based on linear trends
> 4) Review the epochs visually
> 5) Confirm rejection
>
> My attempt is the following:
>
> for i = 1:length(filenames)
>
> % Import EEG data
>
> dataset_name = filenames_epochs{i};
>
> EEG = pop_loadset('filename', dataset_name, 'filepath', dirpath);
>
> % Reject on amplitude threshold
>
> EEG = pop_eegthresh(EEG, 1, [1:32], -100, 100, 0, 2.0391, 1, 0);
>
> % Reject trends
>
> EEG = pop_rejtrend(EEG, 1, [1:32], 262, 0.5, 0.3, 1, 0, 0);
>
> % Review visually the marked epochs and confirm rejection
>
> ???????????????????????????????????
>
> % Store the dataset
>
> [ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG);
>
> end
>
> I know how to achieve this by GUI but, as you can see, I fail to
> understand how to review the marked epochs visually within the script.
>
> Thank you for the help,
>
> Antonio
>
> Antonio Maffei, Ph.D. Student
>
> Department of General Psychology (DPG)
> University of Padova
> Via Venezia 8 - 35131
> Padova, Italy
>
> email: antonio.maffei at phd.unipd.it
> office: 049 8277424
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.uc
> sd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20170717/82c80568/attachment.html>
More information about the eeglablist
mailing list