Posts Tagged ‘class’

Adding a parameter type to DIPimage

Monday, December 28th, 2009

In this post I want to show how to enable to DIPimage GUI to work with a new data type. In a previous post we developed a new class, dip_snake, for use with the function snakeminimize. The fully developed version of snakeminimize, which you can download here, integrates with the DIPimage GUI and uses DIPimage’s built-in automatic parameter parsing. We actually need to do something to DIPimage to get all that to work, because the dip_snake class is unknown to DIPimage. This post explains how to teach DIPimage about a new parameter type.
Note: This post is meant as a tutorial for people developing DIPimage applications, and contains nothing of interest to anybody else. If you’re not developing for DIPimage, you might want to look here instead.


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.