Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 441
Shamoon Avatar asked Jan 01 '23 07:01

Shamoon


1 Answers

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

like image 117
g_uint Avatar answered Jan 17 '23 09:01

g_uint