使用 tfio.image.decode_dicom_image 读取的图像尺寸

问题描述

我使用 tfio.image.decode_dicom_image 以下 this 链接从我自己的数据集中读取 .dcm 图像。读取图像的形状显示为(无,无,无,无)。使用 plt.imshow 显示图像时,np.squeeze 的输出是零维的,因此在二维图像显示中会出现错误。有人可以帮我理解是什么问题吗?

解决方法

尝试使用 pydicom 读取 .dcm 数据

from pydicom import dcmread
import matplotlib.pyplot as plt     

read= dcmread('000000.dcm')
img=read.pixel_array
plt.imshow(img,cmap = 'gray')

或者有时目录错误