Back to the main page.

Bug 1055 - ensure that ft_neighbourplot internally uses the new-style elec/grad and not the old one

Status CLOSED FIXED
Reported 2011-10-18 20:34:00 +0200
Modified 2011-11-11 11:19:35 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Jörn M. Horschig
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2011-10-18 20:34:51 +0200

I notice the following code ------- % get the the grad or elec if not present in the data if exist('data', 'var') && isfield(data, 'grad') fprintf('Using the gradiometer configuration from the dataset.\n'); sens = data.grad; elseif exist('data', 'var') && isfield(data, 'elec') fprintf('Using the electrode configuration from the dataset.\n'); sens = data.elec; elseif isfield(cfg, 'grad') fprintf('Obtaining the gradiometer configuration from the configuration.\n'); sens = cfg.grad; elseif isfield(cfg, 'elec') fprintf('Obtaining the electrode configuration from the configuration.\n'); sens = cfg.elec; elseif isfield(cfg, 'gradfile') fprintf('Obtaining the gradiometer configuration from a file.\n'); sens = ft_read_sens(cfg.gradfile); % extract true channelposition elseif isfield(cfg, 'elecfile') fprintf('Obtaining the electrode configuration from a file.\n'); sens = ft_read_sens(cfg.elecfile); elseif isfield(cfg, 'layout') fprintf('Using the 2-D layout to determine the neighbours\n'); lay = ft_prepare_layout(cfg); sens = []; sens.label = lay.label; sens.pnt = lay.pos; sens.pnt(:,3) = 0; else error('Did not find gradiometer or electrode information.'); end; sens = fixsens(sens); % ensure up-to-date description of sensor-array (Oct 2011) ------- It should be ensured that all "input channels" contain the fixed sensor array, so that the fixsens is not needed here. The following functions should be checked - ft_checkdata - ft_checnconfig - ft_read_sens The bottom section (with the lay) should be converted locally in a correct elec-like struct.


Robert Oostenveld - 2011-10-18 20:36:55 +0200

the same goes for ft_prepare_layout


Robert Oostenveld - 2011-10-18 20:48:30 +0200

and for ft_prepare_localspheres ft_prepare_sourcemodel ft_scalpcurrentdensity ft_scalpcurrentdensity (search for FIXME) I have replaced fixsens by ft_datatype_sens. Perhaps it is a good idea to search for ft_datatype_sens and fixsens and for each instance check whether it is really needed.


Jörn M. Horschig - 2011-11-09 09:57:43 +0100

in checkdata, is it sufficient to check for the occurence of data.grad or data.elec and call ft_datatype_sens, or should there be additional conditions (e.g. only in case of raw, freq, timelock or spike data)?


Jörn M. Horschig - 2011-11-09 10:14:06 +0100

oh, forget that question, this is dealt with in all datatype_XXX functions already


Jörn M. Horschig - 2011-11-10 16:24:52 +0100

fixed for ft_neighbourplot, see bug 1132 for all other functions


Robert Oostenveld - 2011-11-11 11:19:35 +0100

I closed all bugs that were recently resolved.