[FieldTrip] Error with interpn when calling ft_sourceinterpolate

gj gina.joue at univr.it
Thu Mar 24 12:30:48 CET 2016


Hi FieldTrip community,

I am using FieldTrip ver.20160309 and am getting the error:

	Error using interpn (line 152)
	Wrong number of input arguments.

	Error in ft_sourceinterpolate>my_interpn (line 673)
	av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod);

while trying to interpolate onto a template brain after having done 
source reconstruction. This question had been posted before several 
years ago but don't know how to "fix" the problem:

http://mailman.science.ru.nl/pipermail/fieldtrip/2013-March/006347.html

Here is my code leading to the error when calling ft_sourceinterpolate:

%-- snippet--%
% sensor level Fourier spectra
cfg = [];
cfg.method = 'mtmfft';
cfg.output = 'fourier';
cfg.keeptrials = 'yes';
cfg.tapsmofrq = 2;
cfg.foi = 13;
freqsens = ft_freqanalysis(cfg, data);

% source reconstruction
cfg = [];
cfg.frequency = freqsens.freq;
cfg.elec = elec;
cfg.method = 'eloreta';
cfg.grid = lf;
cfg.vol = vol;
cfg.keeptrials = 'yes';
cfg.rawtrial = 'yes';
source = ft_sourceanalysis(cfg, freqsens);

% project to direction explaining most source variance
cfg = [];
cfg.projectmom = 'yes';
source_proj = ft_sourcedescriptives(cfg,source);

source_proj.dim = template_grid.sourcemodel.dim;
source_proj.pos = template_grid.sourcemodel.pos;

%%....... interpolate onto the MNI template brain
cfg = [];
cfg.voxelcoord = 'no';
cfg.parameter = 'avg.pow';
cfg.interpmethod = 'nearest';
source_int = ft_sourceinterpolate(cfg, source_proj, template_mri);

%-- end snippet--%


Any help greatly appreciated!
Gina



More information about the fieldtrip mailing list