[FieldTrip] Problem using ft_preprocessing to segment .cnt files

Ines Bramao ines.bramao at psy.lu.se
Thu Oct 23 16:02:39 CEST 2014

Hi all,

When I am using ft_preprocessing to segment the data from the continuous eeg .cnt file I get segments that are exactly the same. That is, pieces of the data that correspond to different trials and that are exactly the same! I don’t really know if I am doing something wrong or if there is a problem in the interaction of the ft_preprocessing and the loadcnt function!!!! I am not new using fieldtrip, but I am new with .cnt files.

I have been checking and trying different things:

1) My trl matrix seems to be properly defined;
2) When I use curry or eeglab to segment the data I don’t get this weird repeated segments;
3) Extracting the original data using ft_read_data and looking into the values that correspond to the samples of the repeated segments show that the original data of those segments is different!
4) Importantly, while I am extracting the segments from the data using ft_preprocessing I get a warning message “events imported with a time shift might be innacurate”… (this do not happen with eeglab and the function for loading .cnt files is apparently the same);
5) This is not a problem of only one participant and one of my colleagues is experiencing exactly the same problem.

Here is the configuration that I am using to run ft_preprocessing

cfg =

      dataset: 'D:\Subj01\1-OriginalData\Subj01.cnt'
      dataformat: 'ns_cnt32'
      headerformat: 'ns_cnt32'
      eventformat: 'ns_cnt32'
      demean: 'yes'
      baselinewindow: [0 0.2000]
      reref: 'yes'
      refchannel: {'A1'  'A2'}
      implicitref: {'A1'}
      channel: {'all'  '-A1'  '-TP9'  '-TP10'  '-FT10'  '-FT9'  '-Trigger'}
      trl: [312x5 double]

Using this code on the output of the preprocessing shows me that trials 12, 85, 86, 87 and 89 are exactly the same!!!!!

repeatedtrials =[];
for i = 1:length(PreProcArtifact_cue.trial)
    for j = 1:length(PreProcArtifact_cue.trial)
        if PreProcArtifact_cue.trial{i} == PreProcArtifact_cue.trial{j}
            if i ~= j
                repeatedtrials(1+end,:) = [i j];

I uploaded my original data file, my trl matrix and the output of the preprocessing here: https://www.dropbox.com/sh/k2nmg50le34v8a0/AAB6odjOx8wnRz10FdG4YlyXa?dl=0

Please can someone check if I am doing something wrong in order to get exactly the same segment in a different sample interval after using ft_preprocessing? It has been really frustrating to try to figure out what can be wrong and I am starting to believe that there is a problem in ft_preprocessing while segmenting .cnt files? Can this be the case????

Thank you very very much!
Inês Bramão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141023/a51a189f/attachment-0001.html>

More information about the fieldtrip mailing list