[Eeglablist] code for converting EEGLAB to fieldtrip data formats (and vice versa)

Arnaud Delorme arno at ucsd.edu
Sat Dec 11 15:57:43 PST 2010


Dear Wambua,

there is the "eeglab2fieldtrip" structure to convert EEGLAB to FieldTrip (in EEGLAB code). Also we contributed files to the FILE-IO project of Fieldtrip to import EEGLAB datasets into Fieldtrip and any other project using FILE-IO. These functions also convert the EEGLAB event structure to the Fiedltrip event format.

There is no know sets of function to convert Fieldtrip back to EEGLAB although I had heard rumors a couple of years ago.

Best,

Arno

On Dec 11, 2010, at 12:26 PM, Matt Mollison wrote:

> Wambua, something like this should convert segmented events in EEGLAB .set files to FieldTrip structures. Not sure how to go back to EEGLAB. Hope it helps.
> 
> Matt
> 
> % ========================================
> eventVales = {'target','lure'};
> 
> % the amount of time before and after the segmented events, in seconds
> prepost = [0.5 1.5];
> 
> % importing eeglab .set files
> ftype = 'eeglab_set';
> 
> % initialize the data structure
> data = struct;
> 
> % add each event value as a field in the data struct
> for evVal = 1:length(eventValues)
> 
>   % path to the eeglab .set file
>   infile = fullfile('path/to/files',[eventValues{evVal},'.set']);
>   
>   cfg = [];
>   cfg.dataset = infile;
>   cfg.headerfile = infile;
>   cfg.dataformat = ftype;
>   cfg.headerformat = ftype;
>   cfg.continuous = 'no';
>   
>   cfg.trialdef.prestim = prepost(1);
>   cfg.trialdef.poststim = prepost(2);
>   cfg.trialfun = 'trialfun_general';
>   cfg.trialdef.eventtype = 'trigger';
>   cfg.trialdef.eventvalue = eventValues{evVal};
>   cfg = ft_definetrial(cfg);
>   
>   data.(eventValues{evVal}) = ft_preprocessing(cfg);
> end
> % ========================================
> 
> --
> Univ. of Colorado at Boulder
> Dept. of Psychology and Neuroscience
> matthew.mollison at colorado.edu
> http://psych.colorado.edu/~mollison/
> 
> 
> On Mon, Dec 6, 2010 at 11:31 AM, Wambua Kazi <wambua.kazi at gmail.com> wrote:
> Hello,
>    Does anyone have code for converting from EEGLAB EEG data structures to a fieldtrip structure (and vice versa) that she or he would like to share?
> thank you,
>      Wambua
> 
> 
> 
> _______________________________________________
> 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/20101211/2361dba6/attachment.html>


More information about the eeglablist mailing list