issue with read_ctf_res4.m: use of uinit8 and char in fread

Erick Britis Ortiz Erick.Ortiz at MED.UNI-TUEBINGEN.DE
Mon Jul 21 20:06:19 CEST 2008

Dear Robert and all Fieldtrip users,

I've encountered an issue with read_ctf_res4.m, that causes unexpected
behavior in some operations. For instance, when I tried to check events
from a dataset:

cfg = []; = {'MEG'};
cfg.dataset = dataset;
cfg.trialdef.eventtype = '?';
cfg = definetrial(cfg);
evaluating trialfunction 'trialfun_general'
no events were found in the datafile
no trials have been defined yet, see DEFINETRIAL for further help
found 0 events
created 0 trials

In fact, there are 1260 events in this dataset.

I think that this problem is due to a change in fread's behaviour: as
nowadays characters are not always 8-bit wide, we are supposed to use
'uint8' instead of 'char'. This change has been responsible for some
nasty problems, including this one.

As of 20080720 version of Fieldtrip, the snapshot still showed this
behavior. Herewith I am attaching a correction of read_ctf_res4.m. Hope
that some of you who have had similar problem might find it helpful.

Best regards,

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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: read_ctf_res4.m
URL: <>

More information about the fieldtrip mailing list