6 Years
Discussion Span
Last Post by python_user

Change log
1b8148505b by darcymason on Oct 10, 2008 Diff

Started dicom.image module, show_PIL()
function which uses PIL to display pixel
data. Works for CT and MR and image_defl
but needs palette adjustments. The
ExplVR_BigEndian image with RGB looks odd,
probably not being interpreted correctly.
Reorganized Dataset code to keep

This is from your link. Meaning the module is still experimental module.
Thats lower than even alpha standard.

sorry ;)


ohk, is it possible to convert dicom pixel_data to jpeg image and then open with pil?
do u have any idea how to convert, if so please help me..


I have converted to tiff.

Its not that good. Hold on i will see if i can enhance it with Image module

Edited by richieking: n/a


This is my final work

import dicom
import Image

Ima=dicom.ReadFile("/home/richie/d1.dcm") # change the path

ds=Ima.InstitutionName="Any name" # not realy needed
# I just had to print this Ima.pixel_array out to show you the lists
print f # print
sa= Image.fromarray(f) ## Hear is the Image module. It needs the array method as the details from Ima. is array
if sa.show():    
   sa.save("foo.gif") # save the dat converted to gif.
print("Copy converted to file with name...[foo.gif]")

And dont forget to show some love by upvoting me ok? ;)

Edited by richieking: n/a

Votes + Comments
Thanks for your help

when i tried it is not saving the image, i donno y
but anyways thank u for ur help


what error??

what OS are you?

You cat take away the if statement and just leave the save. it will save in your home.
windows will be my documents i think.


no error but it is not saving the file i think as i dont find the file in serach too


Hey i got it, but the image is still blur not the actual image as when opened in dicom browser :(


I am still studying the dcm stuff.

PM me tomorrow ok .? going to bed now.

Edited by richieking: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.