This is a static copy of a profile report

Home

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)

Function NameFunction TypeCalls
ml_parsecell>updates2subfunction6058
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
39
img2=imfill(img,'holes');
605871.008 s65.6%
49
img2=bwperim(img2,4);
605712.557 s11.6%
40
imgedge=bwperim(img2,4);
60588.251 s7.6%
43
obj=ml_findmainobj_bw(img2,4);
60587.380 s6.8%
45
img2=ml_obj2img2D(obj,size(img...
60574.286 s4.0%
All other lines  4.817 s4.4%
Totals  108.300 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
imfillfunction605870.918 s65.5%
bwperimfunction1211520.649 s19.1%
ml_findmainobj_bwfunction60587.270 s6.7%
ml_obj2img2Dfunction60574.186 s3.9%
Self time (built-ins, overhead, etc.)  5.277 s4.9%
Totals  108.300 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function53
Non-code lines (comments, blank lines)35
Code lines (lines that can run)18
Code lines that did run15
Code lines that did not run3
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,:)=[];