1、
Width: 宽度,X轴,矢状面
Height: 高度,Y轴,冠状面
Depth: 深度, Z轴,横断面
import SimpleITK as sitk
实验用的图片大小为32025080,
即矢状面(x轴方向)切片数为320,冠状面(y轴方向)切片数为250,
横断面(z轴方向)片数为80
如上图所示
path = ‘t1.nrrd’
image = sitk.ReadImage(path)
shape_img = image.GetSize()
print(f’shape of image: {shape_img}’)
convert to ndarry
data = sitk.GetArrayFromImage(image)
shape_data = data.shape
print(f’shape of data: {shape_data}’)
shape of image: (320, 250, 80)
shape of data: (80, 250, 320)
在SimpleITK中,各术语对应如下:
Width: 宽度,X轴,矢状面
Height: 高度,Y轴,冠状面
Depth: 深度, Z轴,横断面
使用GetSize()的输出为:(Width, Height, Depth),也即原始SimpleITK数据的存储形式
使用GetArrayFromImage()方法后,X轴与Z轴发生了对调,输出形状为:(Depth, Height, Width)