[SciPy-user] ndimage zoom axes selection

Vincent Schut schut at sarvision.nl
Thu Jan 10 05:13:01 EST 2008


Hi,

I want to use ndimage.zoom on my arrays, but only on the last 2 axes.
E.g. I have an array of shape (46, 2, 7, 256, 256) that I want to become
(46, 2, 7, 512, 512). Actually, my array is a multidimensional stack of
2d images, and I want just those 2d images to be interpolated. Currently
I just loop over the other dimensions, but maybe there is a better way?
Or maybe ndimage.zoom could be changed to accept a tuple as zoom factor,
that would set the zoom factor per axis, so I could use
ndimage.zoom(input, (1, 1, 1, 2, 2))?

Regards,
Vincent Schut.




More information about the SciPy-User mailing list