PyDICOM can't read pixel data and needs GDCM or Pillow

Shamoon picture Shamoon · Feb 12, 2019 · Viewed 8.2k times · Source

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.

Answer

g_uint picture g_uint · Feb 18, 2019

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