2
Contributors
24
Replies
25
Views
6 Years
Discussion Span
Last Post by python_user
0

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
alphabetical.

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

sorry ;)

0

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..

0

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

1

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
f=Ima.pixel_array
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

Comments
Thanks for your help
0

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

0

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.

0

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

0

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

0

I am still studying the dcm stuff.

PM me tomorrow ok .? going to bed now.
:)

Edited by richieking: n/a

This article 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.