Back to the main page.

Bug 851 - freqstatistics has a problem with singular dimensions in freq field?

Status CLOSED WONTFIX
Reported 2011-07-29 11:50:00 +0200
Modified 2013-10-26 18:15:56 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks: 1021
See also:

Stephen Whitmarsh - 2011-07-29 11:50:28 +0200

Created attachment 110 mn workspace % create the 'dat' matrix here dat = data.(cfg.parameter); siz = size(dat); dimtok = tokenize(data.dimord, '_'); rptdim = find(ismember(dimtok, {'rpt' 'subj'})); permutevec = [setdiff(1:numel(siz), rptdim) rptdim]; % permutation vector to put the repetition dimension as last dimension reshapevec = [prod(siz(permutevec(1:end-1))) siz(rptdim)]; % reshape vector to reshape into 2D dat = reshape(permute(dat, permutevec), reshapevec);% actually reshape the data reduceddim = setdiff(1:numel(siz), rptdim); cfg.dim = [siz(reduceddim) 1]; % store dimensions of the output of the statistics function in the cfg cfg.dimord = ''; for k = 1:numel(reduceddim) cfg.dimord = [cfg.dimord, '_', dimtok{reduceddim(k)}]; end cfg.dimord = cfg.dimord(2:end); % store the dimord of the output in the cfg if size(cfg.design,2)~=size(dat,2) error('the number of observations in the design does not match the number of observations in the data'); end ??? Error using ==> reshape Size vector must have at least two elements. Error in ==> ft_freqstatistics at 246 dat = reshape(permute(dat, permutevec), reshapevec);% actually reshape the data


Jan-Mathijs Schoffelen - 2011-07-29 12:26:27 +0200

ft_selectdata is not robust agains small numeric inaccuracies in the .time or .freq field, leading to incorrect concatenation. Suggestion: use ft_appendfreq and implement it such that tolerance agains inaccuracies is ensured. also remove the functionality of appending from selectdata also use explicit key-value pairs in ft_appendfreq to specify the dimension over which concatenation is required.


Jan-Mathijs Schoffelen - 2011-09-22 20:02:01 +0200

*** Bug 846 has been marked as a duplicate of this bug. ***


Jan-Mathijs Schoffelen - 2011-11-10 14:38:57 +0100

I can reproduce the error message, but that's due to the variable 'data' being not a correct input for ft_freqstatistics. There is no repetition dimension. So this is a 'wontfix'


Robert Oostenveld - 2011-11-11 11:19:45 +0100

I closed all bugs that were recently resolved.