[Insight-developers] [Insight-users] INSIGHT JOURNAL: managedITK (ITK 3.8 ?) & Release Schedule
Bill Hoffman
bill.hoffman at kitware.com
Tue Jul 15 09:56:52 EDT 2008
Stephen Aylward wrote:
> Hi Dan,
>
> You just posted on the Users list that ManagedITK doesn't wrap all of
> the spatial objects in ITK.
>
> Why not? Is there an incompatibility?
>
I am going to make some harsh statements at this point.... Sorry Dan...
My guess is spatial objects are not wrapped because it would have to be
done by hand. ManagedITK, while it manages to wrap the current ITK, is
IMO unmaintainable. It is essentially a hand wrapping of ITK. There is
no parsing of the C++ headers. Each and every method that is wrapped
by ManagedITK has to be specified in the cmake files for ManagedITK.
Here is an example for a single pair of set/gets on a class:
BEGIN_MANAGED_PROPERTY("LowerThreshold" GETSET)
SET(MANAGED_PROPERTY_SUMMARY "Get/set lower threshold value for
detected e
dges.")
SET(MANAGED_PROPERTY_TYPE "itkPixel^")
SET(MANAGED_PROPERTY_GET_BODY "return
itk::ManagedTypes::ToManagedPixel<Nat
iveType::OutputImagePixelType>( m_PointerToNative->GetLowerThreshold() );")
SET(MANAGED_PROPERTY_SET_BODY
"m_PointerToNative->SetLowerThreshold( itk::M
anagedTypes::ToNativePixel<NativeType::OutputImagePixelType>( value ) );")
END_MANAGED_PROPERTY()
I would vote/recommend that ManagedITK not be incorporated into ITK, but
remain an external project. If it is incorporated, each time you add a
method or change a method, then you would also have to find the
corresponding wrapping file in ManagedITK and make the same change.
We have a complete C++ parser available to us in gccxml, and we should
be using it. I would suggest that ManagedITK is a great proof of
concept, but is not practical in the long run. The real solution is to
either use the swig based wrapping for C# or at a minimum use gccxml to
parse the classes and then generated the CLI class wrapping
automatically. ITK is a large complex set of objects, and having to
maintain the interface in both templated C++, and .cmake configuration
files for each class wrapped will just be to hard to maintain.
-Bill
More information about the Insight-developers
mailing list