[FieldTrip] ft_timelockgrandaverage -- bug or as-designed?

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Tue Feb 11 17:24:24 CET 2014

Dear Alik,

Thanks for reporting this. To me it sounds indeed like a bug. It would be great if you could file this as such on our bugzilla bug-tracking system. www.bugzilla.fcdonders.nl. If you create yourself an account and file a new bug, with the contents of this e-mail, we can take it from there. If you already have a fixed version of the code, feel free to attach it as attachment to the bug ;-).

Best wishes,

On Feb 11, 2014, at 5:11 PM, Alik Widge wrote:

> I have encountered a behavior with ft_timelockgrandaverage that seems to me to be a bug, but I'm not quite sure. Hence why I am asking here and not just filing a bug. I'm using the attached .mat, and you can replicate the behavior with:
>         cfg = [];
>         cfg.channel = 'all';   
>         cfg.keepindividual = 'no';
>         cfg.method = 'within'; 
> out_data = ft_timelockgrandaverage(cfg,Dstruct.on.MSITOnset.global.x{:});
> This will crash due to an array dimension mismatch. It does so because my different subjects/blocks in x{:} have different numbers of samples. Up around line 147, the ft_ function goes through varargin{:} and cuts down the averaged variable (in my case, 'avg') so that it has the same number of samples in each of the varargin{:} data structures.
> The thing that I feel is a bug: it cuts the data, (expressed as  varargin{i}.(cfg.parameter) ), but it does NOT similarly cut the variance ( varargin{i}.var ) or the per-timepoint DOF ( varargin{i}.dof ). As a result, when it gets to line 193 and tries to do
>       avgmat(s, :, :) = varargin{s}.(cfg.parameter).*varargin{s}.dof;
> the (cfg.parameter) and dof matrices are now of different sizes, and we crash.
> I can add my desired behavior to a local copy of the function and keep working, but would appreciate some advice on whether this is actually a bug, or somehow a design feature that I've failed to understand.
> Alik Widge
> alik.widge at gmail.com
> (206) 866-5435
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jan-Mathijs Schoffelen, MD PhD 

Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands

Max Planck Institute for Psycholinguistics,
Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl
Telephone: +31-24-3614793


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140211/75335f62/attachment-0002.html>

More information about the fieldtrip mailing list