Posts Tagged ‘indexing’

Implementing the dip_snake class

Monday, December 21st, 2009

In the previous post I showed how to implement active contours (a snake). I included the link to a set of files with a complete snake implementation to plug into DIPimage. This implementations uses a class called dip_snake. In this post I wanted to show how this class is defined using MATLAB’s new 1-file-style of class definitions. Well, “new” is not completely accurate, this feature has been around for a few releases already, but I’m slow to adapt… You’ll also learn how to make a class whose objects automatically create or update a figure window, much like an object of type dip_image does.

(more…)

DIPimage issues that I can’t solve

Tuesday, August 25th, 2009

Edit December 2018: Over the past two years I’ve been working on DIPimage 3, an updated version of DIPimage that is based on a rewritten DIPlib. Just about all of the issues discussed in this blog post have been resolved there, with the exception of the end operator, which will now do the wrong thing if used in curly braces (tensor indexing), and the limitation to the order of spatial and tensor indexing. We incurred a few backwards compatibility breaks, but it was necessary for the long-term health of the toolbox.

There are a few things in DIPimage that I’m annoyed with but can’t solve. Some of these are caused by the limitations of the MATLAB interpreter, and some are caused by my own poor design choices. DIPimage evolved over time to do things that I hadn’t at first even thought about, such as processing color images. Tensor and color images were “tagged on”, if you will, on top of the dip_image object, introducing some oddities and inconsistencies. To fix these up we would need to change existing behavior, which we don’t want to do because it would break too much existing code. This blog entry is about the few weird things with the dip_image object and how to work around them.

(more…)