simpleITK读取nii文件并显示

import SimpleITK as sitk
from matplotlib import pyplot as plt

def showNii(img):
    for i in range(img.shape[0]):
        plt.imshow(img[i,:,:],cmap='gray')
        plt.show()

itk_img = sitk.ReadImage('C:\\Users\\86472\\Desktop\\1552282517.831928.nii')
img = sitk.GetArrayFromImage(itk_img)
showNii(img)

 

你可能感兴趣的:(医学图像处理)