vmtk
Recent Changes - Search:

vmtk

projects

links

edit SideBar

Main / Installation

Installation instructions

Installing binary packages

Ubuntu packages

Thanks to Jonannes Ring, from Simula Research Laboratory, Oslo, Norway, vmtk packages for

  • Ubuntu 10.04 (Lucid Lynx)
  • Ubuntu 9.10 (Karmic Koala)
  • Ubuntu 9.04 (Jaunty Jackalope)
  • Ubuntu 8.10 (Intrepid Ibex)
  • Ubuntu 8.04 (Hardy Heron)

both 32 and 64 bit.

The nice thing about Ubuntu packages is that all dependencies are resolved for you (from Insight to VTK to Python). Basically you can have a working vmtk installation on a clean Ubuntu machine (both 32 and 64bit) in a matter of minutes. Just follow the instructions below (i.e. fire up a terminal and cut and paste the lines).

Note: if you upgraded Ubuntu to Jaunty or Intrepid from Hardy and had vmtk packages installed, you can remove one repository previously needed for ITK packages

 sudo rm -f /etc/apt/sources.list.d/paulnovo.list

since ITK packages made it to the official Debian repositories. The above is not mandatory, so you can keep it if you need it for other purposes.

If you're installing vmtk for the first time or you upgraded Ubuntu, do the following.

First add the Simula repositories:

for Ubuntu 10.04 (Lucid)

 sudo wget http://packages.simula.no/lucid.list -O /etc/apt/sources.list.d/simula.list

for Ubuntu 9.10 (Karmic)

 sudo wget http://packages.simula.no/karmic.list -O /etc/apt/sources.list.d/simula.list

for Ubuntu 9.04 (Jaunty)

 sudo wget http://packages.simula.no/jaunty.list -O /etc/apt/sources.list.d/simula.list

for Ubuntu 8.10 (Intrepid)

 sudo wget http://packages.simula.no/intrepid.list -O /etc/apt/sources.list.d/simula.list

for Ubuntu 8.04 (Hardy)

 sudo wget http://packages.simula.no/hardy.list -O /etc/apt/sources.list.d/simula.list
 sudo wget http://apt.paulnovo.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/paulnovo.list

then add the Simula public key:

 wget http://packages.simula.no/pubring.gpg -O- | sudo apt-key add -

if you're working on Ubuntu 8.04 Hardy, add Paul Novo's public key:

 wget http://apt.paulnovo.org/549EC7E2.key -O- | sudo apt-key add - 

finally, update the packages:

 sudo apt-get update 

and install the vmtk package:

 sudo apt-get install vmtk0-bin

At this point, for future vmtk releases, you will be able to upgrade to newer versions just by running the update tool provided in Ubuntu.

Compiling from source

Requirements

vmtk is cross-platform and will compile and work on Linux, Mac OSX and Windows. However, 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:

  • Python (>=2.3)
  • CMake (>=2.6)
  • VTK (>=5.4) (VTK needs to be compiled with Python wrapping turned on)
  • Insight (>= 3.10) (no Python wrapping is needed here)

Installation

  • Download and untar tar -zxvf the latest vmtk source release from Sourceforge:
    tar -zxvf vmtk-0.x.tar.gz
  • or checkout the development version from the Subversion repository (note that the latter can be in an unstable state):
    svn co https://vmtk.svn.sourceforge.net/svnroot/vmtk vmtk
  • 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 vmtk-source-directory
  • Compile and install vmtk. Make sure you have the necessary permissions to install. Installing is not really a must, if you know what you're doing
    make
    make install
  • 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).
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/vmtk
    export LD_LIBRARY_PATH
    PYTHONPATH=$PYTHONPATH:/usr/local/lib/vmtk
    export PYTHONPATH
  • Also, don't forget to also add the paths to the ITK shared libraries
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/InsightToolkit
    export LD_LIBRARY_PATH
    * Starting with VTK 5.3, don't forget to also add the paths to the VTK shared libraries
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/vtk-5.3
    export LD_LIBRARY_PATH
    * Enjoy

Notes for Max OSX users

  • You should compile VTK with X11 ON, and Cocoa and Carbon OFF. This to make sure that interaction with rendering windows works as expected.
  • The file where to put the library and module paths shown above is .profile. Instead of LD_LIBRARY_PATH, you should set DYLD_LIBRARY_PATH
    DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib/vmtk:/usr/local/lib/InsightToolkit
    export DYLD_LIBRARY_PATH

Notes for Windows users

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 Windows users

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 June 16, 2010, at 11:43 AM