# P = np.fromfile(r'C:\Users\320133514\Desktop\2-16\softmax\48-nnunet.bin', dtype=np.float32)
# P.shape = 48, 320, 320
# img = P[24:48, 0:320,0:320]
# img.tofile(r'C:\Users\320133514\Desktop\2-16\softmax\1\24-nnunet-result.bin')
# print(C)
# print(C.shape)
# print(type(C))
# print(C.ndim)
# out = sitk.GetImageFromArray(img)
# spacing = [0.69531298, 0.69531298, 1]
# out.SetSpacing(spacing) # 设置spacing,这一步别忘了
# sitk.WriteImage(out,r'C:\Users\320133514\Desktop\C-0-24.nii.gz')
带有spacing保存数据
最新推荐文章于 2024-07-19 16:36:18 发布