Code covered by the BSD License  

Highlights from
2D/3D image segmentation toolbox

4.6087

4.6 | 23 ratings Rate this file 217 Downloads (last 30 days) File Size: 3.23 MB File ID: #24998
image thumbnail

2D/3D image segmentation toolbox

by

 

11 Aug 2009 (Updated )

2D/3D image segmentation using level-set based active contour/surface with AOS scheme

| Watch this File

File Information
Description

 Features of the toolbox:
(1) The toolbox includes classic level-set methods such as geodesic active contours (GAC), Chan-Vese model and a hybrid model combining the boundary and regional terms.
(2) All the methods are implemented with the semi-implicit solver AOS which can guarantee the stability of the numerical methods even with very large time steps, thus boosting the efficiency for level-set based segmentation.
(3) All the methods can be applied to 2D and 3D data.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.2 (R2006a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (64)
19 Jul 2014 Mr.Tee

i am using active contour without edge to detect built-up areas in satellite images.
how to measure its accuracy?

12 Jun 2014 Luis Lopez  
30 May 2014 Fernando Amat

I am using R2012b with Windows 7 64-bit and MS Visual Studio 2010 and it works out of the box (both compiling the mex files and running the test code). Great job and extremely useful, especially since it also works for 3D data.

10 Apr 2014 Shirin

Hi Yan
Thanks very much for sharing.

I want to compile the code on Windows. However, it seems like the link given in "readme.txt"
"http://ecson.org/resources/active_contour_segmentation.html"
doesn't work any more.

Could you tell me how to access the version for WINDOWS?

Thanks in advance

01 Apr 2014 Darya

Hi Yan
Thanks a lot for sharing this useful toolbox. I am trying to use chan_vase_model for my MRI data which are 3D but since contour showing is possible only for 2D case. I was wondering how can I set the parameters and be sure that the correct area has been selected ? i.e is there anyway to see how the code is actually working in 3D case?

17 Nov 2013 mei

Hi yan
Thank you so much for sharing of this toolbox.I have a quesetion.I tried to apply the ac_hybrid_model on the color image,but the initialization parameters were not fit.So have you done some work on the 2D image ,and how to set the initialization parameters.Do you have any skills?
Thank you a lot!

10 Jul 2013 Omar Al Okashi

Dear Sir
Thank you so much for you sharing of this great work.. I tried to run it but I can not, this what happen with me:
1- I run it on Windows 7
2- I used mex -setup and I select " Microsoft Visual C++ 2010 " as a compiler.
3- I included data to path.
4- I save the whole folder for toolbox outside matlab.

5- I end with this error when I tried to compile mex :
??? Error using ==> mex at 208
Unable to complete successfully.

Error in ==> compile_mex_codes at 1
mex ac_tridiagonal_Thomas_dll.cpp

Can you please help me in this issue.

With My Regards...

07 Jun 2013 luna

hi
I run this code in matlab R2011 and I set different compilers using mex -setup,but when I run compile_mex_codes I get this error:
Error: Could not find the compiler "wcl386" on the DOS path.
Use mex -setup to configure your environment properly.


C:\PROGRA~1\MATLAB\R2011A\BIN\MEX.PL: Error: Unable to locate compiler.

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

Error in ==> compile_mex_codes at 1
mex ac_tridiagonal_Thomas_dll.cpp

what should I do?
help plz
thx

12 May 2013 Anton Semechko

Incredible work! Thank you very much for making this available!

11 May 2013 Christian Wuerslin

Hi Yan,

great code. I have one suggestion though: In your CV reinit process, you implemented a very efficient distance transform. However, for performance reasons, you don't compute the values for the edges of the matrix (always 0). Thus I would suggest, you pad the input matrix with 0s and then un-pad the output matrix of this step:

u0 = y_binary_boundary_detection(uint8(u>0));
u0 = padarray(u0, [1 1 1]); % padding
u0 = ac_distance_transform_3d(u0);
u0 = u0(2:end-1, 2:end-1, 2:end-1); % un-padding
u = u0.*sign(u);

Cheers, Christian

26 Apr 2013 Pete  
25 Apr 2013 Vincent Jaouen  
28 Jan 2013 Negar

Yuri,
You need to compile the mex folder contents first.

02 Jul 2012 Yuri

Has anybody found a solution for this message:

Undefined function or method 'zy_binary_boundary_detection' for input arguments of type 'uint8'?

24 Mar 2012 aboomnea

hi
i got error when i run the code
please
can u tell me the steps so a i can run without any errors
i
it is a lot of comments
please help

21 Mar 2012 max  
19 Jan 2012 Timothy Cale

Yan:

I hope you can help with a compilation issue.

I am running (64bit) ubuntu 10.04 (vm on fusion 4.3 on a newish MacBook Pro), and I am having a problem compiling:

Upon typing "compile_mex_codes", I get:

mex: ac_tridiagonal_Thomas_dll.cpp not a normal file or does not exist.

Error using mex (line 206)
Unable to complete successfully.

Error in compile_mex_codes (line 1)
mex ac_tridiagonal_Thomas_dll.cpp

Note that I ran "mex -setup", though I have compiled mex files successfully before). It looks like (assuming is see my vm as a "glnxa64"). I have g++ selected, as you indicated in earlier post(s). I am not sure about the flags . . .

I am using "gcc/g++/gfortran" v. 4.4.3, while mex is apparently supported with 4.3.4, but I had no problems in previous mex compilations.(I am fairly new to Matlab, let alone mex files.)

12 Dec 2011 xiao zhang

Hi, Yan
Thanks very much for sharing.
I want to compile the code on Windows. However, it seems like the link given in "readme.txt" --http://ecson.org/resources/active_contour_segmentation.html doesn't work any more.
Could you tell me how to access the version for WINDOWS? Thanks.

24 Nov 2011 Doctor61

Hi Yan, I tried to run the compile_mex_codes.m in matlab and I got this errors:

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

Error in ==> compile_mex_codes at 1
mex ac_tridiagonal_Thomas_dll.cpp

Could you help me with this? Thanks.

08 Nov 2011 Matlabooo

where can i download this file never found it

28 Oct 2011 Brent

Yan,
I am trying to use the ChanVese model to pick out a 3D image of data that does not have a sharp edge. In fact, the brightness value per 3D pixel just gradually increases toward the center of the image. ChanVese is supposed to be able to do this per the reference, but I have not had success. Any advice?

I have been trying to relate the smooth_weight and image_weight parameters to the parameters in the reference (u,v,lambda1,lambda2). The image_weight seems to correspond to the lamdas (where lamda1 = lamda2). In the reference by Chan & Vese typically a value of one is used, but matlab crashes with a standard exception error when I put in a value any greater than 0.01.

Does the smooth_weight relate to u an v somehow?

Thanks for any advice you can offer.

Brent

20 Oct 2011 Lol communication

hello Yan
I'd like to ask u about MATLAB CODE
for Estimating 3D human body pose from 2D Static Images PLZ can u help me! ?

15 Aug 2011 Ido

Dear Yan Zhang,
I compiled the cpp files and got all the mex files generated by 'compile_mex_codes.m'. However, when I run the example at the top of 'ac_GAC_model.m' I get a segmentation fault (see errors below). Could you give me any tips on how to Solve this problem?

Regards, Ido

------------------------------------------------------------------------
Segmentation violation detected at Mon Aug 15 13:56:04 2011
------------------------------------------------------------------------

Configuration:
MATLAB Version: 7.11.0.584 (R2010b)
MATLAB License: 305704
Operating System: Microsoft Windows 7
Window System: Version 6.1 (Build 7600)
Processor ID: x86 Family 6 Model 7 Stepping 10, GenuineIntel
Virtual Machine: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
Default Encoding: windows-1252

Fault Count: 1

Abnormal termination:

Register State (from fault):
EAX = 1cc20020 EBX = 09fbfe80
ECX = 1cc6a190 EDX = 2177a190
ESP = 00c2acf8 EBP = 00c2ad10
ESI = 26c2a020 EDI = 00002306

EIP = 0d651283 EFL = 00210206

CS = 0000001b DS = 00000023 SS = 00000023
ES = 00000023 FS = 0000003b GS = 00000000

Stack Trace (from fault):
[ 0] 0x0d651283 C:/Views/Development/MD.BVA.prj/medical/BVA/CollidingFrontsSegmentation/AOSLevelsetSegmentationToolboxM/private/ac_tridiagonal_Thomas_dll.mexw32+00004739 ???+000000
[ 1] 0x0d6513b2 C:/Views/Development/MD.BVA.prj/medical/BVA/CollidingFrontsSegmentation/AOSLevelsetSegmentationToolboxM/private/ac_tridiagonal_Thomas_dll.mexw32+00005042 ( mexFunction+000130 )
[ 2] 0x7b833394 C:/Program Files/MATLAB/R2010b/bin/win32/libmex.dll+00013204 ( mexRunMexFile+000132 )
[ 3] 0x7b832199 C:/Program Files/MATLAB/R2010b/bin/win32/libmex.dll+00008601 ( inSwapMexfileReader+000201 )
[ 4] 0x7b832391 C:/Program Files/MATLAB/R2010b/bin/win32/libmex.dll+00009105 ( inSwapMexfileReader+000705 )
[ 5] 0x7a29b0f9 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045305 ( Mfh_file::dispatch_fh+000249 )
[ 6] 0x7a29b384 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045956 ( Mfunction_handle::dispatch+000420 )
[ 7] 0x7aa42881 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00534657 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+384993 )
[ 8] 0x7aa2fc9a C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00457882 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+308218 )
[ 9] 0x7aa24bc9 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00412617 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+262953 )
[ 10] 0x7ace7eda C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+03309274 ( TabContext::FindCompletion+003382 )
[ 11] 0x7aa18b10 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00363280 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+213616 )
[ 12] 0x7aa1b7f1 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00374769 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+225105 )
[ 13] 0x7aa1e17e C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00385406 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+235742 )
[ 14] 0x7aa343c7 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476103 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326439 )
[ 15] 0x7aa344eb C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476395 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326731 )
[ 16] 0x7aa2556c C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00415084 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+265420 )
[ 17] 0x7aa243f2 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00410610 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+260946 )
[ 18] 0x7aa2f747 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456519 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306855 )
[ 19] 0x7aa2f7c9 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456649 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306985 )
[ 20] 0x7a29b0f9 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045305 ( Mfh_file::dispatch_fh+000249 )
[ 21] 0x7a29b384 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045956 ( Mfunction_handle::dispatch+000420 )
[ 22] 0x7aa42881 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00534657 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+384993 )
[ 23] 0x7aa2fc9a C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00457882 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+308218 )
[ 24] 0x7aa24bc9 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00412617 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+262953 )
[ 25] 0x7ace7eda C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+03309274 ( TabContext::FindCompletion+003382 )
[ 26] 0x7aa18b10 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00363280 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+213616 )
[ 27] 0x7aa1b7f1 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00374769 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+225105 )
[ 28] 0x7aa1e17e C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00385406 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+235742 )
[ 29] 0x7aa343c7 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476103 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326439 )
[ 30] 0x7aa344eb C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476395 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326731 )
[ 31] 0x7aa2556c C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00415084 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+265420 )
[ 32] 0x7aa243f2 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00410610 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+260946 )
[ 33] 0x7aa2f747 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456519 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306855 )
[ 34] 0x7aa2f7c9 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456649 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306985 )
[ 35] 0x7a29b0f9 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045305 ( Mfh_file::dispatch_fh+000249 )
[ 36] 0x7a29b384 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045956 ( Mfunction_handle::dispatch+000420 )
[ 37] 0x7aa206c2 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00394946 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+245282 )
[ 38] 0x7aa1e369 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00385897 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+236233 )
[ 39] 0x7aa343c7 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476103 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326439 )
[ 40] 0x7aa344eb C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476395 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326731 )
[ 41] 0x7aa2556c C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00415084 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+265420 )
[ 42] 0x7aa243f2 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00410610 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+260946 )
[ 43] 0x7aa2f747 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456519 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306855 )
[ 44] 0x7aa2f7c9 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456649 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306985 )
[ 45] 0x7a29b0f9 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045305 ( Mfh_file::dispatch_fh+000249 )
[ 46] 0x7a29b384 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045956 ( Mfunction_handle::dispatch+000420 )
[ 47] 0x7aa206c2 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00394946 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+245282 )
[ 48] 0x7aa1e369 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00385897 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+236233 )
[ 49] 0x7aa343c7 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476103 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326439 )
[ 50] 0x7aa344eb C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476395 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326731 )
[ 51] 0x7aa2556c C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00415084 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+265420 )
[ 52] 0x7aa243f2 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00410610 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+260946 )
[ 53] 0x7aa2f747 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456519 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306855 )
[ 54] 0x7aa2f7c9 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456649 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306985 )
[ 55] 0x7a29b0f9 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045305 ( Mfh_file::dispatch_fh+000249 )
[ 56] 0x7a29b384 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045956 ( Mfunction_handle::dispatch+000420 )
[ 57] 0x7aa206c2 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00394946 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+245282 )
[ 58] 0x7a9cbef6 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00048886 ( MStackWatermark::MStackWatermark+028486 )
[ 59] 0x7aa1f721 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00390945 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+241281 )
[ 60] 0x7aa343c7 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476103 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326439 )
[ 61] 0x7aa344eb C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00476395 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+326731 )
[ 62] 0x7aa2556c C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00415084 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+265420 )
[ 63] 0x7aa243f2 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00410610 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+260946 )
[ 64] 0x7aa2f747 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456519 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306855 )
[ 65] 0x7aa2f7c9 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00456649 ( MathWorks::MException::MExceptionEnvelope::MExceptionEnvelope+306985 )
[ 66] 0x7a29b0f9 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045305 ( Mfh_file::dispatch_fh+000249 )
[ 67] 0x7a29b384 C:/Program Files/MATLAB/R2010b/bin/win32/m_dispatcher.dll+00045956 ( Mfunction_handle::dispatch+000420 )
[ 68] 0x7aa8f0d6 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00848086 ( inAnonymousFunction+001158 )
[ 69] 0x7aa8fc46 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00851014 ( inMainLoopIdle+000662 )
[ 70] 0x7a9d68d5 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00092373 ( inFullFevalFcn+003445 )
[ 71] 0x7aa9010f C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00852239 ( inMainLoopIdle+001887 )
[ 72] 0x7aa90159 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00852313 ( inMainLoopIdle+001961 )
[ 73] 0x7aa9017e C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00852350 ( inEvalCmdWithLocalReturn+000030 )
[ 74] 0x78346cd3 C:/Program Files/MATLAB/R2010b/bin/win32/libmwbridge.dll+00027859 ( mnInitializeParser+000179 )
[ 75] 0x7834ab3f C:/Program Files/MATLAB/R2010b/bin/win32/libmwbridge.dll+00043839 ( mnParser+000495 )
[ 76] 0x7a3eb423 C:/Program Files/MATLAB/R2010b/bin/win32/mcr.dll+00177187 ( mcrInstance::mnParser_on_interpreter_thread+000051 )
[ 77] 0x7a3d44c2 C:/Program Files/MATLAB/R2010b/bin/win32/mcr.dll+00083138 ( mvm::detail::RecursiveScopedMcrLock::~RecursiveScopedMcrLock+034226 )
[ 78] 0x7a3d4595 C:/Program Files/MATLAB/R2010b/bin/win32/mcr.dll+00083349 ( mvm::detail::RecursiveScopedMcrLock::~RecursiveScopedMcrLock+034437 )
[ 79] 0x7a3d2148 C:/Program Files/MATLAB/R2010b/bin/win32/mcr.dll+00074056 ( mvm::detail::RecursiveScopedMcrLock::~RecursiveScopedMcrLock+025144 )
[ 80] 0x7b558e21 C:/Program Files/MATLAB/R2010b/bin/win32/uiw.dll+00298529 ( UIW_IsUserMessage+000129 )
[ 81] 0x7b5593cf C:/Program Files/MATLAB/R2010b/bin/win32/uiw.dll+00299983 ( ws_ProcessPendingEventsWaitForWindows+000303 )
[ 82] 0x75cb6e6e C:/Windows/system32/USER32.dll+00224878 ( SetWindowsHookExA+000116 )
[ 83] 0x75c931eb C:/Windows/system32/USER32.dll+00078315 ( GetClassNameW+000078 )
[ 84] 0x75c94260 C:/Windows/system32/USER32.dll+00082528 ( ChangeWindowMessageFilter+000102 )
[ 85] 0x7785642e C:/Windows/SYSTEM32/ntdll.dll+00287790 ( KiUserCallbackDispatcher+000046 )
[ 86] 0x03a6344b C:/Windows/pcdrm/NSCCOR03.DLL+00078923 ( ???+000000 )
[ 87] 0x7b52e67f C:/Program Files/MATLAB/R2010b/bin/win32/uiw.dll+00124543 ( UIW_SetCurrentDialog+000655 )
[ 88] 0x7b55a4e5 C:/Program Files/MATLAB/R2010b/bin/win32/uiw.dll+00304357 ( ws_FreeSystemFont+000485 )
[ 89] 0x7a0a1b07 C:/Program Files/MATLAB/R2010b/bin/win32/libuij.dll+00137991 ( sysq::ws_ppeHook::~ws_ppeHook+006887 )
[ 90] 0x7a0a21da C:/Program Files/MATLAB/R2010b/bin/win32/libuij.dll+00139738 ( sysq::ws_ppeHook::~ws_ppeHook+008634 )
[ 91] 0x7a0a3183 C:/Program Files/MATLAB/R2010b/bin/win32/libuij.dll+00143747 ( svWS_CommitDatabaseUpdates+002051 )
[ 92] 0x7a0a3a43 C:/Program Files/MATLAB/R2010b/bin/win32/libuij.dll+00145987 ( svWS_CommitDatabaseUpdates+004291 )
[ 93] 0x7a0a3c36 C:/Program Files/MATLAB/R2010b/bin/win32/libuij.dll+00146486 ( svWS_CommitDatabaseUpdates+004790 )
[ 94] 0x7a0a3d24 C:/Program Files/MATLAB/R2010b/bin/win32/libuij.dll+00146724 ( svWS_CommitDatabaseUpdates+005028 )
[ 95] 0x7a0a3ea2 C:/Program Files/MATLAB/R2010b/bin/win32/libuij.dll+00147106 ( UIJ_WS_ProcessPendingEvents+000018 )
[ 96] 0x7a3d4e3a C:/Program Files/MATLAB/R2010b/bin/win32/mcr.dll+00085562 ( mvm::detail::RecursiveScopedMcrLock::~RecursiveScopedMcrLock+036650 )
[ 97] 0x7a3d506d C:/Program Files/MATLAB/R2010b/bin/win32/mcr.dll+00086125 ( mvm::detail::RecursiveScopedMcrLock::~RecursiveScopedMcrLock+037213 )
[ 98] 0x7a3d531c C:/Program Files/MATLAB/R2010b/bin/win32/mcr.dll+00086812 ( mcr_invoke_on_interpreter_thread+000220 )
[ 99] 0x7a3d5a4c C:/Program Files/MATLAB/R2010b/bin/win32/mcr.dll+00088652 ( mcr_invoke_on_interpreter_thread+002060 )
[100] 0x00406202 C:/Program Files/MATLAB/R2010b/bin/win32/MATLAB.exe+00025090 ( ???+000000 )
[101] 0x004062c5 C:/Program Files/MATLAB/R2010b/bin/win32/MATLAB.exe+00025285 ( ???+000000 )
[102] 0x0040638d C:/Program Files/MATLAB/R2010b/bin/win32/MATLAB.exe+00025485 ( ???+000000 )
[103] 0x00406834 C:/Program Files/MATLAB/R2010b/bin/win32/MATLAB.exe+00026676 ( ???+000000 )
[104] 0x77781194 C:/Windows/system32/kernel32.dll+00332180 ( BaseThreadInitThunk+000018 )
[105] 0x7786b495 C:/Windows/SYSTEM32/ntdll.dll+00373909 ( RtlInitializeExceptionChain+000099 )
[106] 0x7786b468 C:/Windows/SYSTEM32/ntdll.dll+00373864 ( RtlInitializeExceptionChain+000054 )

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.

If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/

A technical support engineer might contact you with further information.

Thank you for your help. MATLAB may attempt to recover, but even if recovery appears successful,
we recommend that you save your workspace and restart MATLAB as soon as possible.

Caught MathWorks::System::FatalException

01 Jun 2011 Helen

Hi,
I have one question about this program. Is is possible to segment more than one class in an image? Or do you have any suggestion what to change in the code that make it possible?

20 Feb 2011 mimi phuong

Dear Yan Zhang,
I have the same problem as Aureline,which as:
??? Undefined function or method 'zy_binary_boundary_detection' for input arguments of type 'uint8'.
Could you please give me some idea? I also typed "computer" in Matlab and got the GLNX86 for Ubuntu version...
Thanks for your help!

07 Sep 2010 emilie

Hello,

I tried to compile the file "compile_mex_codes.m" but it it doesn't work correctly. It can not compile "zy_binary_boundary_detection.c". The following error appears:

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

Error in ==> compile_mex_codes at 4
mex zy_binary_boundary_detection.c

Could you please help me. Thanks

27 Aug 2010 Preeti

Sir
I am not able to compile the mex file. Got the following errors:
lcc preprocessor warning: C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp:95 No newline at end of file
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 syntax error; found `unsigned' expecting `;'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 syntax error; found `unsigned' expecting `;'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 syntax error; found `unsigned' expecting `)'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 skipping `unsigned' `long' `int'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 undeclared identifier `i'
Warning C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 Statement has no effect
Warning C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 unreachable code
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 syntax error; found `)' expecting `;'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 illegal statement termination
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 7 skipping `)'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 19 undeclared identifier `new'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 19 operands of = have illegal types `pointer to double' and `int'
Warning C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 19 possible usage of new before definition
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 19 syntax error; found `double' expecting `;'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 19 integer expression must be constant
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 19 missing identifier
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 51 undeclared identifier `delete'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 51 illegal expression
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 51 syntax error; found `yy' expecting `]'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 51 type error: pointer expected
Warning C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 51 Statement has no effect
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 51 syntax error; found `yy' expecting `;'
Warning C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 51 Statement has no effect
Warning C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 51 possible usage of delete before definition
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 71 illegal statement termination
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 71 skipping `double'
Error C:\PROGRA~1\MATLAB\R2008B\WORK\AOSLEV~1\MEX\ac_tridiagonal_Thomas_dll.cpp: 71 too many errors

C:\PROGRA~1\MATLAB\R2008B\BIN\MEX.PL: Error: Compile of 'ac_tridiagonal_Thomas_dll.cpp' failed.

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

Error in ==> compile_mex_codes at 1
mex ac_tridiagonal_Thomas_dll.cpp

Error in ==> run at 57
evalin('caller', [s ';']);

please comment!

21 Jun 2010 KSRaj Raj  
11 May 2010 Yan Jianping

Hello,Yan Zhang. when I used compile_mex_codes to compile, I met the following errors:

C:\DOCUME~1\yanjpphd\LOCALS~1\Temp\mex_933260AC-1398-46B6-6CA4-9F6BBF3212F4\ac_tridiagonal_Thomas_dll.obj
LINK : fatal error LNK1104: cannot open file "ac_tridiagonal_Thomas_dll.mexw32"

C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL: Error: Link of 'ac_tridiagonal_Thomas_dll.mexw32' failed.

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

Error in ==> compile_mex_codes at 1
mex ac_tridiagonal_Thomas_dll.cpp

Thanks for your help!

28 Apr 2010 Yan Zhang

To Aureline,

Please type 'computer' in matlab and let me know what the result is. The precompiled version only works for 32bit windows system, yours may be 64bit.

28 Apr 2010 Aureline

Hello Yan, it seems you have done a great job here.

I cannot test your toolbox for now, I am using your pre-compiled version available on your website.
When I try to run one of the test files, I get the error
"Undefined function or method 'zy_binary_boundary_detection' for input arguments of type 'uint8'".
I have tried to get rid of the uint8 conversion in the ac_reinit file, but I still can't make the test run.
I am using 2010 version of Matlab, maybe the problem comes from here. Do you have any idea ?
Thanks a lot.

23 Apr 2010 Yan Zhang

Hi, Stefan

Thanks a lot for sharing your invaluable experience! I guess this might be the reason why the toolbox fails to work on 64-bit operating system as reported before. I promise to correct this bug once I have access on 64-bit machine.

23 Apr 2010 Stefan L.

In fact a very useful tool.

I first used this toolbox in MATLAB R2008a and it worked pretty fine. Short time ago I switched to MATLAB R2009b (Windows 7, 64bit) and when using the tool I received one of the following errors:

Error type 1:

??? Error using ==> contourc
Input matrix contains no finite values - unable to calculate contours

Error in ==> contours at 57
CS=contourc(varargin{numarg_for_call});

Error in ==> ac_hybrid_model at 90
c = contours(phi,[0,0]);

Error type 2:

MATLAB System Error
MATLAB has encountered an internal problem and needs to close.

Details:
MATLAB crash file:C:\Users\Stefan\AppData\Local\Temp\matlab_crash_dump.3776
------------------------------------------------------------------------
Segmentation violation detected at Fri Apr 23 16:08:01 2010
------------------------------------------------------------------------
Configuration:
MATLAB Version: 7.9.0.529 (R2009b)
MATLAB License: 161051
Operating System: Microsoft Windows Vista
Window System: Version 6.1 (Build 7600)
Processor ID: x86 Family 6 Model 7 Stepping 6, GenuineIntel
Virtual Machine: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
Default Encoding: windows-1252

Fault Count: 1

Stack Trace:
[ 0] 000000007CEC59AB libmx.dll+022955 (mxCreateDoubleMatrix_730+000027)
[ 1] 00000000369313A2 ac_tridiagonal_Thomas_dll.mexw64+005026 (mexFunction+000274)

At last I tracked down the problem in the MATLAB - bwdist() function which is used in the functions ac_reinit and ac_SDF_2D. In R2008a it returned an array of type double, in R2009b it returns an array of type single (despite the fact the documentation says it should be double).

After changing the line 25 in ac_reinit.m from
u = bwdist(u0).*sign(u); to u = double(bwdist(u0)).*sign(u);

and the lines 82, 91 and 120 in ac_SDF_2D.m from
phi = -bwdist(phi); to phi = -double(bwdist(phi));
phi = radius - bwdist(phi); to phi = radius - double(bwdist(phi));
phi = bwdist(phi); to phi = double(bwdist(phi));

everything worked fine again.

14 Apr 2010 Amir

good job!

26 Feb 2010 baoyun li

Dr. Zhang:

Seems you renitilize level set at each step.
However, if not using narrow band, reintilization is very time consumming. Can I reinilized by narrowband and still use your AOS codes?

If use narrowband, how should I use AOS? I read the "fast geodesic levelset" paper, but don't understand how to apply AOS on Narrow band.

Thanks
Baoyun

22 Feb 2010 Mark Brophy

Hi Yan, thanks very much for the great software.

I am using your geodesic active contour model for 3d reconstruction. My problem is that I am having trouble updating the 'g' values on the surface. I have attempted to extract the surface using both Matlab's built-in isosurface and zy_binary_boundary_detection(uint8(phi>0)), but both of these commands only return a subset of the points on the surface. Basically, when I evolve the 3d surface, only a subset of the points 'move', so to speak.

Do you know how I might all points on the surface?

Cheers,
-Mark

18 Feb 2010 adel khelifi

Hi Yan Zhang,
i'm use Windows system,
when I used compile_mex_codes to compile, I met the following errors:

Error: Compile of 'ac_tridiagonal_Thomas_dll.cpp' failed.
??? Error using ==> mex at 221
Unable to complete successfully.
Error in ==> compile_mex_codes at 1
mex ac_tridiagonal_Thomas_dll.cpp
Error in ==> run at 57
evalin('caller', [s ';']);
****************************************************************
i'm read this message
""a more complete version of the toolbox can be downloaded from the following link:
http://ecson.org/resources/software/_AOSLevelsetSegmentationToolbox.zip ""

please help me.

30 Jan 2010 Yan Zhang

To Yusuke,

The toolbox contains a AOS solver for the PDE in the form of u_t = div( g |\nabla u| ). This is a challenging problem because using explicit finite difference method (FDM) can cause unstability if the time step is too large.

For the PDE you mentioned, simple explicit FDM such as
u_(k+1) = u_k + delta_t * div(V)
should be working no matter how large delta_t is (of course the accuracy will be affected). The above scheme can be easily implemented in Matlab.

Hope this can help.

30 Jan 2010 Yan Zhang

To Jenny,

The figure you mentioned was produced by a visualization software called Amira. As far as I know, the current matlab graphic toolbox doesn't support volume rendering.

30 Jan 2010 Yusuke Yoshiyasu

Hi Yan Zhang,
Thanks for the toolbox. i have a question. If i want to apply your code to flux maximizing flow, where should i change? i think what i have to do is to change u_t = div(\nabla u) to u_t = div(\nabla I) or u_t = div(V), where I is some input image and V is vector field.
Thanks.

21 Jan 2010 Kai

Hi Yan Zhang,
the GAC and the hybrid model does not work anymore. I changed my environment to windows 7 (64bit). When I run the examples in ac_GAC_model.m and ac_hybrid_model.m, I get the following error message: "MATLAB has encountered an internal problem and needs to close".
Everything works fine on Mac and 32bit Windows. The crash_dump says a "Segmentation violation detected" in ac_tridiagonal_Thomas_dll.mexw64.
Has anyone else this error?

21 Jan 2010 Jenny

hi ,Yan Zhang.Can I ask how did you get the results of Fig.5 in your paper "Medical Image Segmentation Using New Hybrid Level-Set Method",Did you use matlab or other tools to get the translucent head?

22 Nov 2009 Yan Zhang

Hi Alex,

The problem has been fully discussed before, please see the previous comments for the details. In brief, go to the source file ac_distance_transform_3d.cpp, and get rid of the string in std::exception.

19 Nov 2009 Alex Kararg

Cannot compile running the compile_mex_codes.m . The output is :

expr: syntax error
/Applications/MATLAB_R2008a/bin/util/mex/mexutil.sh: line 13: [: too many arguments
ld warning: duplicate dylib /Applications/MATLAB_R2008a/bin/maci/libz.1.dylib
ld warning: duplicate dylib /Applications/MATLAB_R2008a/bin/maci/libz.1.dylib
ld warning: duplicate dylib /Applications/MATLAB_R2008a/bin/maci/libz.1.dylib
ld warning: duplicate dylib /Applications/MATLAB_R2008a/bin/maci/libz.1.dylib
ld warning: duplicate dylib /Applications/MATLAB_R2008a/bin/maci/libz.1.dylib
BinaryHeap.h: In member function 'void CBinaryHeapMinSort<IndexType, WeightType>::Insert(IndexType, WeightType) [with IndexType = int, WeightType = double]':
ac_distance_transform_3d.cpp:27: instantiated from 'void DistanceTransform3D(const InputType*, OutputType*, const int*) [with InputType = unsigned char, OutputType = double]'
ac_distance_transform_3d.cpp:115: instantiated from here
BinaryHeap.h:56: error: no matching function for call to 'std::exception::exception(const char [1])'
/usr/include/c++/4.0.0/exception:57: note: candidates are: std::exception::exception()
/usr/include/c++/4.0.0/exception:55: note: std::exception::exception(const std::exception&)

mex: compile of ' "ac_distance_transform_3d.cpp"' failed.

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

Error in ==> compile_mex_codes at 7
mex ac_distance_transform_3d.cpp

Any help to run the compile_mex_codes.m would be really appreciated. Thank you!

12 Nov 2009 Khin

Hi Yan Zhang, When I read your 'test_ChanVese_model_3d.m' and 'test_hybrid_model_3d.m', I have a problem that cannot read head_ct.mat file. It's showing error "??? Error using ==> load Unable to read MAT file head_ct.mat. File may be corrupt." is it because of version different? I am using Matlab 6.5 please advise. thanks

27 Oct 2009 Jenny

Hi,Zhang yan.Thank you for your toolbox.I have a problem.I'm trying to use your box to segment my own MRI head datas which are a series of JPEG or DICOM forms.Is your tool possible to segment this form of data.Or I must convert these formats to the supported formats.And how to?Thank you very much!

16 Oct 2009 Yan Zhang

Hi Eran,

To answer your first question, let' s use u to represent the level-set, normally we use curvature flow to smooth the curve
u_t = div(\nabla u/|\nabla u|)
In my implementation, I do this in two steps:
(1) Make |\nabla u| = 1 using reinitialization (ac_reinit).
(2) With (1) the above equation can be simplified to
u_t = div(\nabla u) = \del u (the Laplacian of u)
which describes the linear diffusion of the level-set.
It's more efficient than solving the more general PDE
u_t = div(g \nabla u/|\nabla u|)
which leads to the answer to your second question --- you should look into the codes in "ac_GAC_model" (AOS implementation for geodesic active contour) that tells exactly how to integrate edge information.

08 Oct 2009 Eran Ukwatta

Hi Yan Zhang,
Thanks for the code. By the way, I have a question. I am used to computing divergence of the level set function for the smoothness term. However in your code what I fould is linear diffusion. Are these two different things?
I also would like to add the edge based information to the chan-vese method for 3D segmentation. Is that straightforward as modifying the following evolving equation in the function "ac_ChanVese_model" ?

phi = phi + delta_t*image_weight*((I-mu_out).^2 - (I-mu_in).^2);

Thanks.

20 Sep 2009 jichao zhao

Could you provide your paper? I try to get your paper online, but it seems I can not. thanks

14 Sep 2009 Cris Luengo

This is a great starting point to explore active contours, thanks for the code!

On Marco's point 1: if you pass GCC the -std=c99 option it will allow the C++ style comments. They have only recently been added to the ANSI C standard. I agree that using /* */ comments is more portable.

08 Sep 2009 Yan Zhang

Hi Marco,

Thanks for your advices. For your Point 1, it's a strange problem, the file did pass my gcc 4.4 compiler on MacOSX. Then I tried to compile it on Ubuntu with the same compiler and it failed as you pointed out. As for Point 2, it's totally my fault.

08 Sep 2009 Marco

Hi Yan,

I tried to compile your toolbox on a linux system using gcc and still got some errors. I guess it would help linux people if you changed the following:

1. The comments in zy_binary_boundary_detection.c are not in ANSI C style. I know that double slashes are widely used, but in my case, I had to change all comments to be included in /* */ pairs. To make your code more widely compatible, changing this might help.
2. The error using std::exception is still there, because in BinaryHeap.c, line 56, you still pass an empty string to it. Replacing
throw std::exception("");
by
throw std::exception();
solved this for me.

After changing these two issues, everything compiled on my debian and R2008b.
Apart from that, thanks for sharing your code.

28 Aug 2009 Yan Zhang

Hi, Ning. One more thing: please don't use LCC compiler, it only supports C, NOT C++.

28 Aug 2009 Yan Zhang

Hi, Ning. Can you tell me which compiler are you using? It looks to me that the compiler doesn't support C++ (can't recognize keywords 'new', 'delete' and operator overloads). If you are using gcc, make sure link to the standard c++ library using '-lstdc++' or directly use g++.

If you are using Windows system, a more complete version of the toolbox can be downloaded from the following link:
http://ecson.org/resources/software/_AOSLevelsetSegmentationToolbox.zip
which includes all the pre-compiled mex files in the right place meaning you can use the toolbox directly without having to compile the c++ source files by yourself.

Hope this can help.

28 Aug 2009 Ning

Hi Yan,thx for the quick reply. I followed the instruction, but when i tried to run the compile_mex_codes, it can not get through, i attached the msg it gave out, could you tell me how to solve this? Thx again.

lcc preprocessor warning: ac_tridiagonal_Thomas_dll.cpp:95 No newline at end of file
Error ac_tridiagonal_Thomas_dll.cpp: 7 syntax error; found `unsigned' expecting `;'
Error ac_tridiagonal_Thomas_dll.cpp: 7 syntax error; found `unsigned' expecting `;'
Error ac_tridiagonal_Thomas_dll.cpp: 7 syntax error; found `unsigned' expecting `)'
Error ac_tridiagonal_Thomas_dll.cpp: 7 skipping `unsigned' `long' `int'
Error ac_tridiagonal_Thomas_dll.cpp: 7 undeclared identifier `i'
Warning ac_tridiagonal_Thomas_dll.cpp: 7 Statement has no effect
Warning ac_tridiagonal_Thomas_dll.cpp: 7 unreachable code
Error ac_tridiagonal_Thomas_dll.cpp: 7 syntax error; found `)' expecting `;'
Error ac_tridiagonal_Thomas_dll.cpp: 7 illegal statement termination
Error ac_tridiagonal_Thomas_dll.cpp: 7 skipping `)'
Error ac_tridiagonal_Thomas_dll.cpp: 19 undeclared identifier `new'
Error ac_tridiagonal_Thomas_dll.cpp: 19 operands of = have illegal types `pointer to double' and `int'
Warning ac_tridiagonal_Thomas_dll.cpp: 19 possible usage of new before definition
Error ac_tridiagonal_Thomas_dll.cpp: 19 syntax error; found `double' expecting `;'
Error ac_tridiagonal_Thomas_dll.cpp: 19 integer expression must be constant
Error ac_tridiagonal_Thomas_dll.cpp: 19 missing identifier
Error ac_tridiagonal_Thomas_dll.cpp: 51 undeclared identifier `delete'
Error ac_tridiagonal_Thomas_dll.cpp: 51 illegal expression
Error ac_tridiagonal_Thomas_dll.cpp: 51 syntax error; found `yy' expecting `]'
Error ac_tridiagonal_Thomas_dll.cpp: 51 type error: pointer expected
Warning ac_tridiagonal_Thomas_dll.cpp: 51 Statement has no effect
Error ac_tridiagonal_Thomas_dll.cpp: 51 syntax error; found `yy' expecting `;'
Warning ac_tridiagonal_Thomas_dll.cpp: 51 Statement has no effect
Warning ac_tridiagonal_Thomas_dll.cpp: 51 possible usage of delete before definition
Error ac_tridiagonal_Thomas_dll.cpp: 71 illegal statement termination
Error ac_tridiagonal_Thomas_dll.cpp: 71 skipping `double'
Error ac_tridiagonal_Thomas_dll.cpp: 71 too many errors

C:\PROGRAM FILES\MATLAB\R2006A\BIN\MEX.PL: Error: Compile of 'ac_tridiagonal_Thomas_dll.cpp' failed.

27 Aug 2009 Yan Zhang

Hi, Ning. Please read the 'readme.txt' file in the package, all the essential messages are there. Basically, (1) unzip the package and open matlab (2) in the matlab environment, go to the 'mex' folder and run 'compile_mex_codes', all the mex files will be automatically compiled and moved to the right directory. If this is your first time using the mex function, make sure to use 'mex -setup' command in the matlab command window to select an appropriate c++ compiler (MSVC, GCC or whatever).

26 Aug 2009 Ning

Hi Yan, i am new to the mex feature, could you tell me how to install your toolbox?
Thx!

19 Aug 2009 Ahmed

i downloaded the pre-compiled version and it worked, the thing is the documentation is not enough for me and i don't quite understand the different variables used and the inputs too

19 Aug 2009 Yan Zhang

Hi, Jichao. To fix the problem:
(1) Open BinaryHeap.h in the "mex" folder
(2) Locate "std::exception" in the file
(3) Get rid of the string "CFastMarching: Heap overflow!" (It works fine for MSVC, but for GCC std::exception class doesn't accept argument for its constructor.)
(4) Run compile_all_codes.m.

Please don't hesitate to contact me if there are any further questions.

18 Aug 2009 jichao zhao

Hi, Zhang Yan. Yes when I used compile_mex_codes to compile, I met the following errors:

BinaryHeap.h: In member function 'void CBinaryHeapMinSort<IndexType, WeightType>::Insert(IndexType, WeightType) [with IndexType = int, WeightType = double]':
ac_distance_transform_3d.cpp:25: instantiated from 'void DistanceTransform3D(const InputType*, OutputType*, const int*) [with InputType = unsigned char, OutputType = double]'
ac_distance_transform_3d.cpp:106: instantiated from here
BinaryHeap.h:50: error: no matching function for call to 'std::exception::exception(const char [30])'
/usr/include/c++/4.2/exception:59: note: candidates are: std::exception::exception()
/usr/include/c++/4.2/exception:57: note: std::exception::exception(const std::exception&)

mex: compile of 'ac_distance_transform_3d.cpp' failed.

Thanks for any hint so that I can fix it and use your package, cheers, jichao

14 Aug 2009 Jackson Shen

Exellent Work. *****

14 Aug 2009 Yan Zhang

Hi Jichao, can you tell me which compiler you are using and provide more information about the errors?

14 Aug 2009 Sebastien PARIS

Works fine.

13 Aug 2009 jichao zhao

It seems quite cool, but when I compiled mex, and I met some errors. Do not know how to fix it.

Updates
03 Sep 2009

A problem has been fixed for GCC complier.

28 Jan 2013

Another bug has been fixed related to the matlab "bwlabel" function having single-type output in 64-bit version.

Contact us