Shamoon
Shamoon

Reputation: 43609

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

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.

Upvotes: 5

Views: 14432

Answers (3)

kdebugging
kdebugging

Reputation: 561

Installing python-gdcm solved my problem

pip install python-gdcm

Upvotes: 2

My Work
My Work

Reputation: 2508

I have encountered the same problem and I already had pillow installed. The solution was to update pydicom and install gdcm (see here) as pointed out in this post by @Ali Türkay Avci. Using anaconda, you do:

conda install -c conda-forge gdcm

Upvotes: 3

g_uint
g_uint

Reputation: 2041

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

Upvotes: 6

Related Questions