[Insight-users] Re: About ITK programming -- some stupid questions..

Luis Ibanez luis.ibanez at kitware.com
Sun Mar 25 17:38:01 EST 2007



Hi Goo,



1) Is your C-style function going to be compiled by the
    C-compiler ?  or by the C++ compiler ?


    Strictly speaking you cannot pass an itk::Image to a
    pure C-language function.

    You can however, have a function that looks like a
    C-language function and has an itk::Image as argument
    as long as you compile it with the C++ compiler.

    If that is what you want, the function will look like


    typedef itk::Image<char,3> ImageType;

    int myCfunction( ImageType * image )
      {
     ...
      }


2) Your second question is a bit confusing.

    You want a SmartPointer that "is like" a New() command ?

    Please give us a code snippet example of what you are
    trying to achieve.



If you are new to generic programming we strongly
encourage you to read the ITK Tutorials:

    http://www.itk.org/HTML/Tutorials.htm

in particular:

http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm

and

http://www.itk.org/CourseWare/Training/GettingStarted-V.pdf

This second tutorial shows you how to integrate ITK into
your application by using C-language functions.


You should also read the ITK Software Guide


    http://www.itk.org/ItkSoftwareGuide.pdf




  Regards,


     Luis



------------
Goo wrote:
> Hi All:
> I have some stupid questions about ITK programming.
> 
> (1) How to define a general C-style function that input is a itk::Image?
> 
> (2) How to define a Smart Pointer that likes a New() command in C++.
> 
> I am a new programmer for template style language.
> Please give me some guidance.
> I will very thank for your help.
> 
> Regards.


More information about the Insight-users mailing list