Back to the main page.

Bug 2609 - ft_sourceplot with cfg.atlas/.roi throws error (line 345)

Status CLOSED FIXED
Reported 2014-06-11 14:49:00 +0200
Modified 2014-06-18 12:29:47 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P5 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Jens Klinzing - 2014-06-11 14:49:47 +0200

When specifying cfg.atlas & cfg.roi when calling ft_sourceplot I get the following error: - Error using ft_checkconfig (line 150) The field cfg.inputcoord is required Error in ft_volumelookup (line 125) ft_checkconfig(cfg, 'forbidden', {'sphere' 'box'}, ... Error in ft_sourceplot (line 345) roi = ft_volumelookup(tmpcfg,data); - ft_sourceplot does not correctly specify the coordinate system when calling ft_volumelookup. The error occurs because in line 344 it says tmpcfg.coordsys = data.coordsys; However, ft_volumelookup expects the coordinate system to be specified in a field 'inputcoord', not 'coordsys'. Hence, to fix the bug line 344 could be changed to: tmpcfg.inputcoord = data.coordsys; See example code below (works with the suggested fix, does not work without the fix). Cheers, Jens - cfg = []; cfg.funparameter = 'avg.pow'; cfg.opacitymap = 'rampup'; cfg.funcolormap = 'jet'; cfg.funcolorlim = 'zeromax'; % = [0.0 1.2]; cfg.opacitylim = 'zeromax'; % = [0.0 1.2]; cfg.method = 'slice'; cfg.roi = {'Supp_Motor_Area_L','Supp_Motor_Area_R'}; cfg.atlas = fullfile(home,'fieldtrip','template','atlas','aal','ROI_MNI_V4.nii'); ft_sourceplot(cfg, source)


Jan-Mathijs Schoffelen - 2014-06-11 15:18:11 +0200

Thanks for reporting. I incorporated your suggested fix. Could you check whether it now works? bash-4.1$ svn diff ft_sourceplot.m Index: ft_sourceplot.m =================================================================== --- ft_sourceplot.m (revision 9614) +++ ft_sourceplot.m (working copy) @@ -341,7 +341,7 @@ tmpcfg = []; tmpcfg.roi = cfg.roi; tmpcfg.atlas = cfg.atlas; - tmpcfg.coordsys = data.coordsys; + tmpcfg.inputcoord = data.coordsys; roi = ft_volumelookup(tmpcfg,data); end end bash-4.1$ svn commit -m "bugfix - changed coordsys into inputcoord: courtesy of Jens Klinzing (bug 2609)" ft_sourceplot.m Sending ft_sourceplot.m Transmitting file data . Committed revision 9615.


Jens Klinzing - 2014-06-11 15:26:11 +0200

Seems to work just fine! Thanks!