[Eeglablist] using pop_eegplot and eeg_eegrej in a script

James Desjardins jdesjardins at brocku.ca
Mon Jun 6 12:42:36 PDT 2011


Hi Sebastian,


Regarding your first question:

I find it useful to batch interactive pruning procedures as well (if  
for no other reason ... it drastically reduces the number of coffee  
breaks that I take while pruning data!). To make streamlined  
interactive batch scripts I have found that accessing the figure's  
UserData is the best way to proceed.

If your script is already loading the data that you want to display  
and edit the following code will (1) create the eegplot, (2) access  
the current eegplot's UserData structure, (3) adjust the "winlength"  
field of UserData, (4) set the current eegplot's UserData using the  
new values, (5) redraw the current eegplot figure with the new values,  
(6) wait for this figure to close before continuing on with the  
remainder of the script.

pop_eegplot( EEG, 1, 1, 1); %1
ud=get(gcf,'UserData');     %2
ud.winlength=40;            %3
set(gcf,'UserData',ud);     %4
eegplot('draws',0)          %5
uiwait;                     %6


This procedure is flexible in that any figure properties or UserData  
fields can be adjusted in script. For example changing step 4 above to:

set(gcf,'UserData',ud, 'Position', [1,1,1024,768]);

... will also move the figure to the bottom-left corner of the display  
and change the size to 1024x768 pixels.


Regarding your second question:

The final input to the pop_eegplot function ("reject") when set to 1  
allows the immediate removal of marked time periods. When using this  
setting simply click the "REJECT" button in the bottom left corner of  
the eegplot figure when you are finished pruning and then a separate  
call to pop_eegrej will not be necessary.

I hope that this is helpful.

James Desjardins
Technician, MA Student
Department of Psychology, Behavioural Neuroscience
Cognitive and Affective Neuroscience Lab
Brock University
500 Glenridge Ave.
St. Catharines, ON, Canada
L2S 3A1
905-688-5550 x4676


Quoting Sebastian Urchs <sebastian.urchs at gmail.com>:

> Hi,
>
>
>
> I am setting up a pipeline for multi-subject data preprocessing including
> ICA on a cluster. Now in order to clean up the data before running ICA I
> would like to use pop_eegplot() from inside a script that loops through all
> my subjects. I will then halt the script until the pop_eegplot() window is
> closed again and run eeg_eegrej() on the marked data-parts.
>
>
>
> Now my questions are:
>
>
>
> : First, sliding through a large dataset in pop_eegplot() is not effective
> at the default displayed timerange. Of course this can be changed manually
> each time by pointing and clicking but it would be great if I could hand
> over arguments to pop_eegplot() when it is called that make the displayed
> time range say 50s. I have not managed to change
>
>
>
> "eegplotoptions = { 'winlength', 5, 'events', EEG.event };"
>
>
>
> arguments from the pop_eegplot.m file itself - could it be that those
> settings are hardwired into the file?
>
>
>
> : Second, I am wondering where the arrays with the data marked for rejection
> are stored within the EEG structure. I would then use this information to
> call pop_eegrej() in the script which would make the whole rejection process
> much faster.
>
>
>
> Thanks a lot in advance!
>
>
>
> Sebastian,
>
> LMU Munich
>
>







More information about the eeglablist mailing list