View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Snakes with class

5.0 | 1 rating Rate this file 23 Downloads (last 30 days) File Size: 8.8 KB File ID: #26124 Version: 1.0
image thumbnail

Snakes with class


Cris Luengo (view profile)


Implementation of snakes using a class to enable automatic display of the snake over an image.

| Watch this File

File Information

This package implements snakes (active contours) through a class `dip_snake`. The function `snakeminimize` modifies the snake to move it to a lower energy configuration, which typically corresponds to the snake following edges in an image. When the semicolon is left off a statement that returns an object of this class, the snake is automatically drawn on top of the image in the current figure window.

`snakeminimize` is very general in the sense that it can be used to implement many types of snakes found in the literature. The snake's external force is an input parameter, and hence the user can implement the GVF (gradient vector flow) or VFC (vector field convolution) external forces, or simply use the gradient. The balloon force is included.

This package add to and builds on DIPimage, a scientific image analysis toolbox for MATLAB. See


Parametric Active Model Toolbox inspired this file.

MATLAB release MATLAB 7.9 (R2009b)
Other requirements DIPimage version 2.1 or newer - obtainable from
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
21 Sep 2012 Isabel

Isabel (view profile)

21 Sep 2012 Cris Luengo

Cris Luengo (view profile)


If you have your images already read into MATLAB, you can directly use them as input to DIPimage toolbox functions. To convert a MATLAB array to a DIPimage image object, use the function `dip_image`.

Alternatively, if you install the Bio-Formats library, as explained in one of the notes in the help for the `readim` function, you'll be able to read in DICOM files directly as DIPimage images.

Hope this helps!

Comment only
20 Sep 2012 Isabel

Isabel (view profile)

Dear Cris,

I'm working with MRI images in 3D and I have my pile of images in a "images.mat" how can I read the images with the DIP image toolbox? the original format of the images is .dcm

Thank you

Comment only
14 Oct 2010 Cris Luengo

Cris Luengo (view profile)


It's explained in the README file inside the ZIP that you download here. You need to install DIPimage (from Then copy the two M-files "snakeminimize.m" and "dip_snake.m" to the "dip/common/dipimage/" directory and the M-file "private/paramtype_snake.m" to "dip/common/dipimage/private/". You might need to CLEAR FUNCTIONS before you can use these functions.

Please let me know what it is that is not working!


Comment only
14 Oct 2010 Vivek

Vivek (view profile)

i'm having Matlab 7.8.0 R2009 in windows platform, could you please let me know, how to run this file?

Comment only

Contact us