[FieldTrip] Error with interpn when calling, ft_sourceinterpolate
gj
gina.joue at univr.it
Fri Mar 25 13:29:21 CET 2016
Hi Jan-Mathijs,
Thanks for the prompt reply! Sorry I forgot to say...I tried it in
Matlab R2016a under Linux and Matlab R2012a on a Mac...I suspect I must
have made some error in the steps leading up to source interpolation --
are there perhaps data checks I can do to narrow down what it could be?
Thanks!
Gina
>
> Message: 7
> Date: Fri, 25 Mar 2016 09:16:12 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Error with interpn when calling
> ft_sourceinterpolate
> Message-ID: <D5A86EBD-56B4-4898-96AE-FB993A8B320A at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Gina,
>
> What version of MATLAB and operating system are you using? I cannot
get your error reproduced, and from the message it seems a low-level
MATLAB thing, because it complains about the number of input arguments
to a function that is provided by MATLAB. (by the way, the error message
that you got refers to line 152 in interpn, the same error check is done
in my version of interpn at line 151?., which suggests a different
version of the m-file. I was using matlab2014b on a windows machine)
>
> Best,
> Jan-Mathijs
>
>
>
>> On 24 Mar 2016, at 12:30, gj <gina.joue at univr.it> wrote:
>>
>> 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
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
More information about the fieldtrip
mailing list