[FieldTrip] Problem with interpn function in ft_sourceinterpolate

T.W. Kononowicz t.w.kononowicz at rug.nl
Thu Mar 21 19:23:38 CET 2013


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


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


More information about the fieldtrip mailing list