【发布时间】:2019-09-26 09:21:42
【问题描述】:
我正在编写一个简单的代码来读取 dicom 图像,但是当我尝试使用 matplotlib 显示它时它给了我一个错误 这是我的代码:
import pydicom
import matplotlib.pyplot as plt
ds = pydicom.dcmread("C:/Users/A763194/Desktop/Cone beam/IMG.dcm") # plan dataset
print(ds.PatientName)
print(ds.Rows)
print(ds.Columns)
plt.imshow(ds.pixel_array)
我期待 Images dicom 的输出,但它给出了以下错误:
TypeError:图像数据的形状无效(601、601、601)
【问题讨论】: