Code covered by the BSD License

### Highlights fromToolbox Fast Marching

3.975

4.0 | 43 ratings Rate this file 139 Downloads (last 30 days) File Size: 5.8 MB File ID: #6110

# Toolbox Fast Marching

24 Oct 2004 (Updated 27 Jun 2009)

A toolbox for the computation of the Fast Marching algorithm in 2D and 3D.

File Information
Description

The Fast Marching algorithm, introduced by Sethian (1996) is a numerical algorithm that is able to catch the viscosity solution of the Eikonal equation |grad(D)|=P. The level set {x \ F(x)=t} can be seen as a front advancing with speed P(x).

The resulting function D is a distance function, and if the speed P is constant, it can be seen as the distance function to a set of starting points.

The Fast Marching is very similar to the Dijkstra algorithm that finds shortest paths on graphs. Using a gradient descent of the distance function D, one is able to extract a good approximation of the shortest path (geodesic) in various settings (euclidean for P constant, and a weighted riemanian manifold with P varying).

The main reference about the Fast Marching algorithm is the book
Level Set Methods and Fast Marching Methods Evolving Interfaces in Computational Geometry, Fluid Mechanics, Computer Vision, and Materials Science
J.A. Sethian, Cambridge University Press, 1999
Cambridge Monograph on Applied and Computational Mathematics

A good review of the Fast Marching in 3D together with some applications can be found in
Fast extraction of minimal paths in 3D images and application to virtual endoscopy.
T.Deschamps and L.D. Cohen.
September 2000. To appear in Medical Image Analysis.

The functions 'perform_fast_marching_2d', 'perform_fast_marching_3d' and 'perform_fast_marching_mesh' compute the distance function from a set of starting points. To extract the geodesics between these starting points and an ending point, you can use 'extract_path_2d' and 'extract_path_3d'.

The main computation are done in a mex file so it is very fast (using a C++ heap structure). Precompiled version (.dll) for Windows are given.

MATLAB release MATLAB 7 (R14)
Tags for This File
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
 Please login to add a comment or rating.
Comments and Ratings (64)
09 Nov 2012
16 Jul 2012

The mesh propagation works well, thanks.
The 3D propagation is slow (compared to the Accurate Fast Marching) and returns wrong results: Add the line

W = ones(size(W));

to

test_fast_marching_3d.m

and check the distance matrix result.

30 Jun 2012

It appears that the two M-files 'extract_path_2/3d.m' have been replaced by 'compute_geodesic.m'.

The functions extract_path_2d() and extract_path_3d() are actually inside the 'compute_geodesic.m' file.

30 May 2012
03 Feb 2012

Anyone get an error:

"??? Undefined function or method 'perform_front_propagation_mesh' for input arguments of type 'double'."

when trying to perform fast marching on a surface mesh? The contents of the entire toolbox have been added to the path, so it appears that perform_front_propagation_mesh.m was not provided by author.

03 Feb 2012

I just download and use test_fast_marching_2d.m, it goes well although a bit error should be debugged. Thats easy to correct. So, well done. A good work on fast marching methods. I will further use this toobox on my project.

09 Sep 2011

Hi,

I am trying to use this toolbox for segmenting a 3D mesh. The mesh contains several unconnected surfaces.It seems that the fast marching algorithm "jumps" over the gap between the surfaces. Is it possible? I would expect the geodesic distance between unconnected nodes to be Inf.

Thanks,
Eitan

30 Jun 2011

I encountered this error while trying to run compile_mex

mex: mex/anisotropic-fm//perform_front_propagation_anisotropic.cpp not a normal file or does not exist.

??? Error using ==> mex at 222
Unable to complete successfully.

Error in ==> compile_mex at 7
mex mex/anisotropic-fm//perform_front_propagation_anisotropic.cpp

Any help is appreciated. Thank you in advance.

15 Jun 2011

Thank you for sharing this program,
I have a question regarding it:

You mentioned it above extract_path_2d.m (and the 3d also) but I cannot find it, even in the files list. For more when runing test_fast_marching_2d.m this error occurs

??? Index exceeds matrix dimensions.

Error in ==> perform_front_propagation_2d_slow>perform_fast_marching_step at 110
h0=H(ind_O);

Error in ==> perform_front_propagation_2d_slow at 56
data = perform_fast_marching_step(data);

Error in ==> perform_fast_marching at 117
[D,S] =
perform_front_propagation_2d_slow(W,start_points,end_points,nb_iter_max, H);

Error in ==> test_fast_marching_2d at 27
[D,S] = perform_fast_marching(W, start_points, options);

I would appreciate if you could help

Ladi

08 Jun 2011

thank you a lot for this method. But can you give me an idea about how to use it for medical image segmentation ( tumor extraction)

26 May 2011

Hi,

I want to know if the extract_path_2d.m (and the 3d also) is included in this toolbox.

You mentioned it above but I cannot find it, even in the files list.

Thank you very much.

26 May 2011
24 Feb 2011

Hello,

first of all i would like to congratulate you for this excelent work.
It seems i have a problem with the precompiled dll of 'perform_fast_marching_2d'.

More specifically (while i was trying to perform teh example posted at http://www.ceremade.dauphine.fr/~peyre/numerical-tour/tours/shapes_5_geodesic_descriptors/#10, i received the above error message:
??? Attempt to execute SCRIPT perform_front_propagation_2d as a function:

Error in ==> perform_fast_marching at 115
[D,S,Q] = perform_front_propagation_2d(W,start_points-1,end_points-1,nb_iter_max, H,
L, values);

What i understood is that it cant see the dll function.

Any suggestion is welcome.

21 Dec 2010

IMPORTANT:

1) The code for the anisotropic propagation is not included anymore in the toolbox, so do not try to compile it. Contact me if you *really* need anisotropic propagation.

2) Although this toolbox works fine, it is not "plug and play". If you want an introduction to Fast Marching method, you should try my Numerical Tours
www.numerical-tours.com

16 Dec 2010

lack of many files. such as perform_front_propagation_anisotropic.h
AnisotropicTensorDistanceConfidence.h

lack of the file you mentioned in the compile_mex anisotropic-fm
you have provided the mac os head

10 Aug 2010

Error in ==> perform_fast_marching at 117
[D,S] = perform_front_propagation_2d(W,start_points,end_points,nb_iter_max,
H);

Error in ==> test_fast_marching_2d at 25
[D,S] = perform_fast_marching(W, start_points, options);

31 Jul 2010

Thank you for your share!But there is a error that mex/perform_front_propagation_2d.cpp' not found,when i run compile_mex file.So i wanna get your help! Thanks!

31 Jul 2010
12 Jul 2010

Yes, a bunch of errors, and a great many files missed, how could anybody successfully compile it?

09 Jul 2010

First I had troubles with compile_mex. Some paths were wrong and files were missing (the whole anisotropic-fm folder), and I had to download them manually on INRIA's. Even then, the file wouldn't compile.

A bit of a disappointment given the obvious effort that was put into the project.

23 Jun 2010

It seems good code bur very bad organized! Lots of bugs...too many subfolders...Non of tests did not work for me!

26 Mar 2010

The author did a terrific job with the toolbox and demos!

However, too many bugs and compilation errors occur (i.e. similar to those expressed by prior user comments, as well as, the function: fm2dAniso)

10 Oct 2009

Thanks for sharing.

16 Sep 2009

Merci beaucoup Peyre for sharing et aussi pour superbe site avec many explanations.

02 Sep 2009

The idea is great, keep on going! The code still needs some improvement though (bug fixing).
I used it for 2D fast marching, but found that matlab bwdist performs way faster, even if I truncate the region to calculate.

21 Apr 2009

Works fine for me. Thank you very much.

05 Jun 2008

too many bugs... please fix them before sharing. othewise what you r doing is just wasting the time of other people.

01 May 2008

Thank you very much for your sharing.
But when I test in 3D,it warns errors:
:
--> Perform Fast Marching ... ??? Error using ==> perform_front_propagation_3d
end_points must be of size 3 x nb_end_poins.

Error in ==> perform_fast_marching at 121
[D,S,Q] = perform_front_propagation_3d(W,start_points-1,end_points-1,nb_iter_max, H, L,
values);

Error in ==> test_vol3d at 61
[D,S] = perform_fast_marching(W, start_point, options);

??? Error using ==> perform_front_propagation_3d
end_points must be of size 3 x nb_end_poins.

Error in ==> perform_fast_marching at 121
[D,S,Q] = perform_front_propagation_3d(W,start_points-1,end_points-1,nb_iter_max, H, L,
values);

Error in ==> test_fast_marching_3d at 19
[D,S] = perform_fast_marching(W, start_points, options);

Who can tell me how to solve the problems?

15 Feb 2008

I was trying to run the test_active_contour.m file. I get the following error message: "Undefined function or method 'perform_conjugate_gradient' for input arguments of type 'function_handle'."

I tried to find the perform_conjugate_gradient fn but could not locate it in the toolbox. Could you please provide the source for this function ?
Thanks

03 Oct 2007

Thanks for sharing

05 Sep 2007

while i am debugging,test_fmstar_2d.m can not get a result.There are always an error:-----------------------------------------------------------------------
Segmentation violation detected at Thu Sep 06 10:15:31 2007
------------------------------------------------------------------------

Configuration:
MATLAB Version: 7.0.0.19920 (R14)
Operating System: Microsoft Windows XP
Window System: Version 5.1 (Build 2600: Service Pack 2)
Processor ID: x86 Family 15 Model 2 Stepping 9, GenuineIntel
Virtual Machine: Java 1.4.2 with Sun Microsystems Inc. Java HotSpot(TM) Client VM
(mixed mode)
Default Charset: ibm-1386_P100-2002

Register State:
EAX = 00000000 EBX = 00000000
ECX = 00000000 EDX = 00000000
ESI = 00000000 EDI = 0acbeb84
EBP = 00cdb88c ESP = 00cdb760
EIP = 0acb153a FLG = 00010246

Stack Trace:
[0] perform_circular_front_propagation_2d.dll:0x0acb153a(0x0acb1238, 0x00cdc4c0, 0, 0)
[1] perform_circular_front_propagation_2d.dll:0x0acb148c(2, 0x00cdc4c0, 5, 0x00cdc550)
[2] libmex.dll:_mexRunMexFile(2, 0x00cdc4c0, 5, 0x00cdc550) + 71 bytes
[3] libmex.dll:public: virtual void __thiscall Mfh_mex::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00cdc4c0, 5, 0x00cdc550) + 157 bytes
[4] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00cdc4c0, 5, 0x00cdc550) + 273 bytes
[5] m_interpreter.dll:public: void __thiscall ResolverFunctionDesc::CallFunction(int,struct mxArray_tag * * const,int,struct mxArray_tag * * const)(2, 0x00cdc4c0, 5, 0x00cdc550) + 246 bytes
[6] m_interpreter.dll:public: bool __thiscall Resolver::CallMFunction(int,int,class _m_operand * const,union m_operand_storage *,int,class _m_operand * const,union m_operand_storage *,int *)(2, 2, 0x01527b90, 0) + 840 bytes
[7] m_interpreter.dll:bool __cdecl inResolveMFunctionCall(struct _m_function_desc *,int,int,class _m_operand * const,union m_operand_storage *,int,class _m_operand * const,union m_operand_storage *,int *,enum inMarshalType *,unsigned int,int,unsigned int *,int)(0x22b05a50, 2, 2, 0x01527b90) + 148 bytes
[8] m_interpreter.dll:bool __cdecl accelMFunctionCall(struct _accelOp *,struct _accelOp * *,struct _accelBytecode *,int *,enum inMarshalType *)(0x22b9f860, 0x00cdcb64 "????, 0x013257b0, 0x00cdcb5c) + 108 bytes
[9] m_interpreter.dll:int __cdecl accelExec(struct _accelBytecode *,enum inMarshalType *)(0x013257b0, 0x00cdcbdc, 0, 0) + 18462 bytes
[10] m_interpreter.dll:_inExecuteHotSegment(0x00cdcc10, 0x00cdcce0, 0x00cdcc90, 0) + 1542 bytes
[11] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *)(1, 541, 56, 0) + 365 bytes
[12] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *)(1, 541, 23, 0) + 272 bytes
[13] m_interpreter.dll:int __cdecl inExecuteMFunctionOrScript(class Mfh_mp *,bool)(0x22b86760, 0, 4, 5) + 773 bytes
[14] m_interpreter.dll:_inWordsj(2, 0x00cdd1fc, 4, 0x00cdd25c) + 441 bytes
[15] m_interpreter.dll:public: void __thiscall Mfh_mp::inRunMP(int,struct mxArray_tag * *,int,struct mxArray_tag * *,struct inWorkSpace_tag *)(2, 0x00cdd1fc, 4, 0x00cdd25c) + 158 bytes
[16] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(struct _mdUnknown_workspace *,int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 2, 0x00cdd1fc, 4) + 28 bytes
[17] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00cdd1fc, 4, 0x00cdd25c) + 26 bytes
[18] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00cdd1fc, 4, 0x00cdd25c) + 273 bytes
[19] m_interpreter.dll:_inDispatchFromStack(670, 0x22bad12c "perform_circular_fast_marching_2..", 2, 4) + 891 bytes
[20] m_interpreter.dll:enum opcodes __cdecl inDispatchCall(char const *,int,int,int,int *,int *)(0x22bad12c "perform_circular_fast_marching_2..", 670, 2, 4) + 111 bytes
[21] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *)(1, 604, 42, 0) + 2282 bytes
[22] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *)(1, 604, 4, 0) + 272 bytes
[23] m_interpreter.dll:int __cdecl inExecuteMFunctionOrScript(class Mfh_mp *,bool)(0x22b84230, 0, 3, 3) + 773 bytes
[24] m_interpreter.dll:_inWordsj(1, 0x00cdd91c, 3, 0x00cdd97c) + 441 bytes
[25] m_interpreter.dll:public: void __thiscall Mfh_mp::inRunMP(int,struct mxArray_tag * *,int,struct mxArray_tag * *,struct inWorkSpace_tag *)(1, 0x00cdd91c, 3, 0x00cdd97c) + 158 bytes
[26] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(struct _mdUnknown_workspace *,int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 1, 0x00cdd91c, 3) + 28 bytes
[27] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(1, 0x00cdd91c, 3, 0x00cdd97c) + 26 bytes
[28] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(1, 0x00cdd91c, 3, 0x00cdd97c) + 273 bytes
[29] m_interpreter.dll:_inDispatchFromStack(665, 0x22abdafc "compute_heuristic_multiresolutio..", 1, 3) + 891 bytes
[30] m_interpreter.dll:enum opcodes __cdecl inDispatchCall(char const *,int,int,int,int *,int *)(0x22abdafc "compute_heuristic_multiresolutio..", 665, 1, 3) + 111 bytes
[31] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *)(1, 874, 55, 0) + 2282 bytes
[32] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *)(1, 874, 24, 0) + 272 bytes
[33] m_interpreter.dll:int __cdecl inExecuteMFunctionOrScript(class Mfh_mp *,bool)(0x22a47af0, 0, 4, 4) + 773 bytes
[34] m_interpreter.dll:_inWordsj(2, 0x00cde03c, 4, 0x00cde09c) + 441 bytes
[35] m_interpreter.dll:public: void __thiscall Mfh_mp::inRunMP(int,struct mxArray_tag * *,int,struct mxArray_tag * *,struct inWorkSpace_tag *)(2, 0x00cde03c, 4, 0x00cde09c) + 158 bytes
[36] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(struct _mdUnknown_workspace *,int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 2, 0x00cde03c, 4) + 28 bytes
[37] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00cde03c, 4, 0x00cde09c) + 26 bytes
[38] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(2, 0x00cde03c, 4, 0x00cde09c) + 273 bytes
[39] m_interpreter.dll:_inDispatchFromStack(664, 0x0f7ca247 "perform_fmstar_2d", 2, 4) + 891 bytes
[40] m_interpreter.dll:_inCallFcnFromReference(0, 0x0f872730, 0x789b59c0, 0xcccccccd) + 176 bytes
[41] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *)(1, 0, 93, 0) + 4115 bytes
[42] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *)(1, 0, 14, 0) + 272 bytes
[43] m_interpreter.dll:int __cdecl inExecuteMFunctionOrScript(class Mfh_mp *,bool)(0x015e6f30, 1, 0, 0x015e6f30) + 773 bytes
[44] m_interpreter.dll:_inExecCompScript(0, 0x00cde71c, 0x015e6f30, 0xffffffff) + 321 bytes
[45] m_interpreter.dll:public: void __thiscall Mfh_mp::inRunMP(int,struct mxArray_tag * *,int,struct mxArray_tag * *,struct inWorkSpace_tag *)(0, 0x00cde71c, 0, 0x00cde77c) + 122 bytes
[46] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(struct _mdUnknown_workspace *,int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0, 0x00cde71c, 0) + 28 bytes
[47] m_interpreter.dll:public: virtual void __thiscall Mfh_mp::dispatch_file(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00cde71c, 0, 0x00cde77c) + 26 bytes
[48] m_dispatcher.dll:public: virtual void __thiscall Mfh_file::dispatch_fh(int,struct mxArray_tag * *,int,struct mxArray_tag * *)(0, 0x00cde71c, 0, 0x00cde77c) + 273 bytes
[49] m_interpreter.dll:_inDispatchFromStack(488, 0x013f6d84 "test_fmstar_2d", 0, 0) + 891 bytes
[50] m_interpreter.dll:enum opcodes __cdecl inDispatchCall(char const *,int,int,int,int *,int *)(0x013f6d84 "test_fmstar_2d", 488, 0, 0) + 111 bytes
[51] m_interpreter.dll:int __cdecl inInterp(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag volatile *)(2, 0, 0, 0) + 2411 bytes
[52] m_interpreter.dll:int __cdecl inInterPcodeSJ(enum inDebugCheck,int,int,enum opcodes,struct inPcodeNest_tag *)(2, 0, 0, 0) + 272 bytes
[53] m_interpreter.dll:_inInterPcode(2, 0x7876f2d8, 0, 0) + 69 bytes
[54] m_interpreter.dll:enum inExecutionStatus __cdecl in_local_call_eval_function(int *,struct _pcodeheader *,int *,struct mxArray_tag * * const,enum inDebugCheck)(0x00cdf2c8, 0x00cdf3bc, 2, 0x0f525010 "test_fmstar_2d\n") + 162 bytes
[55] m_interpreter.dll:\$L72592(0x7876f2d8, 0x0f525010 "test_fmstar_2d\n", 15, 0) + 196 bytes
[56] m_interpreter.dll:enum inExecutionStatus __cdecl inEvalCmdWithLocalReturnandtype(char const *,int *,enum inDebugCheck)(0, 2, 1, 0x00cdf44c "??) + 86 bytes
[57] m_interpreter.dll:_inEvalCmdNoEnd(0x0f525010 "test_fmstar_2d\n", 0x00cdf4e4, 0x00cdf4a0, 0x015c2180) + 16 bytes
[58] bridge.dll:_mnParser(0x7c80b6a1, 0x015c2180, 0, 0) + 431 bytes
[59] mcr.dll:public: void __thiscall mcrInstance::mnParser(void)(271242, 0x4d5c3a44, 0x414c5441, 0x625c3742) + 87 bytes
[60] MATLAB.exe:0x00401d2f(4194304, 0, 271242, 0x015c2180)
[61] MATLAB.exe:0x00403e45(3276856, 2949175, 0x7ffde000, 0x8054b938)
[62] kernel32.dll:0x7c816fd7(0x00403cc0 "jth(U@", 0, 0, 0)

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

28 Jun 2007

Very good job, it work 5/5 but i need this program in C++ compilator if you can give it to me

thanks

09 May 2007

Excellent toolbox!!! I have tested the fast marching algorithm on 3D meshes and it works perfect! Thanks Gabriel for sharing it!

30 Mar 2007

Excellent and very useful, but there is a small bug in perform_front_propagation_3d.cpp. In the function check_heap the condition on the third 'for loop' should be z<q rather than z<p.
Thanks

01 Aug 2006

Very good job. You will be in the acknowledgment part of my project report. Mes felicitations!

07 Jul 2006

It is a nice tool for us,thanks for your help.but when I do the mex file I have met the follow question ,could everyone can help me,thanks .
The proplem is:
Linking...
perform_front_propagation_2d.obj : error LNK2001: unresolved external symbol _mexErrMsgTxt
perform_front_propagation_2d.obj : error LNK2001: unresolved external symbol "void __cdecl fh_deleteheap(struct fibheap *)" (?fh_deleteheap@@YAXPAUfibheap@@@Z)
perform_front_propagation_2d.obj : error LNK2001: unresolved external symbol "void * __cdecl fh_replacedata(struct fibheap *,struct fibheap_el *,void *)" (?fh_replacedata@@YAPAXPAUfibheap@@PAUfibheap_el@@PAX@Z)
perform_front_propagation_2d.obj : error LNK2001: unresolved external symbol "void * __cdecl fh_extractmin(struct fibheap *)" (?fh_extractmin@@YAPAXPAUfibheap@@@Z)
perform_front_propagation_2d.obj : error LNK2001: unresolved external symbol "bool __cdecl fh_isempty(struct fibheap const *)" (?fh_isempty@@YA_NPBUfibheap@@@Z)
perform_front_propagation_2d.obj : error LNK2001: unresolved external symbol "struct fibheap_el * __cdecl fh_insert(struct fibheap *,void *)" (?fh_insert@@YAPAUfibheap_el@@PAUfibheap@@PAX@Z)
perform_front_propagation_2d.obj : error LNK2001: unresolved external symbol "int (__cdecl*__cdecl fh_setcmp(struct fibheap *,int (__cdecl*)(void *,void *)))(void *,void *)" (?fh_setcmp@@YAP6AHPAX0@ZPAUfibheap@@P6AH00@Z@Z)
perform_front_propagation_2d.obj : error LNK2001: unresolved external symbol "struct fibheap * __cdecl fh_makeheap(void)" (?fh_makeheap@@YAPAUfibheap@@XZ)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/perform_front_propagation_2d.exe : fatal error LNK1120: 9 unresolved externals

05 Jul 2006

When I have run the function "test_multiple_paths_2d", I've got the below error:
Performing front propagation.
Extracting path.
??? Function 'minus' is not defined for values of class 'cell'.

Error in ==> compute_distance_to_points at 20
D(k,:) = sum( (X - repmat(seeds(:,k),1,n)).^2 );

Error in ==> extract_path_2d at 66
d = compute_distance_to_points(path', start_points);

Error in ==> test_multiple_paths_2d at 33
paths1 = extract_path_2d(D,end_points, options);

01 Jun 2006

Hi,

I have tried to use this toolbox on
Matlab R2006a
and I got the below error.

Thanks,

Liran

??? Invalid MEX-file 'C:\liran\matlab\fastMarching\toolbox_fast_marching\perform_front_propagation_2d.dll': The specified module could not be found.

.

Error in ==> perform_fast_marching_2d at 50
[D,S] = perform_front_propagation_2d(W,start_points-1,end_points-1,nb_iter_max);

Error in ==> test_fast_marching_2d at 21
[D,S] = perform_fast_marching_2d(W, start_points, options);

>> dir perform_front_propagation_2d.dll

perform_front_propagation_2d.dll

24 Apr 2006

This is the best level set implementation tutorial I ever found.

thank you:)
-Dan

02 Apr 2006
20 Jan 2006

TO : Beth Massey(emassey@fit.edu)
sorry but perform_ circular_front_propagation WORKS fine on my PC; check twice your installation !

19 Jan 2006

I couldn't get any of the test files to work in the toolbox_fast_marching folder. The errors I get are:
??? Invalid MEX-file 'C:\Documents and Settings\Beth\Desktop\LevelSetMethods\peyrefmm\toolbox_fast_marching\perform_circular_front_propagation_2d.dll': The specified module could not be found.

Error in ==> perform_circular_fast_marching_2d at 57
[D,S] = perform_circular_front_propagation_2d(W,start_points-1,end_points-1,center_point-1,nb_iter_max);

Error in ==> test_circular at 60
[D,S] = perform_circular_fast_marching_2d(W, start_points, center_point, options);

Any help would be appreciated

07 Oct 2005

It works perfectly in 2d & 3D !
Since multiple paths may overlap (...to say the 3rd decimal point precision) it would be nice (and save memory) to have the possibility to trim away path sections in common ; we will have more paths and shorter but no duplication of paths

07 Oct 2005

great tool for endoscopy !
one question: how can I relate path (x,y,z) to W(i,j,k) ? i.e. how to get the value of the speed function that is given at voxel location to the path coordinates given as real values ? is there a trick to go from x,y,z to i,j,k quickly ?

15 Sep 2005

Does anybody know how to complie the *.cpp file in the toolbox to *.dll,as I want do some modification on the cpp code? Thanks very much!

23 Aug 2005

This would be awfully useful if I could make it work! The mex-file fails as below; the slow .m version fails for other reasons.

test_fast_marching_2d
Pick starting point.
Pick end point.
Performing front propagation.
DLL load failed for mex file C:\_Lens\Tools\Matlab\Fast Marching\perform_front_propagation_2d.dll
The specified module could not be found.
??? Invalid MEX-file

Error in ==> C:\_Lens\Tools\Matlab\Fast Marching\perform_fast_marching_2d.m
On line 50 ==> [D,S] = perform_front_propagation_2d(W,start_points-1,end_points-1,nb_iter_max);

Error in ==> C:\_Lens\Tools\Matlab\Fast Marching\test_fast_marching_2d.m
On line 21 ==> [D,S] = perform_fast_marching_2d(W, start_points, options);

18 Jul 2005

i can run test_circular_fast_marching_2d but get errors when running this:
>> test_fast_marching_2d
Pick starting point.
Pick end point.
Performing front propagation.
Extracting path.
Elapsed time is 0.051000 seconds.
??? Undefined command/function 'extract_curves'.

Error in ==> plot_fast_marching_2d at 51
c_list = extract_curves(S,0);

Error in ==> test_fast_marching_2d at 27
plot_fast_marching_2d(W,S,path,start_points,end_points);

>>

and this:
>> test_fast_marching_3d
??? end_points must be of size 3 x nb_end_poins.

Error in ==> perform_fast_marching_3d at 56
[D,S] = perform_front_propagation_3d(W,start_points-1,end_points-1,nb_iter_max);

Error in ==> test_fast_marching_3d at 19
[D,S] = perform_fast_marching_3d(W, start_points, options);

also can i know is there any examples in 3D range data segmentation or 2d image segmentation with fast marching? Thanks very much for your efforts.

07 Jul 2005

When I run 'test_circular' I was told:
??? Undefined command/function 'image_resize'.

11 Jun 2005

Great Stuff,
I used a modification of an older version in my diploma thesis for 3D - Image segmentation.

Thank you very much for your efforts.

16 May 2005

Sorry, you should change the compile_mex function so that it includes the heap files:

mex mex/perform_front_propagation_2d.cpp mex/perform_front_propagation_2d_mex.cpp mex/fheap/fib.cpp
mex mex/perform_front_propagation_3d.cpp mex/fheap/fib.cpp
mex mex/perform_circular_front_propagation_2d.cpp mex/perform_front_propagation_2d.cpp mex/fheap/fib.cpp

14 May 2005

when I compiling the mex files I was told that
perform_front_propagation_3d.obj
Creating library _lib6913.x and object _lib6913.exp
perform_front_propagation_3d.obj : error LNK2001: unresolved external symbol "void __cdecl fh_deleteheap(struct fibheap *)" (?fh_deleteheap@@YAXPAUfibheap@@@Z)
perform_front_propagation_3d.obj : error LNK2001: unresolved external symbol "void * __cdecl fh_replacedata(struct fibheap *,struct fibheap_el *,void *)" (?fh_replacedata@@YAPAXPAUfibheap@@PAUfibheap_el@@PAX@Z)
perform_front_propagation_3d.obj : error LNK2001: unresolved external symbol "void * __cdecl fh_extractmin(struct fibheap *)" (?fh_extractmin@@YAPAXPAUfibheap@@@Z)
perform_front_propagation_3d.obj : error LNK2001: unresolved external symbol "bool __cdecl fh_isempty(struct fibheap const *)" (?fh_isempty@@YA_NPBUfibheap@@@Z)
perform_front_propagation_3d.obj : error LNK2001: unresolved external symbol "struct fibheap_el * __cdecl fh_insert(struct fibheap *,void *)" (?fh_insert@@YAPAUfibheap_el@@PAUfibheap@@PAX@Z)
perform_front_propagation_3d.obj : error LNK2001: unresolved external symbol "int (__cdecl*__cdecl fh_setcmp(struct fibheap *,int (__cdecl*)(void *,void *)))(void *,void *)" (?fh_setcmp@@YAP6AHPAX0@ZPAUfibheap@@P6AH00@Z@Z)
perform_front_propagation_3d.obj : error LNK2001: unresolved external symbol "struct fibheap * __cdecl fh_makeheap(void)" (?fh_makeheap@@YAPAUfibheap@@XZ)
perform_front_propagation_3d.dll : fatal error LNK1120: 7 unresolved externals

C:\MATLAB6P5P1\BIN\WIN32\MEX.PL: Error: Link of 'perform_front_propagation_3d.dll' failed.

05 May 2005

Merci pour la reference au passage!

07 Apr 2005

1. During the decompressing file ,It told me that it couldn't open the file 'perform_front_propagation.suo '. so after I decompressed the files ,I couldn't find the file .
2.when I run compile mex file,I was told that
Error in ==> C:\MATLAB6p5p1\toolbox\toolbox_fast_marching\compile_mex.m
On line 3 ==> mex mex/perform_front_propagation_3d.cpp

10 Feb 2005

The path extraction is slow because it uses Matlab EDO features. The front propagation is as fast as it can be (just C code ...). I'll try to post a simpler path extraction code that runs faster.

BTW, just giving a bad rating is useless. Coding a complete library is a complex task, and just posting anonymous ratings is so easy ...
Try instead to send me a personnal email, I'll try to correct the bugs.

BTW2: the code runs perfectly under matlab 7. You need a C++ compiler to compile the mex files.

BTW3: what's the hell does "not self contained" means? Not enough documentation? Some files are missing (remember you have to add the directory toolbox/ to your path)? The new version contains a readme file, try to check if it does not answer to some of your questions.

09 Feb 2005

runs too slow! Not self contained

18 Jan 2005

Tried to run but crashed on matlab 7. Very insufficiently documented. Good idea but poor implementation. In the end of the day will have to code it myself.

18 Jan 2005

3D Problem is working fine. Problems with rescale function in test_fast_marching_2d.
Error in ==> test_fast_marching_2d at 10
W = rescale( double(W) ); Using 7.0.0.19920 (R14)

10 Dec 2004

Thanks for your share~
While I can not compile it, also because the mex.h header file is missing.

Could you pls. send it to me too?

06 Dec 2004

I would like to try out this algorithm, but I'm running Matlab from a Unix machine. Is there a way to get the source code? I see that some of it is available in the download, but the mex.h header file is missing. Could you send it to me?

Thanks!

-Zack

01 Dec 2004

very useful but problems with multiple start points : segmentation violation !

29 Nov 2004

good good good

03 Nov 2004

working fine with the 2 functions obtained by the author.

01 Nov 2004

Sorry, I'll try to update the toolbox in the next days. Here are the functions :

function m = mmax(A)
m = max(A(:));

function y = rescale(x,a,b)
if nargin<3
a = 0; b = 1;
end
m = min(x(:));M = max(x(:));
y = (b-a) * (x-m)/(M-m) + a;

31 Oct 2004

>> test_fast_marching_3d
??? Undefined function or variable 'mmax'.

Error in ==> C:\toolbox_fast_marching\extract_path_3d.m
On line 24 ==> A1 = A; A1(I) = mmax(A(J));

Error in ==> C:\toolbox_fast_marching\test_fast_marching_3d.m
On line 20 ==> path = extract_path_3d(D,end_points);

Updates
03 Feb 2005

Mex files are simplified.
Added a callback so that you can preven the front to pass some boundary.
Added a "circular path" method that enforce the path to be circular.

11 Feb 2005

Added new test image.
Enhanced the path extraction.

07 Mar 2005

Fixes a bug in starting point handling.

08 Mar 2005

Added file 'compute_distance_to_points.m'.

21 Mar 2005

-- FIRST STABLE RELEASE --
The heap is now Fibonnacci with backward pointers : very fast.
Use a simpler path extraction : faster.
Fixes a bug when using multiple start points.
Added a lot of test files (multiple paths extraction, etc).

11 Apr 2005

Added perform_vf_normalization file.

23 May 2005

Added heuristical front propagation, fixed some minor bugs, added some test files.

11 Jul 2005

Add bunch of new file for heuristical computation.

18 Jul 2005

Added missing curve-related files in toolbox/

25 Aug 2005

Re-compiled the mex files.

I am using Matlab R14 under windows XP, Visual Studio 7.0 .NET.

08 May 2006

Added a test for segmentation.

15 Dec 2006

Added front propagation on 3D meshes.

01 Apr 2007

Solve some issue when compiling with visual C++.

27 Apr 2007

GPL license.

02 May 2007

Remove all isotream from the mex files.

10 May 2007

Bug fix in propagation on meshes.

28 Sep 2007

Added active contour with levelsets.

06 Nov 2007

Added geodesic computation on 3D meshes.

21 Nov 2007

Fixed few bugs.

01 Feb 2008

Extended FM in 3D to handle constraint map.

15 Feb 2008

Added anisotropic (Riemannian) Fast Marching [C code from Lenglet, Pons, Prados].

06 Mar 2008

Corrected some bugs.

18 Aug 2008

Added html help files.

25 Jun 2009

BSD Licence

27 Jun 2009

Update of Licence

Contact us