Back to the main page.
Bug 1922 - extend and test functionality of ft_timelockgrandaverage
Status | CLOSED FIXED |
Reported | 2013-01-09 10:55:00 +0100 |
Modified | 2013-02-23 20:56:48 +0100 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P3 normal |
Assigned to: | Jan-Mathijs Schoffelen |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Jan-Mathijs Schoffelen - 2013-01-09 10:55:13 +0100
Extend ft_timelockgrandaverage with functionality suggested by Burkhard: i.e. do a weighted average across input arguments (weighted with the dof). Most of the changes are in place now, the following still needs to be done: -consider explicitly checking the equality of the grad/elec-structures across inputs in the cfg.method='within' case. This could be done with the isequalwithequalnans function -consider averaging across grad/elec-structures in the cfg.method = 'across' case. This could be done with the function ft_average_sens -write a test script. Burkhard could upload the files to this bug, so that I will strip them of the superfluous information (minimize the size), and upload them to our test-data directory. Also we should think of assessing the results without graphics, because the tests need to be ran with as little user interaction as possible. Probably it is worthwile to explore the possibility to compare the output with the output of ft_timelockanalysis; this could also be done with dummy data, e.g: data = []; data.trial = {1 1 1 1 2 2 2 3 3}; data.time = {1 1 1 1 1 1 1 1 1}; data.label = {'chan01'}; data.fsample = 1; % just to be safe tlck = ft_timelockanalysis([], data); cfg = []; cfg.trials = 1:4; tlck1 = ft_timelockanalysis(cfg, data); cfg.trials = 5:7; tlck2 = ft_timelockanalysis(cfg, data); cfg.trials = 8:9; tlck3 = ft_timelockanalysis(cfg, data); cfg = []; cfg.method = 'within'; tlckall = ft_timelockgrandaverage(cfg, tlck1, tlck2, tlck3); var does not look right yet ;-)
Jan-Mathijs Schoffelen - 2013-01-09 10:56:29 +0100
bash-4.1$ svn diff ft_timelockgrandaverage.m Index: ft_timelockgrandaverage.m =================================================================== --- ft_timelockgrandaverage.m (revision 7284) +++ ft_timelockgrandaverage.m (working copy) @@ -135,8 +135,8 @@ % pick the selections for i=1:Nsubj - if ~isfield(varargin{i}, cfg.parameter{1}) - error('the field %s is not present in data structure %d', cfg.parameter{1}, i); + if ~isfield(varargin{i}, cfg.parameter) + error('the field %s is not present in data structure %d', cfg.parameter, i); end chansel = match_str(varargin{i}.label, cfg.channel); varargin{i}.label = varargin{i}.label(chansel); @@ -163,7 +163,7 @@ % determine the size of the data to be averaged %dim = cell(1,numel(cfg.parameter)); -dim{1} = size(varargin{1}.(cfg.parameter{1})); +dim{1} = size(varargin{1}.(cfg.parameter)); % give some feedback on the screen if strcmp(cfg.keepindividual, 'no') bash-4.1$ svn commit -m "bugfix - removed some remaining cell-indexed cfg.parameter calls" ft_timelockgrandaverage.m Sending ft_timelockgrandaverage.m Transmitting file data . Committed revision 7285.