在SimpleITK
中,各术语对应如下:
Width: 宽度,X轴,矢状面
Height: 高度,Y轴,冠状面
Depth: 深度, Z轴,横断面
引用自:https://blog.csdn.net/JianJuly/article/details/99547691
GetArrayFromImage()
可用于将SimpleITK对象转换为ndarray
import SimpleITK as sitk
path = 'E:\COVID-19CTimageAnal\label\00018.dcm'
image = sitk.ReadImage(path)# convert to ndarry
data = sitk.GetArrayFromImage(image)
shape_data = data.shape
print(f'shape of data: {shape_data}')
输出:
shape of data: (80, 250, 320)
原始SimpleITK
数据的存储形式为(Width, Height, Depth)即(X,Y,Z),使用GetArrayFromImage()
方法后,X轴与Z轴发生了对调,输出形状为:(Depth, Height, Width)即(Z,Y,X)。
手机扫一扫
移动阅读更方便
你可能感兴趣的文章