Skip to main content
 首页 » 编程设计

python之PyDICOM 无法读取像素数据,需要 GDCM 或 Pillow

2024年11月24日16shangdawei

我正在使用 pydicom,我的代码非常简单:

image = np.stack([s.pixel_array for s in scans]) 

但这会产生运行时错误:

RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), Pillow (req. Pillow) 

我不知道该怎么办。任何帮助都会……有帮助。

请您参考如下方法:

如果 GDCM 给您带来问题,试试 Pillow。
python -m pip install pillow
确保安装在正确的环境中。