This is a static copy of a profile reportHome
ml_mainobjcontour (6058 calls, 108.300 sec)
Generated 05-Nov-2014 07:53:52 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/2D/tztoolbox/ml_mainobjcontour.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
39 | img2=imfill(img,'holes'); | 6058 | 71.008 s | 65.6% |  |
49 | img2=bwperim(img2,4); | 6057 | 12.557 s | 11.6% |  |
40 | imgedge=bwperim(img2,4); | 6058 | 8.251 s | 7.6% |  |
43 | obj=ml_findmainobj_bw(img2,4); | 6058 | 7.380 s | 6.8% |  |
45 | img2=ml_obj2img2D(obj,size(img... | 6057 | 4.286 s | 4.0% |  |
All other lines | | | 4.817 s | 4.4% |  |
Totals | | | 108.300 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
imfill | function | 6058 | 70.918 s | 65.5% |  |
bwperim | function | 12115 | 20.649 s | 19.1% |  |
ml_findmainobj_bw | function | 6058 | 7.270 s | 6.7% |  |
ml_obj2img2D | function | 6057 | 4.186 s | 3.9% |  |
Self time (built-ins, overhead, etc.) | | | 5.277 s | 4.9% |  |
Totals | | | 108.300 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 53 |
Non-code lines (comments, blank lines) | 35 |
Code lines (lines that can run) | 18 |
Code lines that did run | 15 |
Code lines that did not run | 3 |
Coverage (did run/can run) | 83.33 % |
Function listing
time calls line
1 function img2=ml_mainobjcontour(img)
2 %ML_MAINOBJCONTOUR Find the boundary of the biggest object in an image.
3 % IMG2 = ML_MAINOBJCONTOUR(IMG) returns an image that contains the
4 % boundary of the biggest object in the image IMG.
5 %
6 % See also
7
8 % 18-Sep-2005 Initial write T. Zhao
9 % Copyright (c) Murphy Lab, Carnegie Mellon University
10
11 % Copyright (C) 2007 Murphy Lab
12 % Carnegie Mellon University
13 %
14 % This program is free software; you can redistribute it and/or modify
15 % it under the terms of the GNU General Public License as published
16 % by the Free Software Foundation; either version 2 of the License,
17 % or (at your option) any later version.
18 %
19 % This program is distributed in the hope that it will be useful, but
20 % WITHOUT ANY WARRANTY; without even the implied warranty of
21 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 % General Public License for more details.
23 %
24 % You should have received a copy of the GNU General Public License
25 % along with this program; if not, write to the Free Software
26 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 % 02110-1301, USA.
28 %
29 % For additional information visit http://murphylab.web.cmu.edu or
30 % send email to murphy@cmu.edu
31
0.03 6058 32 if isempty(img)
33 img2=[];
34 return;
35 end
36
0.93 6058 37 img=double(img>0);
38
71.01 6058 39 img2=imfill(img,'holes');
8.25 6058 40 imgedge=bwperim(img2,4);
41
0.57 6058 42 img2=double(img2)-double(imgedge);
7.38 6058 43 obj=ml_findmainobj_bw(img2,4);
44
4.29 6057 45 img2=ml_obj2img2D(obj,size(img));
0.48 6057 46 img2=img2==0;
0.98 6057 47 img2=[ones(1,size(img2,2));img2;ones(1,size(img2,2))];
0.45 6057 48 img2=[ones(size(img2,1),1),img2,ones(size(img2,1),1)];
12.56 6057 49 img2=bwperim(img2,4);
0.43 6057 50 img2(:,1)=[];
0.36 6057 51 img2(:,end)=[];
0.31 6057 52 img2(1,:)=[];
0.20 6057 53 img2(end,:)=[];