Back to the main page.

Bug 1554 - ft_sourceinterpolate does not work for grand average data

Status CLOSED FIXED
Reported 2012-06-25 12:36:00 +0200
Modified 2012-08-23 14:02:10 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Jörn M. Horschig
URL:
Tags:
Depends on: 1573
Blocks:
See also:

Cornelius Abel - 2012-06-25 12:36:51 +0200

Using ft_sourceinterpolate on sourcegrandaverage data gives me the following error: cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.avg.pow'; sourceDiffInt= ft_sourceinterpolate(cfg, GANoNoise , mri); ??? Error using ==> interpn at 155 Wrong number of input arguments or some dimension of V is less than 2. Error in ==> ft_sourceinterpolate>my_interpn at 481 av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod); Error in ==> ft_sourceinterpolate at 385 av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); It seems that ft_sourceinterpolate cannot handle the 'avg.avg.pow' parameter because copying sourceDiffInt.avg.avg.pow to sourceDiffInt.avg.pow and using cfg.parameter = 'avg.pow' works fine :) Digging in the sourcecode i found that in ft_sourceinterpolate line 282 functional.avg.pow is converted from a 1d vector to a 3d matrix while functional.avg.avg.pow is not! Could it be that the corresponding function "parameterselection" is not using the cfg.parameter but some default? Greetings, Cornelius


Jan-Mathijs Schoffelen - 2012-07-18 13:32:56 +0200

probably there is something strange going on in ft_sourcegrandaverage first. I suggest to start there.


Jörn M. Horschig - 2012-07-25 12:18:56 +0200

the reason for the avg.avg.pow field is probably that when calling ft_sourcegrandaverage, cfg.parameter is set to 'avg.pow' In itself this is not a bad move, howver sourcegrandaverage is setting avg.(cfg.parameter), resulting in avg.avg.pow I think there needs to be a consent on how sourcegrandaverage should handle this. We gonna discuss this in the FT meeting today. probably there also is something wrong in ft_sourceinterpolate as it should be able to handle this. I'll first fix the sourceinterpolate issue and then the sourcegrandaverage - both today if possible


Jörn M. Horschig - 2012-07-25 15:16:50 +0200

Dear Cornelius, thanks for reporting this. the reason why it works with avg.pow but not with avg.avg.pow is that ft_checkdata reshapes avg.pow to match the dim-field. ft_checkdata does not bother about anything that is nested more than once (so any avg.avg will be ignored, which is indeed done by parameterselection) since this is not an issue anymore after fixing sourcegrandaverage, I won't fix this bug directly. Rather, I fixed sourcegrandaverage. Thanks for reporting this! Best, Jörn svn ci utilities/getsubfield.m utilities/setsubfield.m ft_sourcegrandaverage.m -m "bugfix-#1554-avoiding supernested structures by explicitly avoiding avg.avg (other nested subfields are allowed but will be warned for)" Sending ft_sourcegrandaverage.m Sending utilities/getsubfield.m Sending utilities/setsubfield.m Transmitting file data ... Committed revision 6287.


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

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