Back to the main page.

Bug 3441 - Duplicate trials when reading neuroscan CNT files

Status UNCONFIRMED
Reported 2018-08-06 23:13:00 +0200
Modified 2018-08-09 21:03:19 +0200
Product: FieldTrip
Component: external
Version: unspecified
Hardware: All
Operating System: All
Importance: P5 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2746

- 2018-08-06 23:13:50 +0200

Hello, I'm having some issues reading neuroscan .cnt files - random trials seem to be duplicates of one another. This is not happening for all files, but has happened seemingly randomly to me and other members of my lab. I'm including a link to a .cnt file (sorry that the file is so large, but I want to include the raw data) and a sample script with the preprocessing that causes the error to pop up. I'll also include a preprocessed file if you don't want to have to rerun the script. In this file it is the 111th and 113th trial that are duplicates. One thing I noticed is that the duplicate trials seem to all display the same error message - "Numeric accuracy issue with the first sample: Rounding off to the nearest integer value". I believe this is coming from loadcnt. I found a previous bug where this seemed to be an issue, but it is labelled as fixed - http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2746 Let me know if there is anything else I can supply - thank you! raw cnt file - https://www.dropbox.com/s/eja8usmlm9x0167/mle_pilot.cnt?dl=0 preprocessed file - https://www.dropbox.com/s/y39rhem12hpk7hj/preproc_odd.mat?dl=0


- 2018-08-06 23:14:25 +0200

Created attachment 868 test script


- 2018-08-06 23:18:24 +0200

macOS High Sierra (but my labmate using Windows 10 also has this error) Both computers 64-bit. Matlab v R2017a, 64-bit


Robert Oostenveld - 2018-08-09 19:42:32 +0200

Hi, Thanks for sharing the file and test script, that makes debugging efficient! You mention the error message "Numeric accuracy issue with the first sample: Rounding off to the nearest integer value", but I presume it is a warning, right? If it is an error, it would not continue. I don't get this error, but do get "Warning: events imported with a time shift might be innacurate" I also get the warning "Warning: use cfg.demean instead of cfg.blc" which might indicate that you are using an old version of fieldtrip (cfg.blc is really old). and with your test script I get >> isequal(preproc_odd.trial{1,111},preproc_odd.trial{1,113}) ans = logical 0 so they are not the same. Also when I plot the two trials they are very different. Right now I suspect your error to be due to you using an old FieldTrip version, or possibly a new FT version but with an old EEGLAB version also on the path (so that the newer fieldtrip/external/eeglab is not used). Please check with the latest FT version. best, Robert PS1 I tested with 2017b on High Sierra, so almost the same. PS2 Note that this might be an eeglab issue rather than a FieldTrip issue, since it uses external/eeglab code. If that is the case, it is to be solved in eeglab and the updated code should be added to FieldTrip.


Robert Oostenveld - 2018-08-09 19:44:40 +0200

Oh, you may also want to check out https://sccn.ucsd.edu/bugzilla/buglist.cgi?quicksearch=cnt and perhaps check whether the loadcnt in the latest EEGLAB is the same as the loadcnt in the latest FieldTrip. If they are not the same, it should be resolved on either one of the two sides.


Robert Oostenveld - 2018-08-09 19:54:05 +0200

I added the test script and test file to our nightly test batch. mac011> git commit -a [bug3441 bf302c056] ENH - added test script according to http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3441 1 file changed, 42 insertions(+) create mode 100644 test/test_bug3441.m Merged with https://github.com/fieldtrip/fieldtrip/pull/766


- 2018-08-09 21:03:19 +0200

Hi, Thanks for the quick reply! I took another look, and you are completely right about the issue being with EEGLAB. If I run the script after freshly opening matlab, I don't see the duplicates. If I open EEGLAB and run it again, I do see the duplicates as it switches to the EEGLAB version of loadcnt. I had made sure to update to the newest fieldtrip before testing this, but I hadn't checked EEGLAB. I'll try updating my EEGLAB to see if the issue is fixed now. Either way, I can just be sure the paths are correct when running this step. -Michael