[FieldTrip] ft_singleplotER, ft_checkdata/raw2timelock and errors with negative timepoints

Daniel Stolzberg dstolzbe at uwo.ca
Mon Mar 18 19:18:11 CET 2013


Hello,

I have been working with continuous data trials which begin before the
trigger occurs (ex: [-0.25 1.0] sec) and have run into a snag when using
ft_singleplotER.  The error occurs in the raw2timelock subfunction of
ft_checkdata after calling ft_singleplotER with a time axis that includes
pre-trigger (i.e. < 0) time points.  This error may not be for
ft_singleplotER, but it is the function I was trying to use.

Here is the error:
> Subscripted assignment dimension mismatch.
>
> Error in ft_checkdata>raw2timelock (line 1753)
>     tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i};
>
> Error in ft_checkdata (line 302)
>         data = raw2timelock(data);
>
> Error in ft_singleplotER (line 186)
>   varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock',
'freq'});

After some debugging, I found that the number of samples used to
(re)generate the time vector is always 1 sample too small if there are
negative time values.  I assume that this is because the time point 0 is
not being considered (?).  By adding the following line to raw2timelock in
ft_checkdata of the most recent build, I was able to get around any errors
in this subfunction and all is now copacetic:

line 1740:    nsmp = nsmp + any(time<0); % <--- acounting for timepoint at
0?

I don't know if anyone else has run into this problem but I thought I would
share this with the community.

Regards,
Dan

-- 
Daniel Stolzberg, PhD
Post-doctoral Fellow
Cerebral Systems Laboratory
Department of Physiology and Pharmacology
Schulich School of Medicine & Dentistry
University of Western Ontario
http://www.cerebralsystems.ca/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130318/4c6a066e/attachment.html>


More information about the fieldtrip mailing list