I have a lot of nii.gz images that I need to reshape from 3D to 2D, I'm trying to use the following code but it's not working due to the nii.gz extension:
import nibabel as nib
img = nib.load('teste01converted.nii.gz')
img.shape
newimg = img.reshape(332,360*360)
Can anyone help me?
Here's an exemple of the kind of images I'm working with: https://drive.google.com/drive/folders/1681T99hp6qZRUgx1Ej_h1hwFv1g_LJo4?usp=sharing