Back to the main page.
Bug 932 - ft_freqstatistics fails on old input data (again)
Status | CLOSED FIXED |
Reported | 2011-09-05 11:43:00 +0200 |
Modified | 2012-12-31 11:46:23 +0100 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P1 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Robert Oostenveld - 2011-09-05 11:43:18 +0200
Yoni reported another problem at http://bugzilla.fcdonders.nl/show_bug.cgi?id=798#c19 which initially seemed a problem with ft_appendfreq (see bug #931) but which turned out to be a numerical accuracy problem. After discussing with JM, we decided that appendfreq and selectdata should not be calling each other and should not depend on each other. They both serve a clear and unique purpose. In this case ft_freqstatistics should not be calling appendfreq, but selectdata. I created a test script based on the input from Yoni, it includes the test data (from home/common)
Robert Oostenveld - 2011-09-05 11:44:03 +0200
(In reply to comment #0) > I created a test script based on the input from Yoni, it includes the test data > (from home/common) see fieldtrip/test/test_bug932.m
Robert Oostenveld - 2011-09-05 11:48:41 +0200
manzana> svn commit ft_freqstatistics.m ft_appendfreq.m utilities/ft_selectdata.m Sending ft_appendfreq.m Sending ft_freqstatistics.m Sending utilities/ft_selectdata.m Transmitting file data ... Committed revision 4101.
Yoni Levy - 2011-09-05 13:44:04 +0200
(In reply to comment #2) Thank you for having resolved the bug so rapidly. Could you please indicate the exact location (all relevant directories) of the test script that you created (you wrote 'fieldtrip/test/test_bug932.m')
Robert Oostenveld - 2011-09-05 15:53:42 +0200
(In reply to comment #3) the test scripts are not included in the fieldtrip release (neither in the zip/ftp release, nor in the fieldtrip version on home/common). The data for the test script is on home/common. You can see the test script itself on http://code.google.com/p/fieldtrip/source/browse/trunk/test/test_bug932.m
Robert Oostenveld - 2011-09-09 15:47:54 +0200
closed all of my bugs that were resolved
Robert Oostenveld - 2012-12-12 09:01:15 +0100
the regression test script test_bug932.m fails because of Error using ft_datatype_sens (line 164) inconsistent number of channels in sensor description Error in ft_datatype_freq (line 104) freq.grad = ft_datatype_sens(freq.grad); Error in ft_checkdata (line 204) data = ft_datatype_freq(data); Error in ft_freqstatistics (line 123) varargin{i} = ft_checkdata(varargin{i}, 'datatype', 'freq', 'feedback', 'no'); Error in test_bug932 (line 24) eval(['t_t_o_subj' num2str(tt) ' = ft_freqstatistics(cfg,LF_o,LF_t);']); this is due to sens = tra: [546x546 double] label: {546x1 cell} unit: 'cm' balance: [1x1 struct] type: 'ctf275_planar' coilori: [546x3 double] coilpos: [546x3 double] chanpos: [273x3 double] chanori: [273x3 double] chantype: {546x1 cell} chanunit: {546x1 cell} which has a chanpos and chanori that are inconsistent with the number of channels (546).
Robert Oostenveld - 2012-12-12 09:16:42 +0100
it can be reproduced with tt=5 and ft_datatype_sens(LF_o.grad) The problem is due to private/channelposition, which undoes the balancing of the planar channels. The result is axial positions being added to the ctf275_planar array.
Robert Oostenveld - 2012-12-12 09:37:55 +0100
(In reply to comment #7) roboos@mentat001> svn commit Sending utilities/ft_datatype_sens.m Transmitting file data . Committed revision 7144. The function now checks on the output labels that are returned by private/channelposition. If these are inconsistent with sens.label, it uses nan instead of the computed positions.
Robert Oostenveld - 2012-12-12 09:40:21 +0100
the commit in revision 7144 fixes the problem script. I have added ft_datatype_sens to the TEST list in the script, as this data provides a good example for testing that function. roboos@mentat001> svn commit test_bug932.m Sending test_bug932.m Transmitting file data . Committed revision 7146.