File Exchange

image thumbnail

Active Contours implementation & test platform GUI

version 1.6 (2.45 MB) by

Implementation and demonstration of several active contours segmentation methods.

9 Ratings



View License

This program was written as a part of the “Medical Imaging” course. Together with Alex Blekhman ( my partner we have implemented the paper "Active Contours without Edges" by Tony Chan and Luminita Vese. We wrapped it up with a GUI to allow easy parameters change and segmentation process view and results storage for future analysis.
Later on we have added two existing implementation of additional methods to compare between the methods, and to learn each. The method are:
Implementation of "Level Set Evolution Without Re-initialization: A New Variational Formulation" in Proceedings of CVPR'05, vol. 1, pp. 430-436.
Author: Chunming Li, all rights reserved.
Implementation of "Localizing Region Based Active Contours" in “Image Processing, IEEE Transactions on “ im Nov. 2008 by Lankton and Tannenbaum.
Coded by: Shawn Lankton (
This is the place to thank both authors for the code contribution.
The users who download this code are welcome to play with it, to try and learn the above segmentation schemes. Moreover, additional methods can be added, and the GUI may serve as a convenient platform for segmentation methods understanding, analysis and comparisons.
Best segmenting you all!

Comments and Ratings (21)

Md. Hasnat

Nikolay S.

Nikolay S. (view profile)

Good evening to Saeid Shakeri & Reshma P M, and all the users of this submission.
I believe the bug you have reported is fixed now. Credits for sending me the file that caused the problems go to Nathan Bates.
Thanks for your help Nathan!

Nikolay S.

Nikolay S. (view profile)

Good day Saeid Shakeri.
Please contact me using my email (available in my user profile), and I'll see what can be done.

saeid shakeri

I have Reshma P M problem, too.
can everyone help me?
(MATLAB R2013a)

Nikolay S.

Nikolay S. (view profile)

Hi Reshma P M.
Thanks for the high grading
I propose emailing me (see my profile), with precise description of the issue you have. I've tried running the code, and it worked fine, so I'll need your help to reproduce the error.
Best regards.

Reshma P M

 The left hand side is initialized and has an empty range of indices.
However, the right hand side returned one or more results.

Error in ==> ActiveCountorsGUI>RunButton_Callback at 659

Error in ==> gui_mainfcn at 96

Error in ==> ActiveCountorsGUI at 42
    gui_mainfcn(gui_State, varargin{:});

Error in ==>
can someone pls help wid dis error?


SHERRY (view profile)


Can anyone help me to implement the equation (27) in Lankton's paper .I compure the a and r for all the contours but i can not understand how to take the max and min in equation (27).If i use matlabs max i take the bigger elements between the two matrices .Is this wright?

Kwstas Tranos


Kwstas Tranos

Does anyone no how we get from equation (17) of Lankton's paper to matlab F for Yezzi
 F = -((u-v).*((I(idx)-u)./Ain+(I(idx)-v)./Aout)).Any help?

Kwstas Tranos

Dear Nikolay,

Thank you for your reply.
The "Segmenting multiple Objects " is part of the paper of Lankton "Localizing Region Based Active Contours" is the part IV.
I do not know if it is implemented in Matlab.
Thank you again.

Nikolay S.

Nikolay S. (view profile)

Hi kwstas.
Thank you for the high grade.
I'm unfamiliar with the paper "Segmenting multiple Objects" by Shawn Lankton, and was not able to find it.
Any-hows, this GUI is proposed for Active contour algorithms evaluation. Thus a paper to be added must be:
- related to Active Conoturs
- implemented in Matlab
- Modified to fit GUI demands.
In additoin I must have the time to add it to this submission. Unfortunately I'm quiet busy those days, working on several submissions to Matlab Central File Exchange, and I'm afraid I will not have time to invest in this in the near future.
if the above conditions will be true, try emailing me, and I'll see what can be done.
Best regards,

Kwstas Tranos

Thank you very much for the GUI.Can you add tha part of Shawn Lankton paper about "Segmenting multiple Objects" ?
Thank you again

Xidian NO.1


S (view profile)


Whenever I am trying to run this application (when I click 'Run' in GUI) for any images and any model, I am getting the following error,

The left hand side is initialized and has an empty range of indices.
However, the right hand side returned one or more results.

Error in ActiveCountorsGUI>RunButton_Callback (line 659)

Error in gui_mainfcn (line 96)

Error in ActiveCountorsGUI (line 42)
    gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)ActiveCountorsGUI('RunButton_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating uicontrol Callback

Did anyone happen to come across something like this?

Nikolay S.

Nikolay S. (view profile)

Hi Javier.
Thank you for the flattering words and grade- it's a pleasure.
Unfortunately there is only a little info I can recall as this code was written back in 2009, so I do not remember the details. I do advice you to go to the relevant papers. As far as I remember most parameters are similar and intuitive, so once you'll get it for the first paper, you'll get the rest quickly.
You're also advised to "play" with the GUI values to see how the value influences of the parameter change on segmentation results (this was the motivation for building this GUI btw).
Best regards,


Javier (view profile)

Hi, thank you for sharing this GUI, it's wonderful. Please, could you explain what are the parameters of each algorithm, and how their values affect to the segmentation result? Thank you

Nikolay S.

Nikolay S. (view profile)

Hello Anders Munk-Nielsen. imshow is a function part of Matlab Image Processing Toolbox. See the Required Products list for this submition- Image Processing Toolbox is there... You can run this GUI on on a PC where Matlab and Image Processing Toolbox are installed.

I get the following error when I try to run it:
Undefined function 'imshow' for input arguments of type 'uint8'.
Is that the missing toolbox messing with me?

Nikolay S.

Nikolay S. (view profile)

Good morning Luis.
Thanks for your comment.
I've checked this issue with "depfun". Signal processing toolbox is needed for gausswin command(which can be replcaed). Statistics Toolbox is not needed- I haven't found any fnction from this toolbox in the code, and I was able to run the GUI properly, on Matlab instalation without this toolbox.


Luis (view profile)

I believe this submission requires Statistics Toolbox and Signal Processing Toolbox.



Finally file name related bug is fixed!


Minor changes:
- Packaged into an App, for easier use.
- fileparts output arguments modified, to cope with function change.


Some significant updates added (marked by red ellipses in Screen-shot)

Changes list in 1.04:
* Color space panel added
* Blur (denoise) panel added
* Mask definition tool changed

See about help file for details.


Modifications of Tool and Menu bars. Help and About added.


Acknowledge added

MATLAB Release
MATLAB 7.9 (R2009b)

Inspired by: An Intuitive Introduction to Kalman Filter

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

» Watch video