Posts Tagged ‘DIPimage’

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.

(more…)

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).

(more…)

DIPimage 2.6 released

Monday, April 14th, 2014

Today we released version 2.6 of DIPimage and DIPlib. The change list is rather short. There are two items that I think are important: 1) We fixed a bug that caused an unnecessary copy of the output image(s) in the DIPlib-MEX interface, slowing down functions especially for large images. 2) We introduced a new setting to automatically make use of a feature introduced in the previous release.

(more…)

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.

(more…)

DIPimage 2.4 released

Thursday, January 12th, 2012

I’m pleased to announce that a new version of DIPimage has been released. There’s some performance improvements, some bug fixes, and some new functions. The measure function has some new features also, that use the convex hull of the objects. The Feret measure is computed differently now, also using the convex hull. This makes this computation more accurate and also somewhat faster.

But most importantly, we have rewritten a lot of the code that does binary arithmetic and logic operators. Binary here means these operators take two inputs. +, -, *, &, > and == are examples of binary operators. All of these used to be computed using MATLAB code, which required some nifty tricks. For example, computations between images of different type (i.e. an 8-bit integer image added to an 16-bit integer image) used to require data conversion because MATLAB cannot perform such a computation. All of these binary operators are now computed by DIPlib instead. This makes some cases much more efficient. We parallelized the arithmetic and logic code in DIPlib for further speed improvements.

(more…)