vmtk
Recent Changes - Search:

vmtk

projects

links

edit SideBar

Main / Installation

Installation instructions

Installing binary packages

Binary packages are available thanks to the hard work of Johannes Ring, from Simula Research Laboratory and Kalkulo, Oslo, Norway, in the vmtk packaging project funded from Orobix.

Ubuntu packages

Starting with vmtk 0.9, vmtk has become an official Debian package. This means that the package will be automatically available for Debian and Ubuntu releases in the future.

The Ubuntu packages are now available in the PPA on Launchpad for the following Ubuntu versions:

  • Ubuntu 10.10 (Maverick Meerkat)
  • Ubuntu 10.04 (Lucid Lynx)
  • Ubuntu 9.10 (Karmic Koala)
  • Ubuntu 9.04 (Jaunty Jackalope)

both 32 and 64 bit.

The instructions for installing vmtk on Ubuntu 10.10 (Maverick), Ubuntu 10.04 (Lucid) and Ubuntu 9.10 (Karmic) are as follows:

 sudo add-apt-repository ppa:vmtk-packaging/ppa
 sudo apt-get update
 sudo apt-get install vmtk

Ubuntu 9.04 (Jaunty) doesn't have the add-apt-repository command so the instructions are somewhat different. First one must add the repository (type the command below in one single line):

 echo "deb http://ppa.launchpad.net/vmtk-packaging/ppa/ubuntu jaunty main" |
 sudo tee /etc/apt/sources.list.d/vmtk-packaging-jaunty.list

Then add the OpenPGP key to authenticate the packages

 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key CB219EE2

Then update and install as above:

 sudo apt-get update
 sudo apt-get install vmtk

Mac OSX packages

There are two different packages for Leopard and Snow Leopard:

  • Leopard users should download the vmtk-0.9.0-osx10.5-i386.dmg package
  • Snow Leopard users should download the vmtk-0.9.0-osx10.6-universal.dmg package

Once downloaded, just drag the MacOSX package to the Applications folder (or any other location). Double-clicking the package will fire up vmtk within PypePad.

If you want to have vmtk available at the Terminal, just cut and paste the following line

 source /Applications/vmtk.app/Contents/MacOS/vmtk

into the .profile file in your home directory and restart a new Terminal (or start a new tab). At this point, not only vmtk becomes available at the command line, but you also get vmtk and VTK, Python-wrapped, for free! Just fire up a terminal, enter the python shell and type

 from vmtk import vmtkscripts
 from vmtk import vtkvmtk
 import vtk

and you have access to all vmtkscripts and Python-wrapped vmtk and VTK classes. In addition, the package also contains pre-compiled VTK and ITK libraries and header files to develop their applications in C++.

Windows installers

After you download the proper architecture (32bit vs 64bit - if in doubt go for 32bit), just run the installer. It will take you through the installation stage, after which you'll find vmtk in your start menu. Click on vmtk, and you'll see PypePad ready for use.

Note that, along with vmtk, the installer directly provides a Python interpreter, Python-wrapped vmtk and VTK classes, and vmtk, VTK, ITK dll's and header files to develop new applications in Python and C++.

Compiling from source - Updated Sept 29, 2011

Note: The vmtk development version is now based on SuperBuild, a CMake feature that allows to automatically download and compile dependencies (in our case VTK and ITK). This makes the whole process a lot easier than it was up until version 0.9. Make sure you update your notes based on the instructions below.

Requirements

vmtk is cross-platform and will compile and work on Linux, Mac OSX and Windows. Just so you know, all the development and testing is performed under Linux and Mac OSX.

In order to successfully compile and use vmtk, the following software has to be installed in your system:

Installation

  • Checkout the development version from the Sourceforge Git repository:
    git clone git://vmtk.git.sourceforge.net/gitroot/vmtk/vmtk if you have troubles with this repository try Luca's clone on Github git clone https://github.com/lantiga/vmtk.git
    * Create a build directory and cd into it
    mkdir vmtk-build
    cd vmtk-build
  • Run CMake with the directory where the vmtk source tree is located as an argument. Follow the instructions. This will generate Makefiles for your build. If you don't know how to use CMake and you can't figure it out by yourself, take a look at this page
    ccmake path-to-vmtk-source-directory
  • Compile and install vmtk. This will download and compile both VTK and ITK in the background, so it will typically take a long time. The build process will automatically install your project in the vmtk-build/Install directory
    make
  • Set a couple of environment variables. For Bash users, type the lines below or add them to your .bash_profile or .bashrc file (the difference is that with .bash_profile you have to logout and login back again for them to have an effect, and it may not work when logging in from graphical login managers; on the other side, .bashrc is read everytime a user opens up a terminal, so it's executed more often but it's safer). For Mac users, the file is named .profile, always in your home directory.
    For Linux:
    VMTKHOME=/path-to-vmtk-build/Install
    export PATH=$VMTKHOME/bin:$PATH
    export LD_LIBRARY_PATH=$VMTKHOME/lib/vtk-5.8:$VMTKHOME/lib/vmtk:$VMTKHOME/lib/InsightToolkit:$LD_LIBRARY_PATH
    export PYTHONPATH=$VMTKHOME/bin/Python:$VMTKHOME/lib/vtk-5.8:$VMTKHOME/lib/vmtk:$PYTHONPATH
    For Mac (the file where you should put the environment variables is .profile in your home directory):
    VMTKHOME=/path-to-vmtk-build/Install
    export PATH=$VMTKHOME/bin:$PATH
    export DYLD_LIBRARY_PATH=$VMTKHOME/lib/vtk-5.8:$VMTKHOME/lib/vmtk:$VMTKHOME/lib/InsightToolkit:$DYLD_LIBRARY_PATH
    export PYTHONPATH=$VMTKHOME/bin/Python:$VMTKHOME/lib/vtk-5.8:$VMTKHOME/lib/vmtk:$PYTHONPATH
    Note that in the above I assume vtk is at version 5.8. It might not be if I forget to update the instructions. Check the directory name if this doesn't work.
  • Enjoy

Notes for compiling in Windows

Hugo Gratama van Andel and Joppe Schneiders, with the contribution of Rocco Gasteiger, have created a great How to compile VMTK on windows with MS Visual Studio guide. Click on the link to download it in pdf format.

Older note for those who upgrade to 0.7 from versions prior to 0.6

Starting with 0.6, the vmtk Python module has been created. This means that the global namespace doesn't get polluted, which is much cleaner and makes more sense. However,

  • users who upgrade from versions prior to 0.6 and who compiled vmtk from source should delete the /usr/local/lib/vmtk directory before installing 0.7
  • users who were using vmtk from Python (i.e. not from the command line, but from a Python shell or a custom Python script), should change the way they import vmtk. The change is from import vtkvmtk or import vmtkimagereader to from vmtk import vtkvmtk or from vmtk import vmtkimagereader, respectively.

Older notes for compiling in Windows

Thanks to Pieter Kitslaar, these are fixes for building vmtk 0.6 under Windows and Python 2.5. With the advent of vmtk 0.7, the fixes should have been all incorporated, but please post on the mailing list if you encounter any problems.

  • SVN Checkout vmtk to: d:\src\vmtk
  • Run Cmake
    • Visual Studio
    • Binary dir: d:\src\vmtk-build** CMAKE_INSTALL_PREFIX: d:\src\vmtk-bin
  • Go to d:\src\vmtk-build and lauch VMTK.sln
    • Build ALL_BUILD project in Release mode (ITK and VTK libs only build for release otherwise the linker will complain)
    • Build INSTALL project
  • Go to d:\src\vmtk-bin the directory structure should look like
    • bin\ # windows DLL's
    • include\vmtk\ # c++ header files
    • lib\vtmk\ # windows libs
    • lib\vmtk\vmtk\ # python classes and DLL's
  • For Python 2.5 all the .DLL files in d:\src\vmtk-bin\lib\vmtk\vtmk should be renamed to .pyd
    • vtkITKPython.dll -> vtkITKPython.pyd
    • vtkvmtkCommonPython.dll -> vtkvmtkCommonPython.pyd
    • vtkvmtkComputationalGeometryPython.dll -> vtkvmtkComputationalGeometryPython.pyd
    • vtkvmtkDifferentialGeometryPython.dll -> vtkvmtkDifferentialGeometryPython.pyd
    • vtkvmtkIOPython.dll -> vtkvmtkIOPython.pyd
    • vtkvmtkMiscPython.dll -> vtkvmtkMiscPython.pyd
  • Add d:\src\vmtk-bin\bin to the PATH environment variable
  • Add d:\src\vmtk-bin\lib\vmtk to the PYTHONPATH environment variable
  • Rename the vmtk.py in the d:\src\vmtk-bin\bin dir to vmtk-exe.py (Windows has a problem importing the vmtk module from a file named vmtk.py)
  • Run the vmtk-exe.py (from a command prompt).

Thanks Pieter! I incorporated the fixes in the SVN version, they will be included in the next release.

Extra notes for Windows users

There seems to be a problem in compiling the official VTK release (5.0.4) with Python wrapping ON and TCL wrapping OFF. For VTK this can be fixed by setting the VTK_USE_TK boolean to OFF in the advanced values. However when one tries to run Cmake on VMTK it starts getting into trouble again because in the VTK cmake files TCL and Python wrapping are closely connected.

The CVS version of VTK doesn't have this problem so we advise to use the CVS version of VTK if one only wants Python wrapping and not TCL.

Thanks to Pieter for the advice, and to Joshua Kwan, who first spotted the problem.

Anyone who wants to volunteer for creating a binary release for Windows is encouraged to contact me!

Edit - History - Print - Recent Changes - Search
Page last modified on September 30, 2011, at 10:24 AM