[FieldTrip] some of the requested samples occur twice

"Jörn M. Horschig" jm.horschig at donders.ru.nl
Mon Jun 3 11:30:34 CEST 2013

Hi Robin,

it's not a bug that ft_fetch_data is not allowing for overlap. The 
function needs to be generic and eventually allow for fetching data 
extending over several trial segments. However, what should be the way 
to fetch  data that occurs twice, i.e. at the end of one trial and the 
beginning of another? If you have data with overlapping samples, it is 
not straight forward to define data from one trial as to be fetched and 
ignore the other. Since preprocessing options like filters are applied 
per trial segment, data will differ between trial segments if it 
overlaps. As there are a multitude of possibilities to deal with this 
and none of them is perfect (imho neither of them can even be called 
good), we decided to not allow for that.

For your problem, however, imho you can define negative trial padding in 
the function call to ft_artifact_zvalue, which should effectively pad. 
Have you tried this rather than padding manually?


On 5/31/2013 6:14 PM, Robin wrote:
> I have a problem in preprocessing where I am getting this error:
> """
> some of the requested samples occur twice in the data
> Error in ft_artifact_zvalue (line 262)
>        dat{trlop} = ft_fetch_data(data,        'header', hdr, 'begsample',
>        trl(trlop,1)-fltpadding, 'endsample', trl(trlop,2)+fltpadding,
>        'chanindx', sgnind, 'checkboundary', strcmp(cfg.continuous,'no
> Error in ft_artifact_muscle (line 158)
>      [tmpcfg, artifact] = ft_artifact_zvalue(tmpcfg, data);
> """
> I think this is because I am manually adding some extra padding to the
> trials so that the artifact filtering can use that padding (I am doing
> the artifact filtering on data in memory which is output from
> ft_denoise_pca). So in this case it is not a problem if consecutive
> trials overlap a bit.
> I would therefore like to disable this error and wondered what is the
> best way to do it. I am a bit confused because ft_artifact_zvalue
> calls ft_fetch data with a "checkboundary" option which looks like it
> might be what I want (and set correctly), but ft_fetch_data doesn't
> seem to use that option. Instead it has an allowoverlap option.
> So for now I will manually add the allowoverlap option to the call in
> ft_artifact_zvalue, but I wondered what checkboundary doesn't appear
> in ft_fetch_data or if this might be a bug.
> Cheers
> Robin
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group
FieldTrip Development Team

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

E-Mail: jm.horschig at donders.ru.nl
Tel:    +31-(0)24-36-68493
Web: http://www.ru.nl/donders

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands

More information about the fieldtrip mailing list