[Insight-developers] Re: VTK ITK tcl/python connection

Bill Hoffman bill . hoffman at kitware . com
Mon, 28 Jul 2003 11:40:55 -0400


Great work.  Sorry about the flap over the VTK in ITK stuff.
I was planning on telling you about that when you got a bit closer
to finishing.  (You finished much quicker than I expected...)

The idea we had was to make it so the VTK/ITK stuff
could be done completely outside the ITK build tree.  It will mean
exporting all the CSWig CMake macros into the UseITK.cmake file.
The problem was that ITK had too many options, so it was decided that
the base ITK should not depend on any packages even in advanced mode.

The idea would be something like this:

#
# Find ITK
#
INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
IF (USE_ITK_FILE)
  INCLUDE(${USE_ITK_FILE})
ENDIF(USE_ITK_FILE)

#
# Include VTK configuration
#
INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
IF (USE_VTK_FILE)
  INCLUDE (${USE_VTK_FILE})
ENDIF (USE_VTK_FILE)



ADD_LIBRARY(VTKITK)
WRAP_CSWIG(ConnectVTKITK.i)

This could go in InsightApplications.


-Bill

At 06:10 AM 7/28/2003, Charl P. Botha wrote:
>On Wed, 2003-07-23 at 17:58, Bill Hoffman wrote:
>> I would like to introduce you to Charl Botha.  He has
>> already implemented a python itk/vtk integration.
>> He is looking into a more general solution based on the
>> same information I sent you.   You may want to try
>
>Okay, it's all done.  Bill, I have built and tested it on Windows VC++
>6.0 and on g++ 2.95.4 on Debian Linux and then went and committed it.  I
>had to make more changes to CableSwig.cxx to make the CableSwig and
>NoCable wrappings compatible: see CableSwig::TemplateName().  These
>changes have more advantages: it means in future we will be able to add
>similar pure Swig interface files to Insight and have the generated
>wrappings interact with and operate on CableSwig wrapped objects.
>
>I have attached a Python sample illustrating a pipeline that loads data
>in using VTK, processes it with ITK and then writes it away using VTK
>again.  Where in the Insight tree could I add this?
>
>I had to add some code to the top-level CMakeLists.txt to add the
>ITK_CSWIG_CONNECTVTKITK option (if CSWIG wrapping is active) and to mark
>it as advanced.  In addition, if this option is ON, the CMakeLists in
>Wrapping/CSwig has to make use of FindVTK.cmake as well.
>
>Thanks,
>Charl
>
>-- 
>charl p. botha http://cpbotha . net/ http://visualisation . tudelft . nl/