[Eeglablist] GUI vs command line

Stefan Debener s.debener at uke.uni-hamburg.de
Sat Oct 29 06:32:46 PDT 2005


Hi Brian,
the following code is actually taken from the EEGLAB history (>>h), and 
a bit streamlined. It reads a cnt file, epochs, adds channel info and 
re-references to common average. Note that in this version, all events 
are used as time-locking events. In oder to update your GUI, you should 
also add >>eeglab redraw;
Cheers,
Stefan

i = 1
infile = {'MH08RS_1', 'JL05LS_3','JK07LS_2'};
inpath = 'D:\jem\', infile{i}'

[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG = pop_loadcnt([inpath, infile{i}, '.cnt'] , 'dataformat', 'int32', 
'keystroke', 'on');
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, CURRENTSET,  
'setname', 'CNT file', 'overwrite', 'on');
EEG = pop_epoch( EEG, {  }, [-0.2 0.8], 'newname', 'CNT file epochs', 
'epochinfo', 'yes');
EEG = pop_rmbase( EEG, [-200    0]);
EEG.chanlocs=pop_chanedit(EEG.chanlocs,  'lookup',[]);
EEG = pop_select( EEG, 'nochannel',[60 64 65:68] );
EEG = pop_reref( EEG, [], 'refstate',0);
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);



Brian Roach wrote:
> I am trying to automate some processing of .cnt data files in EEGlab.  
> I am unable to use the EEG.history commands on multiple files.  I am 
> also completely unable to use the epoch function at all.  I can do 
> everything from the GUI, but something must be lost when I move to 
> command line function calls.  I downloaded Matt Stead's updated 
> loadcnt.m file into the proper directory, but this did not help.  Has 
> anyone had similar difficulties with .cnt data/epoching?  Can anyone 
> tell me (or show example of) what the input format should be for the 
> 'events'   (  - vector events (expressed in seconds or points) ).  I 
> have no idea about the proper input for this argument because I have 
> tried things like:
> >> epocheddata = epoch(EEG, [3641], [-0.5 1]);
> Epoching...
> Warning: event 1 out of data boundary
> or
> >> epocheddata = epoch(EEG, [1:100000000], [-0.5 1]);
> this produces 100000000 out of boundary warnings
> Also, EEG is assigned by a seemingly successful call to:
> EEG = loadcnt('myfile.cnt' , 'dataformat', 'int16');
> where
> EEG =
>       header: [1x1 struct]
>     electloc: [1x63 struct]
>         data: [63x111280 double]
>         Teeg: [1x1 struct]
>        event: [1x101 struct]
>          tag: 0
> also, of all the fields in EEG.event:
> ans =
> 1x101 struct array with fields:
>     stimtype
>     keyboard
>     keypad_accept
>     offset
>     type
>     code
>     latency
>     epochevent
>     accept
>     accuracy
> only stimtype and offset have non zero values - is that a problem for 
> epoch or pop_epoch?  When I load a file from the GUI, these extra 
> messages are sent:
> eeg_checkset note: upper time limit (xmax) adjusted so 
> (xmax-xmin)*srate+1 = number of frames
> eeg_checkset note: creating the original event table (EEG.urevent)
> Creating a new dataset with index 1
> Done.
> In this EEG structure, EEG.event holds: 1x101 struct array with fields:
>     type
>     latency
>     urevent
> stimtype = type, but the associated latency values, event(1).latency 
> might equal 3608, and event(1).offset (when the command line call is 
> used) = 3607.  Can I just set event(1).latency = event(1).offset for 
> all events, and urevent = 1 for all events?
> thanks,
> Brian
>
> _______________________________________________
> eeglablist mailing list eeglablist at sccn.ucsd.edu
> http://sccn.ucsd.edu/mailman/listinfo/eeglablist
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to 
> eeglablist-unsubscribe at sccn.ucsd.edu
>
>



More information about the eeglablist mailing list