Back to the main page.

Bug 1458 - ft_chantype does not recognize a grad structure correctly

Status CLOSED WORKSFORME
Reported 2012-05-07 21:00:00 +0200
Modified 2012-08-23 10:41:38 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 major
Assigned to: Boris Reuderink
URL:
Tags:
Depends on:
Blocks:
See also: http://bugzilla.fcdonders.nl/show_bug.cgi?id=1522

Joaquín Morís - 2012-05-07 21:00:46 +0200

Windows Vista Matlab R2008b Fieldtrip build 20120506 Following the tutorial "Event related averaging and planar gradient", after preprocessing the data, the tutorial proposes: cfg = []; avgFIC = ft_timelockanalysis(cfg, dataFIC_LP); Doing so, produces the following error: ??? Error using ==> ft_chantype at 64 the input that was provided to this function cannot be deciphered Error in ==> ft_datatype_sens at 128 sens.chantype = ft_chantype(sens); Error in ==> ft_datatype_raw at 99 data.grad = ft_datatype_sens(data.grad); Error in ==> ft_checkdata at 177 data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo); Error in ==> ft_timelockanalysis at 134 data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); The error is due to the function ft_chantype not recognizing a grad structure. Probable solution: The line 42 of ft_chantype is: isgrad = isa(input, 'struct') && isfield(input, 'pnt') && isfield(input, 'ori'); However, in ft_senstype, lines 125 and 126: isgrad = isa(input, 'struct') && isfield(input, 'label') && isfield(input, 'pnt') && isfield(input, 'ori'); % old style isgrad = (isa(input, 'struct') && isfield(input, 'label') && isfield(input, 'coilpos')) || isgrad; % new style Adding this second option of recognizing a grad structure to ft_chantype fixes the problem


Jan-Mathijs Schoffelen - 2012-05-16 07:34:04 +0200

Thanks for posting Joaquin, we'll look at this a.s.a.p


Robert Oostenveld - 2012-06-08 14:07:01 +0200

see also bug #1228, it might be related.


Robert Oostenveld - 2012-06-08 14:07:24 +0200

(In reply to comment #2) sorry, that should have read see also bug #1288, it might be related.


Boris Reuderink - 2012-07-04 15:53:24 +0200

Apparently, this was fixed in SVN revision 4287, and improved upon in SVN revision 6038.