我有一个大脑的 3D 图像(我们称之为 flash),它目前是 263 x 256 x 185。我想将它调整为另一个图像的大小(称之为 whole_brain_bravo);256 x 256 x 176,并且(希望)使用 lanczos 插值来重新采样(Image.ANTIALIAS)。我的(失败的)尝试:
from scipy import ndimage as nd
import nibabel as nib
import numpy as np
a = nib.load('flash.hdr') # nib is what I use to load the images
b = nib.load('whole_brain_bravo.hdr')
flash = a.get_data() # Access data as array (in this case memmap)
whole = b.get_data()
downed = nd.interpolation.zoom(flash, zoom=b.shape) # This obviously doesn't work
你们有没有在 3D 图像上做过这种事情?