View License

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

» Watch video

Highlights from
2D fast marching algorithm

1.0 | 1 rating Rate this file 9 Downloads (last 30 days) File Size: 3.44 KB File ID: #18529 Version: 1.3
image thumbnail

2D fast marching algorithm



30 Jan 2008 (Updated )

computation of distance maps using fast marching

| Watch this File

File Information

Compute the distance map to a set of points using the fast marching algorithm.
Solves the 2-D eikonal PDE with constant speed T=1.
It is not very general but well suited for learning.

MATLAB release MATLAB 7.2 (R2006a)
Other requirements Tested in Matlab 2012a
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
14 Mar 2012 Shinen Lo

Great job.
Thank you.

Comment only
17 Oct 2011 Juan Cardelino

You can't use it directly for segmentation. This will only compute a distance map from a set of initial points. You need to read some papers and find out how to use that for segmentation.

Comment only
16 Jun 2011 ladi

ladi (view profile)

How can I use this program for segmentation?

Thank you

Comment only
05 Feb 2008 Juan Cardelino

Thank you very much for your comments. I will take them into account and try to improve the function. What you say about IPT is true, but I wrote this function many years ago without it, Im not sure if it even existed.
Thanks again.

Comment only
05 Feb 2008 igor scardanzan

the topic is hot
see also this contribution that works fine both in 2D and 3D

File Id: 6110 Average rating: 4.29
Size: 1345 KB # of reviews: 35
Submitted: 2004-10-24 Downloads: 5969
Subscribers: 9
Keywords: Fast Marching, level set, PDE, eikonal equation, front propagation, 3D

Comment only
04 Feb 2008 w s

Hi Juan,

this function provides a part of the functionality of bwdist (image processing toolbox). I think, for people that do not have the IPT this function will have some value when you do some more editing.

First, improve your help with a minimal example. E.g take your example from test_fm and include it in the help text.

Second, the help text as it stands now is wrong. The function should ask for subscripts and not for data_points. tam should be replaced by e.g. siz (see function size). The option plot is not supported in the current function. I get an error when I set three input arguments. Currently I cannot switch off the plot option and the function is extremely slow.

Third, you should run mlint since there are various warnings (e.g. memory allocation) that show that the code could be improved.

Fourth, I did not check the code properly. But there are various nested loops which may slow down calculation when the matrix domain is large. Perhaps there are ways to vectorize these loops and to improve performance of the function.

Comment only
01 Feb 2008 Juan Cardelino

I've corrected that. Now the expected arguments are docuemnted and with a sample. However, use only few points as input arguments. Using big random does not make any sense. At least if you want to easily understand the results.

Comment only
30 Jan 2008 w s

I tried following:

>> x = randn(100,1);
>> y = randn(100,1);
>> T = fast_marching([x y]);

??? Error using ==> sub2ind at 56
Out of range subscript.

Error in ==> fast_marching at 36

I guess it is the input that is wrong here, hence I tried

>> T = fast_marching(x, y);
??? Error using ==> fast_marching
Too many input arguments.

So what input required here? The help says:
punto_dato: column vector with 2-dimensional points.

Unfortunately I don't know how to create a column vector with 2-dimensional points.

Please provide a better help. I'll be happy to give a better review than.

01 Feb 2008

improved the help and input arguments

01 Feb 2008

improved documentation

29 Jul 2013 1.3

Just added a screenshot and improved documentation.

Contact us