Back to the main page.

Bug 1348 - ft_read_header error while reading .cnt file in version 20120222

Status CLOSED FIXED
Reported 2012-02-28 19:53:00 +0100
Modified 2012-04-11 16:48:32 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: Macintosh
Operating System: Mac OS
Importance: P3 minor
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks: 1359
See also:

Anahita Mehta - 2012-02-28 19:53:06 +0100

Created attachment 233 matlab script to read .cnt file a recurrent error occurs when i try to use the attached script to read in EEG data in the form of a .cnt file (neuroscan). the error is as follows: Error in ft_read_header (line 1361) hdr.nSamples = orig.header.nums; the script works fine in an older version fieldtrip-20111029.


Robert Oostenveld - 2012-02-28 23:01:23 +0100

I suspect this to be related to the recent change to the low-level loadcnt in #1311 Could you upload a cnt test file (if possible a small one) that has the problem? See http://fieldtrip.fcdonders.nl/contact for large-file upload instructions.


Anahita Mehta - 2012-02-29 13:14:04 +0100

(In reply to comment #1) there is a (relatively) small .cnt file in the dropbox link below: http://dl.dropbox.com/u/15215625/E3a.cnt.zip thank you


Robert Oostenveld - 2012-03-02 17:08:42 +0100

Thanks. I added the file the test repository and made a test script. I am able to reproduce the problem: ============================================ >> filename = '/home/common/matlab/fieldtrip/data/test/bug1348/E3a.cnt'; >> hdr = ft_read_header(filename); Loading file /home/common/matlab/fieldtrip/data/test/bug1348/E3a.cnt ... r = ldnsamples: 1 t1: 0 sample1: [] lddur: [] scale: 'on' blockread: [] dataformat: 'int32' memmapfile: '' Reading data ..... Scaling data ..... Reading Event Table... ??? Reference to non-existent field 'nums'. Error in ==> ft_read_header at 1361 hdr.nSamples = orig.header.nums; ============================================ After a small change (nums->numsamples) it again seems to work. >> hdr = ft_read_header(filename); Loading file /home/common/matlab/fieldtrip/data/test/bug1348/E3a.cnt ... r = ldnsamples: 1 t1: 0 sample1: [] lddur: [] scale: 'on' blockread: [] dataformat: 'int32' memmapfile: '' Reading data ..... Scaling data ..... Reading Event Table... >> hdr hdr = Fs: 1000 nChans: 38 nSamples: 625120 nSamplesPre: 0 nTrials: 1 label: {38x1 cell} orig: [1x1 struct] chantype: {38x1 cell} chanunit: {38x1 cell} ============================================ also in ft_databroswer the EEG data in the file looks fine.


Robert Oostenveld - 2012-03-02 17:09:28 +0100

bugfix - resolved a problem with the number of samples in a neuroscan cnt file, also added ";" to the end of a line in loadcnt and added a test script. See http://bugzilla.fcdonders.nl/show_bug.cgi?id=1348 --This line, and those below, will be ignored-- M fileio/ft_read_header.m M fileio/private/loadcnt.m AM test/test_bug1348.m manzana> svn commit fileio/ft_read_*m fileio/private/loadcnt.m test/test_bug1348.m Sending fileio/ft_read_header.m Sending fileio/private/loadcnt.m Adding test/test_bug1348.m Transmitting file data ... Committed revision 5380. The fixed version will be included in the fieldtrip release this evening.


Robert Oostenveld - 2012-04-11 16:48:32 +0200

I cleaned up my bugzilla list by changing the status from resolved (either fixed or wontfix) into closed. If you don't agree, please reopen the bug. Robert