【发布时间】:2017-11-27 21:56:07
【问题描述】:
我正在尝试学习如何使用pydicom 来读取和处理dicom 图像。我正在使用 Python 3。
import dicom
import numpy
ds = pydicom.read_file(lstFilesDCM[0])
print(ds.pixel_array)`
我收到一个错误NameError: name 'pydicom' is not defined。如果我改变了
ds = pydicom.read_file(lstFilesDCM[0])
到
ds = dicom.read_file(lstFilesDCM[0])
(改用dicom.read_file),我收到以下错误:
NotImplementedError: Pixel Data is compressed in a format
pydicom does not yet handle. Cannot return array
我还验证了pydicom 已正确安装和更新。
我该如何解决这个问题?
【问题讨论】:
-
你说
import dicom然后尝试使用pydicom。哪个是正确的? -
我是根据 pydicom pydicom.readthedocs.io/en/latest/working_with_pixel_data.html 的文档执行此操作的,但无论哪种方式,pydicom 似乎都无法正常工作。正如@serafeim 指出的那样,这可能是因为数据不兼容。我认为数据是标准格式。没想到会不兼容。我会检查并发布我发现的内容。
-
错误:像素数据以 pydicom 尚未处理的格式压缩表明数据与库不兼容。如果可能,添加一些数据以尝试找到解决方案
-
是否有任何文档描述了兼容的像素数据类型?该数据直接来自超声心动图机。这是超声波数据。我正在尝试弄清楚如何检查它的兼容性。
-
存储库中的工作代码中添加了许多压缩数据处理程序,但这些还没有正式发布。要使用存储库代码(相当稳定),请使用
pip install git+https://github.com/pydicom/pydicom.git安装并使用import pydicom。