Manually Importing data

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Fri Dec 23 11:27:01 CET 2005


Dear Michael

On 22-dec-2005, at 14:09, Michael Wibral wrote:

> /phase locking we'll have to 'fake' a Fieldtrip dataset at some
> point by assembling the corresponding structutre by hand. What's
> the better entry point for this:  before preproc (but then we'll
> have to make a trialfun etc.)  or after preproc (where the
> structure is already quite involved, at least it looks like that).
> If we try to mimic a preprocessed dataset, which of the fields are
> mandatory?

In your case it is much easier  to do it after preprocessing. The
output of the preprocessing function, which you have to mimic, is
   data.trial   = 1xNtrials cell-array, each containing Nchans X
Nsamples
   data.time    = 1xNtrials cell-array, each containing 1 X Nsamples
   data.fsample = number in Hz
   data.cfg     = []; this will do
   data.label   = Nchans X 1 cell-array with strings, e.g. {'Fp1',
'Fpz', ...}
I guess that most of this is straightforward. Since we support trials
of variable length, each trial has its own time axis. In most cases
with fixed-length trial data,  data.time{i} is the same for all i.

About electrode locations: you can add a data.elec field, but that is
optional. The elec structure contains
   elec.pnt   = Nelec X 3 matrix with carthesian xyz locations
   elec.label = Nelec x 1 cell array, see above.
Since not all datachannels have to be associated with an electrode
location (e.g. bipolar EMG channels or a force channel) and since not
all electrodes in an electrode cap have to be connected to the
amplifier, the electrode structure can contain a longer (or shorter)
list of positions and labels. Whenever needed (e.g. for topoplotting
or clusterrandanalysis), Fieldtrip will select and use the electrode
positions and physiological values that correspond in the data itself
and in the elec structure.

best wishes,
Robert





More information about the fieldtrip mailing list