"Alle Meije " <firstname.lastname@example.org> wrote in message <email@example.com>...
> Ah, OK. So the steps for Hx and Hy can be combined into one call (Hxy) because the x and y dimensions are the same (3rd parameter), and the step for Hz needs to be a separate call because the dimension is different? ================
> Got it! I needed to download a substitute for bsx_func() which is in the latest matlab version only, and change a line where it says > [~, output] = function(inputs) > which is also new-matlab syntax?
Your MATLAB version is obviously quite old. BSXFUN has been around since R2008 and the "~" syntax is only a bit more recent. Just replace the "~" with some dummy variable.
> Also had to apply a circular shift of [-ksize -ksize -ksize] to the volume (because the kernel was not centred), but still it was *A LOT* faster than the other two. ===================
No idea why the circshift is necessary. Possibly a side-effect of other changes you made? I checked directly that this produces a centered kernel. I also compared the output of my scheme numerically to CONVN and got agreement to within numerical precision. In any case, the 2nd argument to interpMatrix also accepts a number if you want to do it that way. This lets you indicate directly the location of what you consider the kernel center.