[Insight-users] ITK & VTK & MFC help

Luis Ibanez luis.ibanez@kitware.com
Thu, 20 Mar 2003 05:41:07 -0500


Hi Joris,

1) Yes, you can integrate ITK, VTK and MFC

2) Yes, in principle you can do this with a project
    created with the MFC wizard... BUT...it will be
    very painful, time and coffee consuming since
    you will have to go through many passes of setting
    options in the project settings. I would discourage
    you from going though this dark path...

3) The easy way to go is to configure your
    project with CMake. That will save you a lot of
    time, suffering and frustration. One of the reasons
    for CMake to exist is that configuring a complex
    project in VC++ is a ... pain. Once you have more
    than ten libraries to link with, and ten directories
    in your include path, you will notice how useless are
    the little text boxes in the project settings GUI of
    VisualStudio. Morever, if you ever have to move
    your project to another computer you will find how
    fun is to keep looking for directories to change in
    this little boxes where you cannot make a search and
    replace.

4) Event and Observers are implemented following
    the 'Command' Design Pattern. ITK (and VTK) filter
    send Events at major stages of their execution.
    For example they send a StartEvent when the filter
    begins execution, they send an EndEvent when the
    filter finish executing, they send ProgressEvent
    during execution (e.g. that can be used for updating
    a progress bar in a GUI).

    The Observers are implemented in the itkCommand class
    and its family.  An Observer is assigned to a particular
    filter, and is specified to observer for a particular
    event. When such event happens, the Observer invokes
    its Execute() method.  This is like a typical callback.

    You will find multiple examples on the use of command
    observers in the InsightApplications module.

5) The Software Guide illustrate some examples of
    Command/Observers. Please take a look at

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

    - Section 7.3, pdf page 181
    - Section 7.6, pdf page 206
    - Section 7.14 pdf page 239



----


Regards,


   Luis


------------------------------
J Mst wrote:
> Thanx for the reply Luis,
> 
> But after reading the post you mentioned, I didn't really got further in 
> my example application. Therefore I still have some questions:
> 
> Can I easily integrate ITK and VTK in an MFC project made in VC++ by the 
> 'MFC app wizard'? So without the extern usage of CMake nor other extern 
> software.
> 
> Could anyone give me an simple example of an MFC GUI project with the 
> use of ITK/VTK? This would really help me further because I aint a genie 
> in programming.
> 
> Luis, can you give me a more exact explanation on the Event/Observer 
> issue you mentioned in your reply?
> 
> Thanx for all reactions in advance...
> 
> Joris
> Enschede
> The Netherlands
> 
> 
>