Back to the main page.

Bug 2563 - ft_selectdata (new version) cannot avgoverfreq using alternative parameter names

Status CLOSED FIXED
Reported 2014-05-07 10:02:00 +0200
Modified 2014-05-14 20:08:57 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2561

Craig Richter - 2014-05-07 10:02:36 +0200

When using an alternative name for a parameter, like MIspctrm for example, the field is not averaged. This warning is generated at line 169: Warning: could not determine dimord of "MIspctrm" in the following data > In utilities/private/getdimord at 335 In ft_selectdata at 164 In FT_MI_stats at 98 which seems to lead to the field not being averaged. Perhaps a cfg.parameter input may help.


Robert Oostenveld - 2014-05-07 14:58:36 +0200

Hi Craig, If I do this: ------------ nchan = 3; nfreq = 4; ntime = 5; freq = []; freq.MIspctrm = randn(nchan,nfreq,ntime); freq.freq = 1:nfreq; freq.time = 1:ntime; for i=1:nchan freq.label{i} = num2str(i); end cfg = []; cfg.avgoverfreq = 'yes' output = ft_selectdata(cfg, freq); assert(isequal(size(output.MIspctrm), [3 1 5])); disp(freq) disp(output) ------------ it just works fine. Can you provide more details as to the problem you encounter?


Robert Oostenveld - 2014-05-07 14:59:30 +0200

I added the test script mac011> svn commit test_bug2563.m Adding test_bug2563.m Transmitting file data . Committed revision 9470.


Craig Richter - 2014-05-07 15:26:20 +0200

Hi Robert, Try this one out, but maybe I'm breaking the rules with it: nchan = 3; nfreq = 4; subj = 5; freq = []; freq.dimord = 'subj_chan_freq'; freq.MIspctrm = randn(subj,nchan,nfreq); freq.freq = 1:nfreq; for i=1:nchan freq.label{i} = num2str(i); end cfg = []; cfg.avgoverfreq = 'yes' output = ft_selectdata(cfg, freq); assert(isequal(size(output.MIspctrm), [3 1 5])); disp(freq) disp(output)


Robert Oostenveld - 2014-05-07 15:45:21 +0200

(In reply to Craig Richter from comment #3) that gives me output = MIspctrm: [5x3x4 double] freq: 2.5000 label: {'1' '2' '3'} dimord: 'subj_chan_freq' cfg: [1x1 struct] which is indeed not what I'd want to see. I wonder whether this is related to bug #2561, which was reported yesterday.


Robert Oostenveld - 2014-05-07 16:14:00 +0200

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


Robert Oostenveld - 2014-05-07 16:19:58 +0200

The problem was due to data.dimord not being properly parsed. Although there was a piece of code that suggested that it would be used, in fact it did not use it. Consequently, the smart code further down in getdimord was relied upon, and that does not know anything about "subj" or other data fields (such as individual or MIspctrm). This commit should fix it. mac011> svn commit test/ utilities/ Sending test/test_bug2563.m Sending utilities/private/getdimord.m Transmitting file data .. Committed revision 9472.


Robert Oostenveld - 2014-05-14 20:08:57 +0200

closed several of my bugs that have been resolved