[Insight-users] getting started with ITK[C++ and c# comparision]

Dan Mueller dan.muel at gmail.com
Sat Sep 8 17:53:25 EDT 2012


Hi Sarah,

At the moment the only supported (i.e. maintained and tested) C#
wrappers around ITK is SimpleITK:
    http://www.itk.org/Wiki/ITK/Release_4/SimpleITK/GettingStarted#C.23_binary_files

Unfortunately, SimpleITK does not at present support (deformable) registration.

Therefore it seems you will need to delve into C++. Thankfully, due to
good design choices in ITK, you will probably find that the ITK C++
code is not too dissimilar from C#. For example, most pointers are
implicitly taken care of using itk::SmartPointer behind the scenes
(which is actually much better than garbage collection because a
developer knows exactly when memory will be released).

Of course you can Google for C# to C++ guides. Here is one I quickly found:
    http://www.bobtacoindustries.com/Content/Devs/CsToCpp-ASomewhatShortGuide.pdf

If you still want to use C# (say for example for UI) then you may
consider using SWIG which will automatically generate PInvoke wrappers
around C++ code for use in any .NET language. For this you will need
to encapsulate your C++ functionality behind a header file, point SWIG
at the header file, and it will generate your C# wrappers.
    http://www.swig.org/

Finally, if you are only interested in deformable registration, you
may consider using pre-compiled executables such as:
    http://elastix.isi.uu.nl/
    http://www.picsl.upenn.edu/ANTS/download.php

HTH

Cheers, Dan

On 9 September 2012 06:14, Sarah Saeed <sosca7 at hotmail.com> wrote:
> Hello,
> I'm a beginner with itk and vtk and i wanted to do non-deformable
> registration as a project, i worked with c# for more than 3 years and my
> question is :
> Are all the classes that i'll use available in the wrapper or should i  work
> with c++ because i'll take a long time to memorize c++ again.
> and what if i decided to work with c# can i use the unavailable classes as
> dlls then use it using c#?
> Thanks for your advice .


More information about the Insight-users mailing list