Various pieces of software that I have written

  1. Matlab code for: αLBP and IαLBP texture descriptors (now with optional mask). (The zip archive also includes code for Chi2 distance computation distChiSq.m)
    The method is described in:
    • M Delić, J. Lindblad, and N. Sladoje. αLBP - a Novel Member of the Local Binary Pattern Family Based on α-cutting. In Proceedings of the 9th IEEE International Symposium on Image and Signal Processing and Analysis (ISPA), IEEE, pp. 13-18, Zagreb, Croatia, Sept. 2015. doi:10.1109/ISPA.2015.7306025
  2. Matlab code for: Fast surface area estimation of crisp 3D objects in a cubic grid.
    The method is described in:
    • J. Lindblad. Surface Area Estimation of Digitized 3D Objects using Weighted Local Configurations. Image and Vision Computing, Vol. 23, No. 2, pp. 111-122, 2005. doi:10.1016/j.imavis.2004.06.012
  3. Matlab code for: spline based background compensation.
    The method is described in:
    • J. Lindblad and E. Bengtsson. A comparison of methods for estimation of intensity nonuniformities in 2D and 3D microscope images of fluorescence stained cells. In Proceedings of the 12th Scandinavian Conference on Image Analysis (SCIA), pp. 264-271, Bergen, Norway, June 2001. pdf
  4. Matlab code for: continuous histogram thresholding.
    The method is described in:
    • J. Lindblad. Histogram thresholding using kernel density estimates. In Proceedings of the Swedish Society for Automated Image Analysis (SSAB) Symposium on Image Analysis, pp. 41-44, Halmstad, Sweden, March 2000. pdf
  5. Matlab code for: Kittler & Illingworth - Minimum error thresholding.
    Algorithm is the direct (non-iterative) version from
    • Glasbey, C. A. 1993. "An analysis of histogram-based thresholding algorithms." Graphical Models and Image Processing, 55(6): 532-7.

Software internal for the Centre for Image Analysis below

Most executables are to be found in ~joakim/local/$HOSTTYPE/bin where $HOSTTYPE is the output of uname -m (presumably x86_64).
Architecture independent files (e.g. scripts) are in ~joakim/local/noarch/bin (notably voxview and mcview).

Most executables can be made to run under windows. Talk to me if you wish to do that.

Note, some of the linked pages are only locally accessible.


Interactive surface rendered 3D viewer (also accessible from JLib).

To rotate your 3D object, use left mouse button. To move, use middle. To scale, use right (and move up/down) or +/- on the keyboard.

There are lots of keys to press, do check the output of gfx_engine -h : README_gfx_engine

ipad2nff, voxview and mcview

For converting ipad volumes to nff surfaces.
Use voxview file.ipad or mcview file.ipad for conversion + launch of gfx_engine.


Compute illumination by ambient occlution.

Prova att följa receptet i /home/joakim/proj/paper/ambocc (nedan) och se om det hjälper. Är den vägen jag vandrade för de sista bilder jag gjort. Kör vtks triangelreducerare för att få ner antalet lite (mål 0.5=50%).

joakim@majestix ~ $ cat /home/joakim/proj/paper/ambocc
#input filename without extension
#triangulate with decimation (raw or vtk input)

~joakim/proj/paper/vtk/ segm1.raw segm1_deci.ply  1 0.5

#editera ply-filen till rudinemntär nff-fil (se nedan)
head -n 15 segm1_deci.ply

~joakim/bin/ply2nff segm1_deci.ply segm1_deci.nff tal1 tal2

~joakim/local/x86_64/bin/ambocc -g 2048x2048 -n 2 segm1_deci.nff segm1_deci_amb.nff

~joakim/local/x86_64/bin/gfx_engine segm1_deci_amb.nff

Eller ange ljus på kommandoraden: gfx_engine -G 1024x1024 -A 128 -C -l "(2900,1200,2200,2.0,2.0,2.0,0.4,0.4,0.4,0,0,0)" $1 -P"(0,0,0,1,0,0,0,0,-1)" -s 0.2
som jag använt mig av för pappersrenderingar (notera -C som kör capture endast utan att visa på skärm).

Ifall hörnen på volymen blir mörka, prova att köra : -s 0.5 som ytterligare parameter till ambocc för att skala ner objektet 50%.


wxview är en image viewer som inte laddar in hela 3D bilder i minnet utan bara ett snitt i taget, så att det går lite snabbare att snabbkolla stora filer.

Usage: wxview [-h] [-f] [-a] [-s <str>] [-b <num>] [-l <num>] [-H <num>] [Image...]
  -h, --help            Display usage info
  -f, --float           Floating point data
  -a, --autofit         Auto-fit size
  -s, --size=<str>      RAW XxY size, default 2048x2048
  -b, --bpv=<num>       Bits per pixel, default 8 (32 for float)
  -l, --levels=<num>    Non-zero intensity-levels, default 2^bpv-1
  -H, --header=<num>    Header bytes before data, default 0

  +/- = skala
  *// = ljusare/mörkare
  a   = autofit (fit på nya bilder)
  f   = fit
  F   = scale 1:1
  n/p = next/prev image (from command line)
  N/P = first/last image
ctrl-F = maximize window

 hö/vä = +1/-1 i z
up/ner = +10/-10 i z
 pu/pd = +100/-100 i z
 hm/ed = first/last i z

Kan ladda ipad bilder (men regioner blir än så länge i gråskala). Note that save is only 2D, and I don't think it saves ipad images.

You will want to browse through slices (first one is just black), this you can do with arrows left/right, to move 10 slices per step use up/down (and 100 at a time with pgup/pgdn).

In lower right corner is written pixel value at current position and current slice/total (starting from zero).

Efter att ha tittat på FOX-toolkit och FLTK så bidde det till slut wxWidgets, ett val jag idag är helt nöjd med. (


In the spirit of free code and also trying to reduce the numbers of reinvented wheels in the house I have put together my IMP functions in a library called J-Lib. This was initiated by the need for Mikael, Carolina and I to work on a common code base, but has grown to include other users in the house also. The more users the better I believe and therefore I have lately tried to streamline the installation procedure to the most, and today I think it is time for a public release.

If you like to get some new functionality of your IMP (a new menu, better makefiles (in my eyes at least) and some handy functions) then I encourage you to read through this file and become a JLib-user.


Please read the installation instructions carefully. If you do, I hope that you will have no problems at all.

Don't forget to give me feedback on what you like and what you don't like, as well as if you wish to be included in the jlib-maillist which I am running.

Linux install of IMP/JLib

Follow instructions in file:///usr/users/joakim/imp/public/distro/README