0

I would like to do a 3D interpolation of my 3D matrix. I've managed to do it on Matlab using interpn however it would be much better if I could do it on Python since it could be executed on any machine without the need of having Matlab installed. My Matlab script looks like:

X = (-246.4529 :2.5: -246.4529 + 100*2.5 - 1);
Y = -45.6577  :2.5: -45.6577  + 213*2.5 - 1;
Z = -211.00   :2.5: -211.00   + 140*2.5 - 1;

Xp = -255.21 :5: -255.21 + 50*5  - 1;
Yp = -50.66  :5: -50.66  + 108*5 - 1;
Zp = -215.00 :5: -215.00 + 86*5  - 1;

[XX, YY, ZZ] = ndgrid(X, Y, Z);
[XXp, YYp, ZZp] = ndgrid(Xp, Yp, Zp);

Vq = interpn(XX,YY,ZZ, double(matrix), XXp,YYp,ZZp);

Any ideas of how I could do the same on Python? Is there a 3D interpolation package?

Manolete
  • 3,431
  • 7
  • 54
  • 92
  • You can take a look to this: http://stackoverflow.com/questions/15748767/interpolation-subsampling-of-3d-data-in-python-without-vtk – phyrox Sep 15 '14 at 10:37
  • Agree with phyrox's comment. Take a good look at that link. `numpy / scipy` is the best alternative that mimics the MATLAB syntax for interpolation (of any ND data really...) – rayryeng Sep 15 '14 at 14:23

0 Answers0