eeglab2fieldtrip

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Mon Jul 23 16:44:20 CEST 2007


Hi Valesca

On 13 Jul 2007, at 11:02, Valesca Kooijman wrote:
> In connection with your previous advice concerning the
> eeglab2fieldtrip script, we came accross the following problem and
> solution (see script below):
> ...
>
> I do still get the following warning after running the above script:
>
> Warning: writing segmented data as if it were continuous
> In fieldtrip-20070710\private\write_brainvision_eeg at 38
> In fieldtrip-20070710\private\write_data at 63
> In write_fcdc_data at 48
> In ConversionEEGDATA at 13
>
> Is this problematic or is this a standard warning following
> conversion to Vision Analyzer?

The warning relates to the problem that you indicated in your email
further down (i.e. the data being assumed to be ntrials X nchans X
nsamples). I.e. if your data is indeed ntrials X nchans X nsamples,
then you don't have to worry. In your case, you should worry (see
below).

> In addition, I was wondering where my trial onset markers are
> written to? Write_fcdc_data only generates a .eeg and a .hdr file,
> and not a .vmrk file.

They are not writen. You could manually write a vmrk file (they are
ascii files). The format is like the snippet below

Brain Vision Data Exchange Marker File, Version 1.0
[Common Infos]
DataFile=pp01_pilot_load0_3s.seg
[Marker Infos]
; Each entry: Mk<Marker number>=<Type>,<Description>,<Position in
data points>,
; <Size in data points>, <Channel number (0 = marker is related to
all channels)>,
; <Date (YYYYMMDDhhmmssuuuuuu)>
; Fields are delimited by commas, some fields might be omited (empty).
; Commas in type or description text are coded as "\1".
Mk1=New Segment,,1,1,0,20050315114252667836
...

> From your earlier emails I understood that the datamatrix should be
> converted to ntrials X nchans X nsamples before running
> write_fcdc_data.  Currently my datamatrix consists of nchans X
> nsamples X ntrials.  Would you mind letting me know how I can
> convert my datamatrix? Thanks a lot.

I just made a change to write_brainvision_eeg, please update to the
latest FT release. In that function it still expects the data to be
ntrials X nchans X nsamples, i.e.
    ntrl  = size(dat,1);
    nchan = size(dat,2);
    nsmp  = size(dat,3);
You can use the matlab function permute (see "help permute") to swap
the dimensions in EEG.data by permute(EEG.data, [3 1 2]).

Robert

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.



More information about the fieldtrip mailing list