[Eeglablist] unable to reject with pop_eegplot

Arnaud Delorme arno at ucsd.edu
Sat Dec 7 23:27:07 PST 2013


Dear Bart,

pop_eegplot() is a special function. It is one of the only EEGLAB non modal function which means that it does not block you from typing commands on the Matlab command line. As a non-modal function, it needs to call the eeglab.m function at the very end to redraw the graphic interface. If you have cleared some of the EEGLAB variables such as ALLEEG, and CURRENTSET, then an error will be triggered (if you simply close the interface, it should be fine though - it will simply be redrawn).

The easiest would be to call eegplot directly and not pop_eegplot (pop_eegplot is never saved in the history by the way)

command = '[EEG LASTCOM] = eeg_eegrej(EEG,eegplot2event(TMPREJ, -1));'
eegplot(EEG.data, 'srate', EEG.srate,  'events', EEG.event, 'command', command);

The region which are rejected are returned in the TMPREJ variable and your custom command removes the selected regions from the EEG dataset.
Best,

Arno

On Dec 3, 2013, at 3:04 PM, Mikołaj Magnuski <imponderabilion at gmail.com> wrote:

> Hey Bart,
> 
> I am not sure what causes your problem but there are couple of ways to check :)
> 
> First of all - did you paste the entire error message? If not - please do, it will help anybody to solve your problem.
> 
> pop_eegplot, as many other eeglab gui functions do not use function handles in button callbacks but strings that are eval'ed whenever you press the button. 
> It seems that somewhere (in some workspace where the callback is eval'ed) there is no EEG variable (having precisely this name).
> 
> However, the fact that the presence of EEGlab saves you from this error is informative in at least one way:
> - EEGlab uses EEG as a global variable - that is, it can be acessed from any workspace by first declaring:
> global EEG
> 
> Could you check if declaring EEG as global solves the problem?
> 
> If not, another question:
> - if you are not using eeg_plot in presence of EEGlab what is the context that you use eeg_plot in? You mentioned command window, but how are your data (EEG) loaded, what scripts/functions lead you to the point where the error occurs?
> 
> 2 gru 2013 21:35 "Bart Michiels" <MICHELSB at tcd.ie> napisał(a):
> Hey,
> 
> I'm having troubles with the pop_eegplot function. I have continuous EEG component data that I want to plot with this function for manual artefact rejection.
> When I put the " pop_eegplot(EEG, 0, 1, 1)" in the command window the eegplot window opens and everything seems to work.
> However, when selecting a time frame and pressing on the reject button I get the following error:
> 
> Undefined function or variable "EEG".
> Error while evaluating uicontrol Callback
> 
> I debugged both the eegplot and pop_eegplot functions and it seems that there is no problem with those functions (as everything is functioning well until I press the "reject" button).
> 
> The weird thing is that rejecting with pop_eegplot() in the command window of matlab screen is working when eeglab window is opened (and minimized).
> 
> Can someone help me with this problem?
> 
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.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/20131207/9f4c20a2/attachment.html>


More information about the eeglablist mailing list