[Eeglablist] Using ctrlselectcommand in eegplot
Stuart Fogel
sfogel at uwo.ca
Tue Aug 12 12:11:37 PDT 2014
Thank you Makoto. I have found some helpful approaches used in James Desjardin's very nice VisEd-marks plugin, and have contacted him directly about some additional details. Best regards, Stuart
==
Stuart Fogel, PhD
Adjunct Professor & Research Scientist
The Brain & Mind Institute | Department of Psychology
Western University | London | Ontario | Canada
www.BMIsleeplab.uwo.ca
==
> On Aug 11, 2014, at 3:38 PM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu> wrote:
>
> Dear Stuart,
>
> I don't touch EEGLAB interactive plot, but I know the expert. Please check out VisEd by James Desjardins. In his code you should be able to find the solution for your question (or the plugin itself could solve your issue).
> https://www.youtube.com/watch?v=M-BlkI3NbiM
>
> Makoto
>
>
>> On Tue, Aug 5, 2014 at 9:15 PM, Stuart Fogel <sfogel at uwo.ca> wrote:
>> Hello eeglab-ers,
>>
>> I'm trying to gather information about the latency for when the mouse button is ctrl-clicked and ctrl-released from eegplot to be used in some additional code to manipulate the EEG.events structure. According to the eegplot documentation, it seems the best way to get this info is using the ctrlselectcommand option when calling eegplot.
>>
>> However, I have been running into some trouble figuring out where this information is accessible. I read on the eeglablist that it is in the UserData for the plot, but I have not been able to successfully track it down.
>>
>> This little bit of code retrieves a whole bunch of info about eegplot, but it seems not what I am looking for (unless it's well hidden). Here's what I have so far:
>>
>> % Get latency on mouse click and mouse release:
>> ctrlselectcommand = {'lat1=get(gcbf,''UserData''),' ','lat2=get(gcbf,''UserData'');
>>
>> % call eegplot with options
>> chaninds=[1:length(EEG.chanlocs)];
>> eegplot( EEG.data(chaninds,:,:), ...
>> 'eloc_file',EEG.chanlocs(chaninds), ... ...
>> 'srate', EEG.srate, ...
>> 'limits', [EEG.xmin EEG.xmax]*1000 , ...
>> 'command', command, ...
>> 'ctrlselectcommand', ctrlselectcommand, ...
>> 'events',EEG.event);
>>
>> Any help on some code snippets or advice on how to retrieve this info would be greatly appreciated!
>>
>> I also ran into a second issue, which is resolved but only by modifying the code for eegplot.m. I ran into some trouble getting eegplot to play nicely with the ctrselectcommand option. I slightly modified the code at ~line 1031 of eegplot.m to following, as I could not figure out another way around the issue. I'm not sure if it's a bug, or if I've handled the ctrlselectcommand option clumsily in the first place. In case this is a bug, here's the changes I made to to eegplot.m:
>>
>> g.commandselect{1} = [ 'if strcmp(get(gcbf, ''SelectionType''),''alt''),' g.ctrlselectcommand{1,1}{1,1} ...
>> ',else ' g.selectcommand{1} ',end;' ];
>> g.commandselect{2} = [ 'if strcmp(get(gcbf, ''SelectionType''),''alt''),' g.ctrlselectcommand{1,1}{1,2} ...
>> ',else ' g.selectcommand{2} ',end;' ];
>> g.commandselect{3} = [ 'if strcmp(get(gcbf, ''SelectionType''),''alt''),' g.ctrlselectcommand{1,1}{1,3} ...
>> ',else '
>>
>> Thanks,
>> Stuart
>>
>> ==
>> Stuart Fogel | PhD
>> Adjunct Professor & Research Scientist
>> Brain & Mind Institute | Department of Psychology
>> Western University | London | Ontario | Canada
>> http://www.BMIsleeplab.uwo.ca
>> ==
>>
>> _______________________________________________
>> 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
>
>
>
> --
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20140812/00178b23/attachment.html>
More information about the eeglablist
mailing list