[FieldTrip] Errors with downsampling and artifact rejection

Gaëlle Leys gaelle.leys at kuleuven.be
Fri Jun 19 14:48:26 CEST 2020


Dear Fieldtrip community,

I have recently started with Fieldtrip for my EEG data processing and I am encountering some problems which I can't seem to resolve.
I'm working with mff files from an EGI EEG system. I have no problem reading in and preprocessing the data. However, when trying to downsample and setup the automatic artifact removal, I'm getting some errors.


1)      When trying to downsample with the default options, these are the errors that I get:
Error using resample>getSamples (line 357)
The number of elements of Tx must match the number of rows of X when X is a matrix

Error in resample>nonUniformResample (line 123)
[x, tx] = getSamples(varargin{1:2});

Error in resample (line 116)
  [varargout{1:max(1,nargout)}] = nonUniformResample(method,varargin{:});

Error in ft_resampledata (line 228)
        newdat = transpose(resample(transpose(olddat),fsres,fsorig));

                I have tried downsampling before filtering, after filtering, on continuous data, or already segmented data. None of these things seem to resolve the error.


2)      When trying to set up the automatic artifact removal process and choosing yes for the interactive plot, I get a plotting error:

Error using plot

Vectors must be the same length.



Error in ft_artifact_zvalue>redraw_cb (line 973)

    plot(opt.h1, xval, yval, 'linestyle', '-', 'color', 'b', 'displayname', 'data');



Error in ft_artifact_zvalue (line 512)

  redraw_cb(h);

        I've noticed that the xval and yval are different numbers, which of course doesn't allow plotting. It seems like the xval changes according to the epoch length, however the yval remains the same and equals the amount of samples in my continuous data.


3)      When choosing no for the interactive plot, I also get an error:
Error using zeros
Size inputs must be integers.

Error in ft_artifact_zvalue (line 568)
dum = zeros(1,max(opt.trl(:,2)));

I've been looking into the functions and where it goes wrong, but I can't seem to pinpoint what exactly is causing these issues. Anyone here that can help or provide me some tips?

Thanks in advance!

Kind regards,

Gaëlle Leys

Research Associate
Brain & Cognition
Tiensestraat 102 box 3714
3000 Leuven
Room PSI 02.33
tel. +32 16 37 61 98

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200619/e7e1bde8/attachment.htm>


More information about the fieldtrip mailing list