📜  nibabel 扩展维度 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:24.550000             🧑  作者: Mango

代码示例1
import nibabel as nib
import numpy as np
im = nib.load(im_path)
new_im = np.expand_dims(im.get_fdata().astype(np.float32),-1)
nib.save(nib.Nifti1Image(new_im, affine=im.affine), im_path)