This is one of the easiest steps to view and convert dcm image useing the snake(python)

There are 3 modules involved.

1. Search for pydicom and install
2. Search for matplotlib and install
3. Search for pylab and install.

If you are on ubuntu destro, Installing matplotlib via the repo will pull include the pylab. That is as far as i know. Maybe Pylab is included in matplotlib module. I stand for corrections .

Note To convert to .png,.gif,.jpg file ...

Pylab will popup the file and it will come with image as required.
Look at the statusbar and there are buttons with save disket image. Click on it then select your choice of file type to save. Make sure you save it where easy to access.

Thank you. :)

import dicom
import Image
import pylab

dFile=dicom.read_file("/home/richie/d1.dcm") #path to file
pylab.imshow(dFile.pixel_array,cmap=pylab.cm.bone) # pylab readings and conversion
pylab.show() #Dispaly
6 Years
Discussion Span
Last Post by richieking

I included image module but its not active in the code.

That means i am working on image module's version.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.