[Insight-users] Wrapping Custom Classes

Carlos Phillips carlos.phillips at mail.mcgill.ca
Thu, 22 Jan 2004 12:15:14 -0500


Hi,
It's been a while since I have been able to work on this code, but I 
finally have time. ConnectVTKITK has a lot of configuration code needed 
for dealing with VTK and it does not actually wrap an itk class. 
Unfortunately, I am not very familiar with CableSwig/cmake so I'm not 
sure how to wrap my class based on this example. Is there any simple 
example of wrapping a external subclass of ITK for use in python?

Carlos

On Dec 22, 2003, at 11:42 AM, Luis Ibanez wrote:

>
> Hi Carlos,
>
> 1) Yes, you can wrap custom classes without having to touch
>     the ITK source tree.
>
>     Please look at
>
>              InsightApplications/ConnectVTKITK
>
>    for an example on how to do this.  The two classes there
>    are intended to connect VTK and ITK pipelines and the
>    CMakeLists.txt file is configured for wrapping these two
>    classes.
>
>
> 2)  Do you intend to use an optimization process for computing
>     this plane ?
>
>    In this case, yes, you need to create a cost function that derives
>    from itk::SingleValuedCostFucntion.   The array of parameters
>    for the  cost function will be the coefficients of the plane.
>
>
>
> Please let us know if you have further questions.
>
>
>    Thanks
>
>
>         Luis
>
>
> -----------------------------
> Carlos Phillips wrote:
>
>> Hi,
>> Is there a way to wrap a custom ITK based class in python without 
>> changing the itk source tree.
>>
>> I need to compute the best fit plane for image data using sum of 
>> absolute distances. If I understand correctly, I need to subclass 
>> itk::SingleValuedCostFunction to represent the sum of absolute 
>> distances between a plane with given parameters and the image data. 
>> My ITK/VTK code is almost entirely written in python, so I need to 
>> find a way to make the SingleValuedCostFunction subclass available to 
>> the python runtime.
>>
>> Carlos
>>
>> _______________________________________________
>> 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
>