> A question about spline interpolation:
>
> Has anybody ever tried something like this:
> >> v=[0 0 0 (1:32) 0 0 0];
> >> vc=spm_bsplinc(v,[3 3 3 0 0 0]);
> >> [x,y,z]=ndgrid(1:.6:length(v),1,1);
> >> vi=spm_bsplins(vc,x,y,z,[3 3 3])
>
> and what was the result? I don't trust mine...
>
> I think it is quite simple to patch this. According to Matlab, a vector
> has dimensionality 2 (don't ask...)
I got all NaNs (except for the first value). It seemed OK when I
transposed v though:
d = [3 3 3 0 0 0];
v = [0 0 0 (1:32) 0 0 0]';
vc = spm_bsplinc(v,d);
[x,y,z] = ndgrid(1:.1:length(v),1,1);
vi = spm_bsplins(vc,x,y,z,d);
plot([1:length(v)]',v,'ro',x,vi,'k');
Best regards,
-John
--
Dr John Ashburner.
Functional Imaging Lab., 12 Queen Square, London WC1N 3BG, UK.
tel: +44 (0)20 78337491 or +44 (0)20 78373611 x4381
fax: +44 (0)20 78131420 http://www.fil.ion.ucl.ac.uk/~john
|