a seg img A - 3d numpy array image, shape (150, 418, 406), only consists of two values 0, 1
resized img B - the resized version of the above (160, 192, 128), many array values [-0.26 ~ 1.28 ]
The resizing process was run by this code:
def resize(img, shape, mode='constant', orig_shape=None):
"""
Wrapper for scipy.ndimage.zoom suited for MRI images.
"""
if orig_shape == None: orig_shape = img.shape
assert len(shape) == 3, "Can not have more than 3 dimensions"
factors = (
shape[0]/orig_shape[0],
shape[1]/orig_shape[1],
shape[2]/orig_shape[2]
)
# Resize to the given shape
return zoom(img, factors, mode=mode)
And the below images are the 80th slices of each 3d image. (A, B)
I want to just downsample mri segmentation images and don't want to the weird modification of the images. Any help would be appreciated.