<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Wambua,<div><br></div><div>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.</div><div><br></div><div>There is no know sets of function to convert Fieldtrip back to EEGLAB although I had heard rumors a couple of years ago.</div><div><br></div><div>Best,</div><div><br></div><div>Arno</div><div><br><div><div>On Dec 11, 2010, at 12:26 PM, Matt Mollison wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>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.</div><div><br></div><div>Matt</div><div><br></div><div>% ========================================</div>
<div>eventVales = {'target','lure'};</div><div><br></div><div>% the amount of time before and after the segmented events, in seconds</div><div>prepost = [0.5 1.5];</div><div><br></div><div><div>% importing eeglab .set files</div>
<div>ftype = 'eeglab_set';</div><div><br></div><div>% initialize the data structure</div><div>data = struct;</div></div><div><br></div><div>% add each event value as a field in the data struct</div><div>for evVal = 1:length(eventValues)</div>
<div><br></div><div> % path to the eeglab .set file</div><div> infile = fullfile('path/to/files',[eventValues{evVal},'.set']);</div><div> </div><div> cfg = [];</div><div> cfg.dataset = infile;</div><div>
cfg.headerfile = infile;</div><div><div> cfg.dataformat = ftype;</div><div> cfg.headerformat = ftype;</div></div><div> cfg.continuous = 'no';</div><div> </div><div><div> cfg.trialdef.prestim = prepost(1);</div>
<div> cfg.trialdef.poststim = prepost(2);</div><div> cfg.trialfun = 'trialfun_general';</div><div> cfg.trialdef.eventtype = 'trigger';</div><div> cfg.trialdef.eventvalue = eventValues{evVal};</div><div>
cfg = ft_definetrial(cfg);</div></div><div> </div><div> data.(eventValues{evVal}) = ft_preprocessing(cfg);</div><div>end</div><div><div>% ========================================</div></div><div><br></div>--<br>Univ. of Colorado at Boulder<br>
Dept. of Psychology and Neuroscience<br><a href="mailto:matthew.mollison@colorado.edu">matthew.mollison@colorado.edu</a><br><a href="http://psych.colorado.edu/~mollison/">http://psych.colorado.edu/~mollison/</a><br>
<br><br><div class="gmail_quote">On Mon, Dec 6, 2010 at 11:31 AM, Wambua Kazi <span dir="ltr"><<a href="mailto:wambua.kazi@gmail.com">wambua.kazi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<div> 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?</div><div>thank you,</div><div> Wambua</div><font color="#888888"><div>
<br></div>
<div><br></div>
</font><br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br>
_______________________________________________<br>Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a></blockquote></div><br></div></body></html>