[SciPy-user] ndimage zoom axes selection

Vincent Schut schut@sarvision...
Thu Jan 10 04:13:01 CST 2008


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))?

Vincent Schut.

More information about the SciPy-user mailing list