[FieldTrip] Possible BUG in ft_redefinetrial using the cfg.trl option

andrea brovelli andrea.brovelli at univ-amu.fr
Fri Mar 20 15:14:29 CET 2015


Dear all,

The bugzilla server seems to be down for maintenance. So I post it here.

I noticed a possible bug in ft_redefinetrial: if I realign my data on a different event using the cfg.trl option, the output data is corretly aligned, BUT the output data structure contains ONLY the first trial of the input data structure, repeated for the exact number of trials.

% In other words, if you do this...
cfg      = [];
cfg.trl  = trl; % N x 3 matrix = [ sample_start sample_end sample_offset ]
data_out = ft_redefinetrial(cfg, data_in);

% And then plot the first 3 trials for the first channel....
plot(data_out.time{1},data_out.trial{1}(1,:),'b')
hold on
plot(data_out.time{2},data_out.trial{2}(1,:),'r')
plot(data_out.time{3},data_out.trial{3}(1,:),'k')

... you will notice that you are plotting the first trial in the original data_in but shifted in time.

Could you also check please ?

I used the latest version of Fieldtrip fieldtrip-20150318

Thanks 

Andrea



More information about the fieldtrip mailing list