Posts Tagged ‘DIPlib’

Efficient algorithms vs efficient code

Saturday, October 21st, 2017

Since I have spent quite a bit of time porting 25-year old code, I have been confronted with the significant changes to CPU architecture over that time. Code in DIPlib used to be very efficient back then, but some optimizations did not age well at all. I want to show some examples here. It is nice to see that a little bit of effort into optimization can go a long way.

I also want to give a quick example of a highly optimized implementation of an inefficient algorithm, which highlights the difference between algorithms and code.


Presenting DIPlib 3.0

Sunday, August 20th, 2017

DIPimage is a MATLAB toolbox for quantitative image analysis. We’ve got quite a few users, especially in academia. However, few of those users (as far as I know) have ventured down the path of directly using DIPlib, the C library that DIPimage is built upon. I know of two people, outside of the group at Delft University of Technology where we developed DIPlib and DIPimage, that have written C code that uses DIPlib. And that is too bad, because it’s a wonderful library. There are two reasons for this lack of uptake: it has a very steep learning curve, and it is not open source. The second reason makes the first one worse, because there’s very little example source code to look at for learning to use the library.

Back in 2014 I started dreaming of porting DIPlib to C++, and making it open source. Modern C++ is a very expressive language, and writing code that uses a C++ version of DIPlib doesn’t need to be much more complicated that writing the equivalent MATLAB code. The port would allow moving some of the innovations we introduced in DIPimage into the DIPlib library, such as tensor (vector or matrix) images, color space management, etc. I did write a first version of the dip::Image class to test and learn how the library could look, and write proposals trying to convince people to help me build it, but otherwise didn’t put much effort into the project until last year. Over the last year and a half or so, I have invested a lot of my free time to build a whole new library infrastructure, and port over algorithms. The work is not nearly finished, but there already is a lot there, and I have been using it at work in production code. Even though I initially set out to port algorithms unmodified, I find myself improving code quite frequently, some algorithms are significantly faster than they were before (e.g. the Watershed, which now uses a correct implementation of Union-Find, and the labelling algorithm (connected component analysis), which now uses a completely different algorithm).


DIPimage 2.5.1 released

Friday, October 4th, 2013

We recently released a bugfix for DIPimage release 2.5. Since I didn’t announce the release of 2.5 here, this might be a good opportunity to review some of the improvements in 2.5.


DIPimage 2.2 released

Friday, March 19th, 2010

A new version of DIPimage and DIPlib has been released. You can get it at the the DIPlib website. This version fixes some bugs, adds compatibility for newer versions of MATLAB, and adds a few new functions. One interesting addition is that the function readim now will look for and use the Bio-Formats library if you install it. This means that a whole host of new image file formats are now readable. The Bio-Formats library is an open-source package created at the Laboratory for Optical and Computational Instrumentation (LOCI), University of Wisconsin-Madison. Unfortunately, their license doesn’t allow us to bundle the library with DIPimage. It is perfectly legal, however, for you to download and use the library.

DIPimage 2.1 released

Tuesday, August 4th, 2009

I’m pleased to announce we’ve released a new version of DIPimage and DIPlib, with several relevant changes. For a full list of changes, please see the DIPlib website, here I’ll review the most salient changes.