[FieldTrip] Problem with interpn function in ft_sourceinterpolate

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Sat Mar 23 14:33:44 CET 2013


hi tadeusz,

I believe that interpolation from a 3D grid onto another 3D grid is not supported when the input contains multiple time points.

Best

Jan-Mathijs


On Mar 21, 2013, at 7:23 PM, T.W. Kononowicz wrote:

> Dear FieldTrip users,
> 
> I am trying to do some source reconstruction on ERF data (version: fieldtrip-20130320). Everything seems to work quite well up to ft_sourceinterpolate. 
> 
> 
> cfg        = [];
> cfg.method = 'mne';
> cfg.grid   = grid;
> cfg.vol    = template_vol;
> cfg.grad            = grad;
> cfg.projectnoise  = 'yes';
> cfg.reducerank      = 'no';
> cfg.mne.lambda = 1e8;
> repr2_mne = ft_sourceanalysis(cfg, repr2_cov);
> 
> The repr2_mne structure looks as follows:
> >> repr2_mne
> repr2_mne = 
>         dim: [15 15 14]
>        time: [1x1751 double]
>         pos: [3150x3 double]
>      inside: [1x1613 double]
>     outside: [1x1537 double]
>      method: 'average'
>         avg: [1x1 struct]
>         cfg: [1x1 struct]
> 
> >> repr2_mne.avg
> ans = 
>          mom: {1x3150 cell}
>          pow: [3150x1751 double]
>     noisecov: {1x3150 cell} 
> 
> 
> As the next step I call the ft_sourceinterpolate:
> cfg=[];
> cfg.interpmethod='linear';
> cfg.parameter='avg.pow'; 
> cfg.downsample = 2;
> cfg.feedback='yes';
> repr2_interp=ft_sourceinterpolate(cfg, repr2_mne,template);
> 
> Then I get the following display message. 
> the input is source data with 3150 positions on a [15 15 14] grid
> the input is volume data with dimensions [91 109 91]
> updating homogenous coordinate transformation matrix
> downsampling anatomy
> downsampling inside
> the call to "ft_volumedownsample" took 0 seconds and required the additional allocation of an estimated 0 MB
> selecting subvolume of 34.7%
> reslicing and interpolating avg.pow
> 
> After that the code crashes and I get the error:
> 
> ??? 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 494
>   av(sel) = interpn(fv, ax(sel), ay(sel), az(sel), interpmethod);
> 
> Error in ==> ft_sourceinterpolate at 397
>           av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod,
>           cfg.feedback);
> 
> 
> Just before crush in line 397 of ft_sourceinterpolate:  av( sel) = my_interpn(fv, ax(sel), ay(sel), az(sel), cfg.interpmethod, cfg.feedback); argument's size are:
> size(fv)
> ans =
>         3150        1751
> ax, ay, az, are:
> size(ay)
> ans =
>     46    55    46
> 
> size(sel)
> ans =
>       116380           1
> 
> 
> 
> I found one similar post on the list, however its not helpful in that case. Does anyone can spot what I'm missing here?
> 
> Thank you in advance for you help,
> 
> Tadeusz W. Kononowicz
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jan-Mathijs Schoffelen, MD PhD 

Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands

Max Planck Institute for Psycholinguistics,
Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl
Telephone: +31-24-3614793

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130323/ff7ed128/attachment.html>


More information about the fieldtrip mailing list