trialdef with bdf files

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Tue Mar 25 12:57:13 CET 2008

Hi Erin,

The DEFINETRIAL function is used to determine which segments of the
data are of interest. Only the segments of interest ("trials") are
read from the file and preprocessed using the PREPROCESING function.
In your case theer are trials defined for the cnt, but not for the
bdf file.

The preferred approach for using DEFINETRIAL is to supply it with
your own "trialfun" (cfg.trialfun=name_of_your_function, see the
documentation on the website). If you do not specify cfg.trialfun, a
default trialfun will be used. There are different defaults for the
different file formats. Your problem seems to be related to the
trialfun for neuroscan ctf having more appropriate defaults that the
trialfun for biosemi bdf.

I suggest that you explicitely write your own trialfun, using
read_fcdc_event. See

best regards,

On 24 Mar 2008, at 21:21, Erin Oakman wrote:
> hi,
> The filename of my data is 'vv(P)-gamma-aod_20.bdf'
> When using bdf files, and the trialdef function, I received this
> message.
>  process " vv(P)-gamma-aod_20.bdf " evaluating trialfunction
> 'trialfun_general'
> ??? Error using ==> definetrial at 193
> no trials were defined, see DEFINETRIAL for help
> If I read 'vv(P)-gamma-aod_20.cnt' files into the same script,
> there is no
> conflict.

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 and

More information about the fieldtrip mailing list