[Insight-users] accessing vector value from python

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Thu Apr 6 04:00:33 EDT 2006


I forgot to say that there is a python script to search not wrapped types.  
I use it to keep the number of unwrapped types as small as possible.
Hopefully, in the future, all the types will be wrapped :-)

Gaetan

On Thu, 06 Apr 2006 09:09:41 +0200, Gaetan Lehmann  
<gaetan.lehmann at jouy.inra.fr> wrote:

>
> The license is the ITK one - I will add it in the archive and in the
> repository - and the copyright will be transferred to the insight  
> software
> consortium.
>
> About the status of WrapITK:
> WrapITK is based on the current ITK wrappers. As such, it provides most  
> of the
> features of the current ITK wrappers and add lots of new features and  
> higher
> consistency (look at the article for more details :-)). It is well  
> tested on
> linux (I use it daily, as well as one of my colleague), also well tested  
> on
> mac os (it have been also developed on mac os (by Zach)), and now builds  
> on
> windows. On this last plateform, we need more feedbacks from users to be  
> sure
> everything work as it should - any help is welcome.
> Tcl and Java wrappers also work now, even if they don't have as musch  
> features
> than the python ones.
>
> Gaetan
>
> On Wednesday 05 April 2006 17:13, Zachary Pincus wrote:
>> One quick note, to clarify what's going on:
>>
>> When SWIG doesn't know what to do with a pointer or reference, it
>> turns it into a name-mangled string containing the pointer's type and
>> address. So '_0441d308_p_itk__VectorTfloat_2_t' is a pointer to an
>> itk::Vector<float, 2> at memory address 0x0441d308. Unfortunately, as
>> Gaetan pointed out, the ITK wrappers don't know what to do with such
>> a pointer. (Or actually, even with pointers to simpler things like
>> ints and floats, I think.)
>>
>> WrapITK solves many of these issues, but be aware that it is a work
>> in progress so there still may be some similar rough edges. We're
>> working on them as fast as we can, and the more people that use it,
>> the faster we can find and fix any problems.
>>
>> As to the licensing, I'm not sure what the current status is.
>> Eventually the copyright will be transferred over to the Insight
>> Software Consortium, I assume, and it will be licensed under the ITK
>> license. Gaetan might have a more useful comment.
>>
>> Zach
>>
>> On Apr 5, 2006, at 7:45 AM, Eduardo Suarez wrote:
>> > 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'>
>> > _______________________________________________
>> > Insight-users mailing list
>> > Insight-users at itk.org
>> > http://www.itk.org/mailman/listinfo/insight-users
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-users mailing list