Back to the main page.

Bug 1080 - fixneighbours should be solved only once - in ft_checkconfig

Status CLOSED FIXED
Reported 2011-10-26 17:32:00 +0200
Modified 2012-08-23 14:02:03 +0200
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-26 17:32:11 +0200

at this moment ft_channelrepair contains if iscell(cfg.neighbours) warning('Neighbourstructure is in old format - converting to structure array'); cfg.neighbours = fixneighbours(cfg.neighbours); end and potentially other functions have a similar piece of code. Since the neighbours always "enter" the function through the cfg.neighbours field, ft_checkconfig is able to always convert it. This is similar to fixing cfg.grad and cfg.elec.


Jörn M. Horschig - 2011-11-09 10:33:31 +0100

Hey Robert, good idea, but there is a problem in ft_prepare_neighbours. ft_prepare_neighbours only returns the neighbour structure, *not* the cfg. The most consistent way, also with respect to all other ft_ functions, would be to change the output argument to a cfg. However, this will lead to much trouble concerning backward compatibility. Btw, the reason why ft_prepare_neighbours might need fixneighbours is that someone may want to load a template that is still in old format. I doubt that anyone does, so another possibility would be to just delete&try For all other functions, I will change this.


Robert Oostenveld - 2011-11-09 11:23:05 +0100

agreed


Jörn M. Horschig - 2011-11-23 10:29:17 +0100

svn ci ft_channelrepair.m ft_freqstatistics.m -m "bugfix -#1080- fixneighbours is only called in ft_checkconfig from now on" Sending ft_channelrepair.m Sending ft_freqstatistics.m Transmitting file data .. Committed revision 4793. And an earlier revision which involved ft_prepare_neighbours (on November 9)


Jörn M. Horschig - 2012-08-23 14:02:03 +0200

bug closing time (http://www.youtube.com/watch?v=xGytDsqkQY8)