[Insight-users] accessing vector value from python

Eduardo Suarez eduardo at ctm.ulpgc.es
Wed Apr 5 08:45:28 EDT 2006


When i run this code, i finally get a string. What am i doing wrong?

Thanks,
-Eduardo

import InsightToolkit as itk
reader = itk.itkImageFileReaderVF2_New()
reader.SetFileName('output.mhd')
reader.Update()
image = reader.GetOutput()
image
    <C itk::Image<(itk::Vector<(float,2)>,2)> instance at
    _d005d208_p_itk__ImageTitk__VectorTfloat_2_t_2_t>
ind=itk.itkIndex2()
ind.SetElement(0, 0)
ind.SetElement(1, 0)
pix=image.GetPixel(ind)
pix
    '_0441d308_p_itk__VectorTfloat_2_t'
pix.__class__
    <type 'str'>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3302 bytes
Desc: S/MIME Cryptographic Signature
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060405/52f6c4b6/smime.bin


More information about the Insight-users mailing list