[FieldTrip] processing ANT cnt files with FieldTrip

Dave Britton dave at davebritton.com
Tue Dec 18 17:59:41 CET 2012

I am trying to process EEG data in .cnt files obtained from the ANT 
system. I am using a Linux Xubuntu 12.04 amd64 operating system. I have 
installed the Linux 64 bit version of FieldTrip.

What is required to successfully process ANT eeg .cnt and .trg files? 
The libraries that came with the FieldTrip download did not work as it 
came from the download, and my investigations led me to what should be 
the latest version of the ANT import library. I have downloaded the 
latest ANT eep library, anteepimport1.09/libeep-3.3.167, and run config, 
make and make install, successfully, but MATLAB cannot find the shared 
object file it should generate, even when I link the .so.3 file into the 
same directory as the MATLAB m-file and the MATLAB current directory.

Initially the system was unable to read the cnt files, which is why I 
attempted to reinstall the anteepimort library. Is there more to this 
installation than the standard" configure, make, make install" process? 
Any clues would be appreciated!

Dave Britton
City College of New York
Psychology Dept.

Here is the error message I get:

 >> cfg.headerfile = 
 >> cfg.hdr = ft_read_header(cfg.headerfile);
Invalid MEX-file
libeep.so.3: cannot open shared object file: No such file or directory

Error in ft_read_header (line 627)
hdr = read_eep_cnt(filename, 1, 1);

Previous efforts before recompiling libeep produced failures that seemed 
to indicate the read_eep_cnt routine was incorrectly assessing the cnt 
file size and obtaining garbage, which is why I attempted to rebuild the 
eepimport library:
===== error messages ====
 >> clear;
% required items for cfg:
flank1 = 'FLANK1'; % markersA in tutorial walkthru
flank2 = 'FLANK2';
target = 'TARGET';
cfg.trialdef.prestim = 0.05; % 50 ms baseline
cfg.trialdef.poststim = 0.5; % trials last 500 ms
cfg.trialdef.eventtype = 'input';
cfg.trialdef.eventalue = target;
cfg.dataset = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt';
cfg.headerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.cnt';
cfg.triggerfile = '/home/dave/semanticflanker/data/ANT/20121114_1013.trg';
cfg.trialfun = 'trialfun_semattn';
cfg.padding = 2;
cfg.dataformat = 'ns_cnt32'; % see faq about reading Neuroscan cnt files
cfg.headerformat = 'ns_cnt32';
cfg.eventformat = 'ns_cnt32';
cfg.blockread = 1;
cfg = ft_definetrial(cfg);
evaluating trialfunction 'trialfun_semattn'
Warning: could not determine channel type from the CTF header
 > In ft_chantype at 213
In ft_read_header at 1711
In trialfun_semattn at 5
In ft_definetrial at 162
Warning: could not determine channel type from the CTF header
 > In ft_chantype at 213
In ft_read_header at 1711
In ft_read_event at 600
In trialfun_semattn at 6
In ft_definetrial at 162
found 407 events
created 132 trials
the call to "ft_definetrial" took 4 seconds and required the additional 
allocation of an estimated 13 MB
Loading file /home/dave/semanticflanker/data/ANT/20121114_1013.cnt ...
Reading data .....
Scaling data .....
Reading Event Table...
Skipping event table (tag != 1,2,3 ; theoritically impossible)
Warning: channel labels should not be empty, creating unique labels
 > In ft_read_header at 1684
In ft_preprocessing at 343
In semattn_main at 34
processing channel { '�`RXqwh��' ............(channel data is garbage)....

===== end of error messages===

More information about the fieldtrip mailing list