Insight Toolkit Ubuntu Repository

I have put together a Ubuntu repository for the Insight Toolkit (ITK). This repository provides insighttoolkit packages for Ubuntu 8.04 (Hardy Heron), 8.10 (Intrepid Ibex), 9.04 (Jaunty Jackalope), 9.10 (Karmic Koala), 10.04 (Lucid Lynx), 10.10 (Maverick Meerkat), and 11.04 (Natty Narwhal). Additionally, I have created a package for the python wrappings of ITK (WrapITK). Similar to the VTK wrapping already in the Ubuntu repository (python-vtk).

Add My Repository

Fist, download the correct sources.list file for your distribution

  • Ubuntu 8.04 LTS “Hardy Heron”:
    sudo wget\
    hardy.list -O /etc/apt/sources.list.d/paulnovo.list
  • Ubuntu 8.10 “Intrepid Ibex”:
    sudo wget\
    intrepid.list -O /etc/apt/sources.list.d/paulnovo.list
  • Ubuntu 9.04 “Jaunty Jackalope”:
    sudo wget\
    jaunty.list -O /etc/apt/sources.list.d/paulnovo.list
  • Ubuntu 9.10 “Karmic Koala”:
    sudo wget\
    karmic.list -O /etc/apt/sources.list.d/paulnovo.list
  • Ubuntu 10.04 LTS “Lucid Lynx”:
    sudo wget\
    lucid.list -O /etc/apt/sources.list.d/paulnovo.list
  • Ubuntu 10.10 “Maverick Meerkat”:
    sudo wget\
    maverick.list -O /etc/apt/sources.list.d/paulnovo.list
  • Ubuntu 11.04 “Natty Narwhal”:
    sudo wget\
    natty.list -O /etc/apt/sources.list.d/paulnovo.list

Then, install my gpg public key and update apt
wget -O- | sudo apt-key add -
sudo apt-get update

If you are upgrading distributions (ie hardy to intrepid), type the following and you should be all set. If this is fresh install, skip this and continue to the next section.
sudo apt-get dist-upgrade
sudo apt-get install insighttoolkit

Install Packages

Apt-get is now aware of the packages in my repository. Before we can install anything, be careful and remove old versions of ITK.
sudo apt-get remove libinsighttoolkit3.0

Just install all the new packages. Be forewarned, the python-insighttoolkit is rather large, about 70MB download and 400MB installed.
sudo apt-get install insighttoolkit python-insighttoolkit

For extra functionality install the python-insighttoolkit-extras package. This package provides easy conversion between ITK images and numpy, plus connectors between ITK and VTK. This package will install VTK though, which is another big install.
sudo apt-get install python-insighttoolkit-extras

If you would like the python docstring documentation I describe here, just install the insighttoolkit-doc package.
sudo apt-get install insighttoolkit-doc

Thats it! Please look at my other Tips & HowTos for examples.


  1. Can you make available the build tools that create these packages?

    I’m already using python-vtk, will your packages clash with it?

    Thanks for the resource!

  2. All of the source and debian build settings are available in my repository. If you are in ubuntu or debian, just add my repositories as described in this article then:

    apt-get source insighttoolkit
    apt-get source python-insighttoolkit-extras

    This will download all the source to the current directory. There is a good intro on how to make the packages from this source here:

    Good luck, and if you need help send me an email.

  3. In fact, python-vtk is a dependancy of my python-insighttoolkit-extras package. Check out my tutorial Getting Started with Python-InsightToolkit on how to communicate between itk and vtk in python.

  4. Hi,
    does anybody have any tips how to get eclipse or netbeans to autocomplete the itk python functions?
    ipython2.5 on ubuntu jaunty works fine, and does autocomplete itk stuff: for instance writing:
    imageReader = itk.ImageFileR[tab] expands to ..Reader, however this never happens in eclipse or netbeans, even though they autocomplete regular python stuff.

  5. Hi,
    I used your packages in Intrepid with much success – thanks very much. I tried installing them in Jaunty, which successful installed, but I can’t import the module (“import itk”) in ipython. It states there is no module called itk. Is there something simple I’m missing or will the intrepid package just not work in jaunty?


  6. I am putting together the Jaunty packages at the moment. The reason itk does not work in jaunty is because of the switch from python 2.5 to 2.6. Python2.5 should still be installed on you system, and if you start python2.5 instead of python, the itk packages are available.

    To get itk working in python 2.6 is a simple fix, but I would recommend just waiting for me to release packages for jaunty.

  7. Hi. A real beginner here I’m afraid. I installed ITK via your repository.

    I’m now trying to run the first program from the ITK documentation.

    The documentation says I must specify the directory where ITK is built and when I try and run the Cmake file I get “ITK not found”.

    Can you let me know what directory I should use?



  8. This is working well for me in Jaunty. I’m using the python ITK+VTK setup to quickly test and experiment. I then write it in C++ for the main program. Thanks for the packages, as the standard distro packages don’t quite cut it!

  9. To be able to build your own ITK projects, you need the dev package. This should automatically set everything up so CMake can find everything. To install the dev package just type in the following:

    sudo apt-get install libinsighttoolkit-dev

  10. I’m trying to build an application using the itk zlib. Unfortunately I’can’t find the corresponding header file itk_zlib.h with your build version of itk 3.16. Am I missing something?

  11. @Stefan: itk_zlib.h should be in the libinsighttoolkit-dev package. If you run

    sudo apt-get install libinsighttoolkit-dev

    itk_zlib.h should be in /usr/include/InsightToolkit/Utilities/

  12. Thanks for providing the libs. I am trying to build a free meshing program(IA-FEMesh) on my 64 bit Karmic. I had to install your ITK libs and dev. But still getting a missing lib during link:
    /usr/bin/ld: cannot find -litkzlib
    now is that the same as libITKznz that seems to be installed??
    Thanks in advance

  13. @osman:
    OK. I experimented by making changes to the cmake files to replace -litkzlib with -lITKznz and it worked. I got executables and they work ok.
    Thanks again for the ubuntu repositories.

  14. Very appreciate your efforts.

    does your mentioned dev package contain all libraries in both InsightToolKit and InsightApplications? is this dev package version 3.18.0?

  15. very good job, thank you very much!!

  16. @Sam: It does not include InsightApplications. The current version is 3.20.0.

  17. Hello,

    I am using this ITK package and have following Problem with pipelining:
    if I try to run the code below, I get an error with the text: ‘TypeError: Type error. Got _p_itk__SmartPointerTitk__LaplacianImageFilterTitk__ImageTfloat_3u_t_itk__ImageTfloat_3u_t_t_t, expected _p_itk__SmartPointerTitk__ImageTfloat_3u_t_t’

    Has anyone an idea, how the bug is to be fixed.

    The code is:
    imageType = itk.Image[itk.F, 3]
    reader = itk.ImageFileReader[imageType].New(FileName = ‘file_name.mhd’)
    image = reader.GetOutput()
    laplacianImageFilter = itk.LaplacianImageFilter[image, image].New(Input = image)
    subtractImageFilter = itk.SubtractImageFilter[image, image, image].New(
    Input1 = image, Input2=laplacianImageFilter)

  18. @Andrey: When you set the input of one filter with the output of another, you need to use the GetOutput function. So your last line should be

    subtractImageFilter = itk.SubtractImageFilter[image, image, image].New(
    Input1 = image, Input2=laplacianImageFilter.GetOutput())

  19. Can you tell what templating is possible, i.e. does GradientImageFilter support image type [itk.F,3]?

  20. Are you using ipython? I use ipython’s autocomplete to tell if a filter supports different types.

    For example, if you type:
    a = itk.GradientImageFilter.
    and then hit Tab, you will get a list of its member functions along with this:


    It takes a bit to get used to this info, these describe the available templates. IF3FF corresponds to:
    itk::GradientImageFilter<itk::Image<float, 3>, float, float>

  21. Great! Using Ipython I still get to know practical tricks. Thanks a lot !

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>