Back to the main page.

Bug 2613 - ft_freqanalysis inconvenience with comp+raw

Status CLOSED FIXED
Reported 2014-06-18 10:02:00 +0200
Modified 2014-07-15 17:25:11 +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:

Robert Oostenveld - 2014-06-18 10:02:50 +0200

Floris wrote: I just reran a script which I use to plot TFRs of ICA components and I discovered with help of Mathilde Bonnefond that there is an inconvenience in the ft_freqanalysis function since it changed on the 12th of June 2014. This implies that if you run ft_componentanalysis before ft_freqanalysis on preprocessed data, there are both 'raw' and 'comp' features detected by ft_freqanalysis, leading to the function defining the input as 'raw+comp' and expecting a dimord field in the data structure, which is not supplied by default. There is a workaround, one may delete the 'topo' and 'topolabel' fields from the input data, ft_freqanalysis works normally again. You may already be aware of this, but I thought it may be good to let you know.


Robert Oostenveld - 2014-06-18 10:04:40 +0200

Floris wrote: I have now put the data (comp) and the cfg (cfg) on the temporary disk under 4RobertOostenveld (filename 'debugft_freq4robert.mat')


Robert Oostenveld - 2014-06-18 10:09:21 +0200

(In reply to Robert Oostenveld from comment #1) I have copied the test data to /home/common/matlab/fieldtrip/test/bug2613.mat and can reproduce the problem with >> load(dccnpath('/home/common/matlab/fieldtrip/test/bug2613.mat')); >> ft_freqanalysis(cfg, comp) the input is component data with 56 components and 65 original channels the input is raw data with 56 channels and 182 trials Warning: the data does not contain a trial definition > In utilities/private/warning_once at 158 In utilities/private/fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_datatype_comp at 105 In ft_checkdata at 217 In ft_freqanalysis at 209 Warning: reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous recording > In utilities/private/warning_once at 158 In utilities/private/fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_datatype_comp at 105 In ft_checkdata at 217 In ft_freqanalysis at 209 selecting 182 trials Reference to non-existent field 'dimord'. Error in ft_selectdata_old (line 468) rpttapflag = ~isempty(strfind(data.dimord, 'rpttap')); Error in ft_selectdata (line 78) [varargout{1:nargout}] = ft_selectdata_old(varargin{:}); Error in ft_freqanalysis (line 215) data = ft_selectdata(data, 'rpt', cfg.trials);


Robert Oostenveld - 2014-06-18 10:27:56 +0200

I fixed it mac011> svn commit ft_freqanalysis.m test/ Sending ft_freqanalysis.m Adding test/test_bug2613.m Transmitting file data .. Committed revision 9636. The fix consists of changing from ft_selectdata_old to the new/newer/newest implementation. @Floris: Note however that your cfg is incorrect. The cfg.trials field refers to trials up to trial number 2409, whereas there are only 182 trials in the data structure.


Robert Oostenveld - 2014-06-18 10:28:16 +0200

(In reply to Robert Oostenveld from comment #3) sorry, typo: 2409 should read 240


Robert Oostenveld - 2014-06-18 10:29:50 +0200

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


Robert Oostenveld - 2014-07-15 17:25:11 +0200

Closed several bugs that were recently resolved. If it is closed in error, please reopen.