[Insight-users] Python & itk : How to print (or use) the value of a pixel in a dicom slice

Vincent Page vpage at univ-ag.fr
Thu Mar 30 04:51:54 EST 2006


Hi,

I m new to python and ITK and have the following problem :
I want to print the value of a pixel in a Dicom slice...

What I do is the following :

----------------------------------
reader = itkImageFileReaderUS2_New()
dicomIO = itkGDCMImageIO_New()
reader.SetImageIO( dicomIO.GetPointer() )
reader.SetFileName( "im_0694" )

reader.Update()
image = reader2.GetOutput()

seedIntensity = image.GetPixel(seedPosition)
print seedIntensity
-----------------------------------
the result is :
_3cfdc9aeaa2a0000_p_unsigned_short

Which, I guess, means that seedIntensity is a pointeur on unsigned short.
If it is, how can I use the value of a pointeur in python, where 
explicit pointeurs
doesn't exist (as far as I know)

Uuh...I went through the ItkSoftwareGuide but didn't find any help there.

Thanks a lot.

Vincent Pagé.








More information about the Insight-users mailing list