-
Notifications
You must be signed in to change notification settings - Fork 5
AddingVTKTeem
This shows how to add teem and vtkTeem to a binary installation of DeVIDE. teem is great software that is used by both SciRun and slicer for diffusion tensor imaging (DTI), and now you can add it to the DeVIDE kool-aid for even more fun.
First read AddingVTKLibsToBinaryDeVIDE for some background on building external VTK-based libaries for binary DeVIDE installations.
Download the source to teem 1.10 from here. Unpack and do an out of source build with cmake according to these instructions. CMAKE_BUILD_TYPE should be RelWithDebInfo and BUILD_SHARED_LIBS should be set to on.
Use the DRE ccmake, which you can find in devide-re/cmake/bin/ccmake
Get a vtkTeem checkout by doing the following:
svn co http://svn.slicer.org/Slicer3/trunk/Libs/vtkTeem -r 8877
vtkTeem builds by default with TCL wrappings, but we want Python. So, modify the vtkTeem CMakeLists.txt file by changing all occurrences of TCL to Python (and for example tcl to python), taking care to match capitalisation. vtkImagingPython, vtkIOPython and vtkGraphicsPython should further get a 'D' appended, for example vtkImagingPython becomes vtkImagingPythonD.
Also add the following line to just before the vtk_wrap_tcl3 -> vtk_wrap_python3 line:
INCLUDE_DIRECTORIES("${VTK_PYTHON_INCLUDE_DIR}")
Do an out-of-source build of vtkTeem with cmake, using the DeVIDE VTK binaries as explained in AddingVTKLibsToBinaryDeVIDE as well as the teem you just built. Very important: As stated in the mentioned page, do all of this in a shell / command window in which you've executed "dre shell"
You should set the VTK_DIR, the Teem_DIR and the CMAKE_BUILD_TYPE to RelWithDebInfo.
If your vtkTeem out-of-source build was done in /some/dir/vtkTeem-build, start up DeVIDE as follows:
devide --extra-module-paths /some/dir/vtkTeem-build
You should now be able to do the following in the DeVIDE Window | Python Shell to test:
import libvtkTeem as vtkteem
r = vtkteem.vtkNRRDReader()