[Insight-users] ITK and Amira

Luis Ibanez luis.ibanez at kitware.com
Fri Jan 16 09:02:11 EST 2009


Hi Peter,

The simplest way of managing this kind of adaptors is to
use the facade pattern:
http://en.wikipedia.org/wiki/Facade_pattern


A) you create a facade C++ class:

              myAmiraITKExtension

     with files

              myAmiraITKExtension.h
              myAmiraITKExtension.cxx


      That you manage normally from the GNUMakefiles genereated from
      Amira.


B) Then you write another C++ class:

              myAmiraITKExtensionImplementation

     with files

              myAmiraITKExtensionImplementation.h
              myAmiraITKExtensionImplementation.cxx


      That you configure with CMake in order to create
      a static library.


C) In  myAmiraITKExtension.h you forward declare
    myAmiraITKExtensionImplementation as a pointer
    and make sure that you DO NOT include any ITK
    header, and DO NOT include either the header
    myAmiraITKExtensionImplementation.h


D) In  myAmiraITKExtension.cxx you include the
    myAmiraITKExtensionImplementation.h header
    and instantiate the class myAmiraITKExtensionImplementation.


F) At this point, you can simply add an ITK pipeline to
    myAmiraITKExtensionImplementation, and Amira doesn't
    need to know about it, nor about the process used
    for configuring the library with CMake.



   Regards,



       Luis



-------------------
Peter Jones wrote:
> Hello everyone,
> 
> I'm trying to use ITK in Amira (http://www.amira.com/). Amira has an 
> optional developer pack that allows custom extensions to be written in 
> C++. A bit more about the developer pack can be found here: 
> http://www.amira.com/documentation/52/amira/programmersguide/HxDev-intro.html. 
> Note that GNUmakefiles are generated automatically by Amira.
> 
> I'm hoping that it is actually possible to include ITK in Amira 
> extensions. The problem that I've run into is that Amira uses gmake and 
> GNUmakefiles to compile custom extensions, while ITK programs are 
> compiled with cmake using CMakeLists.txt. So, I don't know how to have 
> ITK included in the extensions that are compiled by gmake. I don't have 
> much experience with cmake, gmake, or C++ in general. I've been 
> researching this but haven't found any resources relating gmake to cmake.
> 
> At this point, I'm just trying to run a simple program like the 
> HelloWorld in the ITK Software Guide 
> (http://www.itk.org/ItkSoftwareGuide.pdf), but through Amira. I think to 
> compile it properly, I need to somehow take the functionality of the 
> CMakeLists.txt file, and put it into the GNUmakefile created by Amira.
> 
> Does anyone know if this should be possible? If so, can anyone with 
> experience with similar situations make any suggestions? Or can anyone 
> point me towards some relevant resources?
> 
> In case it helps, here are some details about my system:
> Mac OS X 10.5.6
> Amira 5.2.0
> ITK 3.10.1
> cmake 2.6.2
> gmake 3.81
> 
> Any help is greatly appreciated. If any more information or details 
> would help, please let me know.
> 
> Thanks,
> 
> Peter Jones
> Research Assistant
> Imaging Research Centre for Cardiac Intervention
> Sunnybrook Health Sciences Centre
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list