problem reading old CTF data

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed Oct 1 12:42:40 CEST 2008

Hi Barbara (CC fieldtrip list)

The problem that you have with your CTF dataset is due to a bug in the
dataset itself. Since other people might encounter the same problem,
I'll forward the information to the FT mailing list as well.

The dataset that you are trying to read has a bug in the
headcoordinates (*.hc) file. The 5th line in the file is
   stadard left ear coil position relative to dewar (cm):
but should be
   standard left ear coil position relative to dewar (cm):
Note the missing "n" in the buggy headcoordinates file.

In the previous reading routines (read_ctf_hc, see line 182) that bug
was known and the code explicitely tested for that bug. In the new
reading routines (i.e. the ones supplied to us by CTF to handle
synthetic gradients) that bug in the HC file causes a problem.

The only solution for now that I can think of is to edit the HC file
(in a text editor) and to fix the typo by adding the "n" to "stadard".

best regards,

On 30 Sep 2008, at 18:42, Barbara Haendel wrote:

> I'm not sure what happened but I can't read in my old files anymore
> (something which already had worked about two weeks go). I also
> can't make much sense out of the error message (see below). The
> problem seems to be that FT can't read the trial definition because
> cfg.trialdef.eventtype = '?'; does not give any event information
> anymore. Could it be that something has changed lately since it was
> already working before?
> It would be great if you could help me,
> Thanks,
> Barbara
> cfg=[];
>    cfg.dataset='AxLiPERCEPT390405.ds';
>    cfg.continuous = 'no';
>    cfg.trialdef.eventtype = 'trial';
>    cfg = definetrial(cfg);
> evaluating trialfunction 'trialfun_general'
> readCTFds: You are reading CTF data for use with a software-
> application tool
> 	that is not manufactured by VSM MedTech Ltd. and has not received
> marketing
> 	clearance for clinical applications.  If CTF MEG data are processed
> by this tool,
> 	they should not be later employed for clinical and/or diagnostic
> purposes.
> readCPersist: Stop strings (EndOfParameters) do not balance start
> strings (WS1_).
>              (No. of start strings)-(No. of stop strings)=1.
> ??? Index exceeds matrix dimensions.
> Error in ==> /home/common/matlab/fieldtrip/external/ctf/
> readCTFds.p>readHc at 599
> Error in ==> /home/common/matlab/fieldtrip/external/ctf/
> readCTFds.p>readCTFds at 203

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