Back to the main page.

Bug 1343 - Problem in ft_denoise_pca when the 'pertrial' option is set to 'yes'

Status CLOSED FIXED
Reported 2012-02-24 15:06:00 +0100
Modified 2012-04-02 16:26:22 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Panagiotis Tsiatsis - 2012-02-24 15:06:30 +0100

I think there might be a bug with ft_denoise_pca when the option cfg.pertrial is set to 'yes' (which as far as I understand is more thorough as an option than 'no'). More precisely, I am trying to apply it on my CTF-275 MEG data that I have already preprocessed up to a point with SPM, but I am getting the following error Error using ft_checkdata (line 307) This function requires raw data as input. Error in ft_appenddata (line 71) varargin{i} = ft_checkdata(varargin{i}, 'datatype', 'raw', 'feedback', 'no', 'hassampleinfo', 'yes'); Error in ft_denoise_pca (line 88) data = ft_appenddata([], tmp{:}); I did not have the time to thoroughly test it but the problem seems to lie in those lines in ft_denoise_pca if strcmp(cfg.pertrial, 'yes'), tmpcfg = cfg; tmpcfg.pertrial = 'no'; tmp = cell(numel(varargin{1}.trial)); %****** this line seems to be the problem for k = 1:numel(varargin{1}.trial) tmpcfg.trials = k; tmp{k,1} = ft_denoise_pca(tmpcfg, varargin{:}); end data = ft_appenddata([], tmp{:}); return; end and more specifically in the line tmp = cell(numel(varargin{1}.trial)); which I have substituted with tmp = cell(numel(varargin{1}.trial) , 1); and it seems to be working but since I did not go through the whole code I felt insecure to just patch the code by myself and I thought to ask you first. I would be grateful if you could take a look on that.


Jan-Mathijs Schoffelen - 2012-02-24 15:51:50 +0100

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


Jan-Mathijs Schoffelen - 2012-02-26 14:48:24 +0100

Error confirmed. Typo in the allocation of the cell-array 'tmp'. Fixed according to the suggestion of Panagiotis (Thanks!). Fixed in revision 5318