SimpleITK中,各术语对应如下:

Width: 宽度,X轴,矢状面
Height: 高度,Y轴,冠状面
Depth: 深度, Z轴,横断面

SimpleITK中术语引用自:https://blog.csdn.net/JianJuly/article/details/99547691

GetArrayFromImage()可用于将SimpleITK对象转换为ndarray

import SimpleITK as sitk
# 实验用的图片大小为320*250*80,
# 即矢状面(x轴方向)切片数为320,冠状面(y轴方向)切片数为250,
# 横断面(z轴方向)片数为80 
# 如上图所示

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)。

相关文章:

  • 2021-09-19
  • 2021-06-29
  • 2022-12-23
  • 2021-05-08
  • 2022-02-09
  • 2021-11-02
  • 2022-02-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-22
  • 2021-12-03
  • 2021-09-22
  • 2021-12-10
  • 2022-01-21
  • 2022-12-23
相关资源
相似解决方案