PyDICOM无法读取像素数据,需要GDCM或Pillow [英] PyDICOM can't read pixel data and needs GDCM or Pillow

查看:943
本文介绍了PyDICOM无法读取像素数据,需要GDCM或Pillow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using pydicom and my code is pretty straightforward:

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

但这会导致运行时错误:

But this gives a runtime error:

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

我不确定该怎么办.任何帮助都将..乐于助人.

I'm not sure what to do. Any help would be.. helpful.

推荐答案

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

If GDCM is giving you problems, give Pillow a go.
python -m pip install pillow
Make sure to install in the correct environment.

这篇关于PyDICOM无法读取像素数据,需要GDCM或Pillow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆