Back to the main page.

Bug 206 - ensure consistent use ouf cfg.previous

Status CLOSED FIXED
Reported 2010-11-10 10:04:00 +0100
Modified 2010-12-02 17:24:29 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2010-11-10 10:04:10 +0100

I noticed that in ft_rejectcomponent.m" line 161 the code currently reads if nargin==2 || nargin < 2 % remember the configuration details of the input data try, cfg.previous = comp.cfg; end elseif nargin==3, try, cfg.previous{2} = comp.cfg; end try, cfg.previous{1} = data.cfg; end %the configuration of the data is relatively more important %potential use of ft_findcfg in subsequent analysis steps looks into %the previous{1} first end There should be a consistent use of cfg.previous and therefore the order of cfg.previous always has to be consistent with the inputs. TODO: it should be checked why this comment was made and by whom, and the underlying reason for the flipped ordering of the previous cfgs has to be resolved. If there is no reason for it any more (*), then it should be fixed in rejectcomponent and potentially other functions that have the same bug. (*) which I expect: because of the recent implementation of sampleinfo, findcfg should not be used any more


Jan-Mathijs Schoffelen - 2010-12-02 17:24:14 +0100

this has now been reverted in ft_rejectcomponent, because it has become obsolete with the new trialinfo etc. I checked the rest of fieldtrip (main) by grepping in varargin and checking whether the cfg.previous was correctly assigned. This is now consistent throughout fieldtrip main