I have MRIs with shapes (170,256,256) and I need to change the shape of the MRIs to (256,256 ,256) Is this possible with python?
I need to do this step to use a patchify package to break the volumes into smaller patches. We will break it into patches of 64x64x64 for training.
Object having attributes dataobj, affine, header and shape. If out_class is not None, img.__class__ should be able to construct an image from data, affine and header.
Typically, this will be a SpatialImage. Calling img.get_fdata() gets you a numpy array. Instead, just pass img and you will get a new image out.
i need to call img.get_fdata() so I can squeeze the image.
the image in shape (170,256,256,1). I need to squeeze it to (170,256,256).
when i tried to pass it directly without squeezing,it produce this error.