4

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.

g_uint
  • 1,603
  • 3
  • 16
  • 28
Shamoon
  • 38,429
  • 77
  • 269
  • 518
  • For any compressed pixel data, pydicom uses an external library to decompress the data. As indicated, you need to install either GDCM or Pillow to handle that particular file. – darcymason Feb 13 '19 at 20:10
  • I’m having an impossible time installing it: https://stackoverflow.com/q/54676488/239879 – Shamoon Feb 13 '19 at 21:22

3 Answers3

6

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

g_uint
  • 1,603
  • 3
  • 16
  • 28
3

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
My Work
  • 1,588
  • 1
  • 11
  • 39
1

Installing python-gdcm solved my problem

pip install python-gdcm
kdebugging
  • 347
  • 2
  • 7