File Exchange

image thumbnail

Active Contours implementation & test platform GUI

version (2.45 MB) by Nikolay S.
Implementation and demonstration of several active contours segmentation methods.


Updated 03 Oct 2016

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!

Cite As

Nikolay S. (2020). Active Contours implementation & test platform GUI (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (32)


please help me to perform iris segmentation using active contour method...

Nikolay S.

Sure, the code is open souse so you can use it the way you want too

Nikolay, Can I use the code you provided for that part only?

Nikolay S.

Hi Sayan.
It sound like you will have to change the GUI- adding buttons to control the parameters for each image, so you will have to dive into the code...

Hi, Nikolay I want to run only sections of Iterations & mask creation for certain images , how shall I proceed?
Which part of the code is to be added or removed?

Lixin Zhou

Nikolay S.

As far as I remember, the original code does not support DICOM images. You should convert them to png/jpg files, or update the image reading function so it will read DICOM files. once this is taken care of, it will work.
Best regards,

Can I use this GUI for dicom MRI images?


Md. Hasnat

Nikolay S.

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.

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

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

Nikolay S.

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?



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?


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?

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.

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,

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



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.

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,


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.

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.

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.


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 Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: An Intuitive Introduction to Kalman Filter