This toolbox implements an energy-based segmentation algorithm that uses
finite-difference based level set evolution. (See , ).
Multiscale control of the curve evolution is implemented -- this greatly reduces
the sensitivity to initialization as well as improves the execution speed
by factors of 10-1000 and even more().
Given a segmentation problem, one can use this GUI in order to find the
proper parameters that will yield the desired partition for the class of images used.
The functions in the toolbox can be then re-used for a scripting algorithm, if desired.
This is not a full multigrid algorithm, the scale navigation is provided in 'manual'
mode, for "image learning". Once you get the hang of it, you can then code that
bit in. On the same line, the error is calculated and shown, but no decision is
taken, the iteration control is also left on "manual".
For details on the algorithm see the references at the end.
From the GUI one is able to:
- load data and save intermediate states using the Load/Save menu
- choose the segmentation parameters (Mu, Lambda+, Lambda- , dt, Nu)
- iterate(relax) a chosen number of steps
- prolong, restrict, redistance the level set
- visualise the current solution
- inspect the error (and more goodies as error function gradient, residue, etc.)
- set various options (levelset initialization style, regularization, scale depth, #steps)
For more details on the interface and implementation see the appropriate help sections in the GUI.
 R. J. LeVeque - "Finite Difference Methods
for Differential Equations" September, 2005
 T. Chan and L. Vese, "Active contours without edges"
IEEE Trans.Img.Proc., vol. 10, pp. 266–277, 2001.
 W. L. Briggs, V. Emden Henson, S. F. McCormick
"A Multigrid Tutorial", SIAM, Philadelphia, 2001.
While drawing the initial contour follow the messages in the command window.
At load time (whether from image or .mat file) keep scale depth at 0 if you want to start at the finest resolution. (I suspect you load a ~72x72 array and have kmax set at 3?)
Will look into adding capability to load an initial contour. What is in there already is the ability to save the level-set function and re-use it. (Say once you have input a complicated initialization, you don't want to go through it every time, so you can save it and load it over. However, the image data has to be of the same size.
another question: when I load a .mat with a double image (the variable is g0 as commented in the code) and then I press "DO Iter" I only see 9 pixels of my image. What can I do?
thanks for sharing the code. I'm having troubles to create a manual initial contour. I select the option Ini. Method "draw" and then I press the button "DO Iter!" but I can't select points with the mouse. What am I doing wrong?
Another question: If I have already the initial contour as a binary mask, can I avoid the function "iniMembrane"?
Thank you very much
For starters, there is a very short description under Help | Buttons.
You can try the Chan-Vese paper I referenced higher in the abstract (no. )
The normalization you mention is done precisely in order to decouple the parameters value from the actual image values (which could come as uint8, uint16, 0-1, or any other data).
Hi,I'm doing my final project of the degree and I haven't a lot of experience so, it's hard for me to follow so much lines of code. I was wondering if you had a paper explaining this guide: the differential equations you employed for the method or something like this. I have proved your method and I really like the results but I want to understand how the parameters affect in order to get better results.
By the way, my images are double and of 16 bits and
approx at lines 840-841 I see:
MaxGVal = max(g(:));
g = g * (255/MaxGVal);
Does it affect my intensity values? It is necessary? Thank you very much!
You warned me about blank spaces in a previous comment but I forgot it, thanks again.
Check if your current location (where you installed this toolbox) contains any spaces. (it happends on Windows, .../My Documents/ ...)
If this is the case try to move it to a space-less location.
If for some reason this isn't possible try this hack, until I post the new version :
Replace line 307 with cd(attData.myData.loc.ImageDir)
Hi, thanks for the answer. Now I'm trying to use images as jpg but with the button Load Image File appears immediatly the same error as I posted before, without appearing any menu to select a file. What can be the problem and then, how can I place a circle of the radius I want and where I want for an initial seed?
This box uses Matlab imread.m, I suspect you could find a Dicom reader on the exchange and either plug it in or convert your images to .jpg, .png, etc.
Be careful with blank spaces in your directory, though, the error above seems to stem from there. I am planning to allow this in a future release.
Hi, thanks for sharing your code. I have a problem loading dicom images with Load Image File. First I have run ini.m and then segm_energy_LS, what can be the problem?
??? Error using ==> cd
Too many input arguments.
Error in ==> segm_energy_LS>fLoadData at 307
eval(['cd ' attData.myData.loc.ImageDir])
??? Error while evaluating uimenu Callback
Thanks very much
@Qwuasi Moore - I am not sure I understand what you mean. The evolution rule is solved discreetly using an FD method, I suppose (and this is just a wild guess) that it would be possible to write an FEM solution. I assume you'd encounter similar issues (mainly execution speed, and the infamous convergence issues)
Depending on how your images look like you might want to choose your segmentation method. This one in particular is powerful when dealing with fuzzy and/or incomplete contours, low gradients, etc. (f.i. environments with noise and jitter)
can I use these codes for Brain tumor segmentation?
Great...Is it possible to do it with FEM?
v.1.0.1 - allow saving and loading of masks and level-set functions
22.214.171.124 - 22.04.2012
126.96.36.199 - 22.04.2012
can now change on the fly the scale depth kMax (before one had to reload the file)
Undersampling of the image to be segmented using splines.