[FieldTrip] structure of 'data' argument for ft_preprocessing

Eelke Spaak eelke.spaak at donders.ru.nl
Fri Jan 18 09:46:24 CET 2013

Dear Dave,

You are correct in assuming that label, time, and trial are the three
minimally required fields for a FT-style raw data structure. Label is
a cell array, because channel names can have varying lengths. Time and
trial are cell arrays, because also trials can have variable lengths.
Each element k in time should be a 1xN vector of time points
corresponding to the time axis of trial k. Each element k in trial
should be an MxN matrix corresponding to channels X timepoints. If
your data is structured like this, it should work. Note, though, that
FT uses 1xNumTrials cell arrays for time and trial, whereas you are
using NumTrialsx1. I don't know if this matters, but it might be worth
changing it around.

For more details, you might want to have a look at

Hope this helps!


On 18 January 2013 05:20, Dave Britton <dave at davebritton.com> wrote:
> What is the structure required for the 'data' argument to
> "function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data): "?
> I am not getting meaningful results from passing the output of
> [data]=ft_preprocessing(cfg, data) into rejectvisual_trial(data). All that
> appears in the resulting figure is the names of the channels, with no graphs
> of trial epochs appearing below them as it should be.
> What ft_preprocessing returns is:
> data =
>          label: {128x1 cell}
>           time: {132x1 cell}
>          trial: {132x1 cell}
>        fsample: NaN
>            cfg: [1x1 struct]
>     sampleinfo: [132x2 double]
> where I have 128 electrodes and 132 trials of 238 samples each. When this is
> passed to ft_rejectvisual(cfg,data) a figure appears that shows the labels
> of the 128 electrodes, but there is no graph under each label showing the
> EEG data.
> What I am passing into ft_preprocessing may be incorrectly structured, I
> suspect. This is
> data =
>     label: {128x1 cell}
>      time: {132x1 cell}
>     trial: {132x1 cell}
> (specifically, why are these all cells instead of arrays?  What is the
> structure of data.time, and of data.trial?)
> where label is the cell array of strings of electrode names, time is a cell
> array of the 132 trials' starting times in the .cnt EEG data file, and trial
> is a cell array containing the 132 cell arrays of the corresponding {128 x
> 283} EEG samples.
> Where am I going wrong? What does ft_rejectvisual(data) expect to have as
> the structure for "data"?
> -Dave
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

More information about the fieldtrip mailing list