[Insight-users] ITK and managed C++ .NET

Nick Arini nick.arini at amersham.com
Tue Jul 6 11:27:40 EDT 2004


Dear ITK users,

Has anyone successfully integrated ITK into a .NET application. It seems 
relatively straightforward to wrap unmanaged C++ objects such as ITK 
classes in managed wrappers for use in .NET apps (see simple example 
below). Has anyone tried this in anger with ITK? I usually rely on CMAKE 
to set up the properties of a project in Enterprise Architect VC++.NET for 
use with ITK. How do I do this with a Managed C++ application? Is there 
any scope for adding a .NET wrapping layer to the Tcl, Python and Java 
ones?

Best regards,

Nick

<begin code>

// This is an unmanaged class
class MyClass
{
public:
        int MyMethod( int x, int y )
        {
                return x + y;
        }
};


// Managed wrapper class
__gc class MyManagedClass
{
public:
        int Sum( int a, int b )
        {
                MyClass *obj = new MyClass();
                return obj->MyMethod( a, b );
        }
};


<end code>


More information about the Insight-users mailing list