'python scipy.ndimage.zoom to resize 3D mask

I use scipy.ndimage.zoom() to resize 3D ndarray which represent mask.

resize_img = itpl.zoom(img, (resize[0] / img.shape[0], resize[1] / img.shape[1], resize[2] / img.shape[2]), mode='nearest')

But the result is not just 1 and 0.

enter image description here

I don't know why.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source