importing CTF data

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed May 11 17:54:34 CEST 2005


Hi Thomas

On 10 May 2005, at 11:57, Thomas Thesen wrote:
> When trying to use definetrial.m/preprocessing.m to load in the dataset
>
> cfg = [];
> cfg.dataset = 'sub12_SAM_a_C1_A1.ds';
> cfg.trialdef.eventtype = '?'
> cfg.trialdef.eventtype = 'C1_A1'
> cfg.trialdef.prestim   = 0;    % trial starts at time t=0 at the marker
> cfg.trialdef.poststim  = 0.5;  % trial ends at t=0.5 sec
>
> and adding the line:
>
> cfg.trialdef.excludeConditions = {'BAD'};
>
> and running:
> cfg = definetrial(cfg);
> raw = preprocessing(cfg);
>
> the trials marked 'BAD' are not excluded. However, when doing the same
> procedure on the FieldTrip workshop data set for example, where the
> trials
> are defined through a trigger, the marked trials are removed.

The fieldtrip tutorial that you refer to uses an old CTF-format
specific trialfunction that is not in the release version. This type of
"combinatorial" definition of events (include the trials with marker
C1_A1 and exclude the trials with classification BAD) is not supported
any more. Furthermore, the underlying code of that tutorial section
only worked for a trial-based file format without markers...

As you can see, it is quite difficult to combine all the different
types of information (trials, triggers, classifications, markers) and
especially sinc e every file format has it's own way of dealing with
them. Therefore I decided not to support all of them. There is a common
way of handling them all, and that is through using the read_fcdc_event
function, which results in a well-defined collection of all information
which you can to cut up your data into pieces of interest. Using the
event structure (i.e. the output from read_fcdc_event), you can create
your own trialfunction.

Please read the documentaion on read_fcdc_event, try it out on your
data, and then read the documentation in definetrial about the custom
trialfunction. A short example of a custom trialfunction was given in
the clusterstatistics tutorial.


> Do you have any suggestions on how to exclude 'BAD' trials before they
> are
> loaded? Or is my only option to remove these 'BAD' trials after they
> have
> been loaded into FieldTrip format? In that case would you advise to
> remove
> the appropriate columns (trials) by hand or rather use the artifact
> rejection option?

No, you should not remove them afterwards, but you should use the
custom trialfunction to prevent them from being read in the beginning.

Robert



More information about the fieldtrip mailing list