Ilastik installation — the easy way using conda!

Sure, go ahead and download the binaries from the page. You are done and this page is noise for you.

If, on the other hand, you need to get the latest Ilastik version and some feature you only know about because you are deep into things… then you might njoy this nice page:

Interested in tracking?

Once you reach point 2 on that page, use a modified version of  this line:

  • env CPLEX_ROOT_DIR=~/Applications/IBM/ILOG/CPLEX_Studio126 conda install --channel stuarteberg ilastik-deps-tracking

Note: precondition is to have a running version of CPLEX installed on your machine.

If you set your .bashrc correctly, this should now start ilastik for you:

  1. source activate ilastikenv
  2. PYTHONPATH="ilastik:lazyflow:volumina" python ilastik/

Note: Step two above works if you are in the ‘ilastik-meta’ git repository. All libraries dowloaded for the conda environment are below your conda installation folder (in env/ilastikenv).

Hope this does the trick and your ilastik start screen looks somewhat like this:


If CPLEX refuses to work on your machine, here a description for how to get CPLEX running:

Does ilastik not show you the tracking workflows after you installed as described above — you might miss the necessary CPLEX dylibs. Here an excerpt of the ilastik installation documentation for how to create them:

First figure which gcc version you use by calling…

gcc --version

and look at the output. This should be either GCC 4.2.1, or Apple LLVM (clang). The folders used to specify the location of the libraries in cases involving clang depend on whether you installed from cplex_studio1251.macos.bin or cplex_studio1251.osx.bin. If you installed the first one, you need to replace x86-64_osx by x86-64_darwin.

  • If the compiler is GCC 4.2.1, use the commands below (in the respective folders where the files are located)
    g++ -fpic -shared -Wl,-all_load libcplex.a -Wl,-noall_load -o libcplex.dylib
    g++ -fpic -shared -Wl,-all_load libilocplex.a -Wl,-noall_load -o libilocplex.dylib
    g++ -fpic -shared -Wl,-all_load libconcert.a -Wl,-noall_load -o libconcert.dylib
  • If the compiler is clang and you have OSX version < 10.9, then you need to supply the symbols of cplex and concert when building libilocplex.dylib:
    g++ -fpic -shared -Wl,-all_load libcplex.a -Wl,-noall_load -o libcplex.dylib
    g++ -fpic -shared -Wl,-all_load libconcert.a -Wl,-noall_load -o libconcert.dylib
    g++ -fpic -shared -Wl,-all_load libilocplex.a -Wl,-noall_load -L. -L../../../../concert/lib/x86-64_osx/static_pic -lcplex -lconcert -o libilocplex.dylib
  • If the compiler is clang and you have OSX 10.9 Mavericks, then you need to specify the correct C++ standard library to use in addition to the commands above:
    g++ -fpic -shared -Wl,-all_load libcplex.a -Wl,-noall_load -stdlib=libstdc++ -o libcplex.dylib
    g++ -fpic -shared -Wl,-all_load libconcert.a -Wl,-noall_load -stdlib=libstdc++ -o libconcert.dylib
    g++ -fpic -shared -Wl,-all_load libilocplex.a -Wl,-noall_load -L. -L../../../../concert/lib/x86-64_osx/static_pic -lcplex -lconcert -stdlib=libstdc++ -o libilocplex.dylib
    install_name_tool -id @executable_path/../Frameworks/libcplex.dylib libcplex.dylib
    install_name_tool -id @executable_path/../Frameworks/libconcert.dylib libconcert.dylib
    install_name_tool -id @executable_path/../Frameworks/libilocplex.dylib libilocplex.dylib
    install_name_tool -change libcplex.dylib @executable_path/../Frameworks/libcplex.dylib libilocplex.dylib
    install_name_tool -change libconcert.dylib @executable_path/../Frameworks/libconcert.dylib libilocplex.dylib

If you replace ‘@executable_path/../Frameworks' by the absolute path (this is in fact required for the whole thing to work with conda) to respective libraries you are guarenteed to

  • get working dylibs, and
  • prevent any reuse in different location... ;) 

otool -L <library-name> can be used to check if your dylib mods where successful.

Change the Fiji temp Folder (by passing JVM arguments)

Why? For example if you run Fiji headless on a cluster and you would like it to use a fast local folder instead of a network drive.

This page tells you how you can pass on JVM arguments to Fiji upon start:

One can specify the “temp” directory using the following command:

$ fiji -- &

Double dash at the end is required to specify that the given argument is for Java.

Debugging Fiji/ImageJ App

You can reproduce some misbehavior / bug in Fiji – good! But what next?

You could post your problem on the ImageJ mailing list and hope somebody solves the problem  for you, or you could debug the problem yourself. The page below shows you how you can attach eclipse in debug mode to a running (and failing) Fiji/ImageJ instance. Very cool!

Find JAR Containing Specific Class

Tons of JARs are in the classpath of Fiji. Multiple JARs might contain the same class definition.

In order to know which JAR is the one hosting the version Fiji is actually using (this is determined by the order those JARs are found in the CLASSPATH), you can use this handy function from within Fiji.

Start Fiji – hit ctrl+L or cmd+L on your keyboard – type ‘jar’ in the search field – start ‘Find jar for class’ and type the name of the class + the entire package information as shown below – hit ‘Ok’ – done!