Back to the main page.
Bug 2820 - ft_sourceinterpolate has missing dim variable declaration
Status | CLOSED FIXED |
Reported | 2015-02-02 12:58:00 +0100 |
Modified | 2015-07-15 13:31:07 +0200 |
Product: | FieldTrip |
Component: | plotting |
Version: | unspecified |
Hardware: | PC |
Operating System: | Linux |
Importance: | P5 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Daniel Wong - 2015-02-02 12:58:39 +0100
I am using the 'surface' option in ft_sourceplot, which calls ft_sourceinterpolate. The error I get is: "Undefined function or variable 'dim'." on line 326. I do not see dim being declared anywhere in the preceding code. Does anyone know how this variable is supposed to come into existence? Cheers, Daniel
Jörn M. Horschig - 2015-02-02 13:28:48 +0100
Hi Daniel, I am not sure what approach you took in reconstructing the source-level activity, but most likely you need to set the .dim yourself. See e.g. http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#plotting_sources_of_oscillatory_gamma-band_activity
Daniel Wong - 2015-02-02 15:27:31 +0100
That might help if the dim field in my source data structure was copied into the local dim variable. But like I said, the local dim variable is never initialized anywhere preceding the function call on line 326, where it is needed.
Jörn M. Horschig - 2015-02-02 15:57:11 +0100
could you share/paste the code (i.e. cfg settings) that you used to compute the source structure, and the code related to the call to ft_sourceplot?
Robert Oostenveld - 2015-02-12 08:46:28 +0100
Hi Daniel, I recall having made some changes to the handling of dimord and probably also of dim (i.e. the dimensions of the data). The line that seems affected is now line 324 tmpnew = interp_gridded(functional.transform, tmp, anatomical.pos, 'projmethod', 'project', 'projvec', cfg.projvec, 'projweight', cfg.projweight, 'projcomb', cfg.projcomb, 'projthresh', cfg.projthresh, 'dim', dim); and I fail to see where that dim variable is being assigned. I guess it should be functional.dim or anatomical.dim. Let me try to reproduce the problem by interpolating some data with a specific cfg that should also end up at those lines...
Robert Oostenveld - 2015-02-12 09:28:33 +0100
I made a test script that reproduces the problem and subsequently fixed it. The dim should be that of the functional data, since the anatomy is a cortical sheet. mac011> svn commit Sending ft_sourceinterpolate.m Sending ft_sourceplot.m Sending private/interp_gridded.m Adding test/test_bug2820.m Transmitting file data .... Committed revision 10221.