This is a static copy of a profile report

Home

ml_bwmoment (6058 calls, 4.386 sec)
Generated 05-Nov-2014 07:53:52 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/3D/vesicles/ml_bwmoment.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ml_bwmajoranglefunction6058
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
57
covxy=cov(x-center(1),y-center...
60581.772 s40.4%
52
[x,y]=find(img>0);
60581.001 s22.8%
46
if sum(img(:))==0
60580.541 s12.3%
53
center=mean([x,y],1);
60580.481 s11.0%
62
mom = struct('cx',center(1),'c...
60580.280 s6.4%
All other lines  0.310 s7.1%
Totals  4.386 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
covfunction60581.602 s36.5%
meanfunction60580.320 s7.3%
Self time (built-ins, overhead, etc.)  2.463 s56.2%
Totals  4.386 s100% 
Code Analyzer results
Line numberMessage
48The first argument of WARNING should be a message identifier. Using a message identifier allows users better control over the message.
55The value assigned to variable 'S' might be unused.
Coverage results
[ Show coverage for parent directory ]
Total lines in function63
Non-code lines (comments, blank lines)45
Code lines (lines that can run)18
Code lines that did run12
Code lines that did not run6
Coverage (did run/can run)66.67 %
Function listing
   time   calls  line
1 function mom=ml_bwmoment(img)
2 %ML_BWMOMENT Moments of the binary version of an image.
3 % MOM = ML_BWMOMENT(IMG) returns the moments of the binary version of
4 % an image up to the second order. MOM is a structure with the follwoing
5 % fileds:
6 % cx - X coordinate of the center
7 % cy - Y coordinate of the center
8 % mu00 - zero order moment, always 1
9 % mu20 - the second moment of X coordinate
10 % mu02 - the second moment of Y coordinate
11 %
12 % See also
13
14 % ??-???-???? Initial write T. Zhao
15 % 30-OCT-2004 Modified T. Zhao
16 % - add comments
17 % 23-Mar-2005 Modified T. Zhao
18 % - standarize coordinate system
19 % Copyright (c) Murphy Lab, Carnegie Mellon University
20
21 % Copyright (C) 2007 Murphy Lab
22 % Carnegie Mellon University
23 %
24 % This program is free software; you can redistribute it and/or modify
25 % it under the terms of the GNU General Public License as published
26 % by the Free Software Foundation; either version 2 of the License,
27 % or (at your option) any later version.
28 %
29 % This program is distributed in the hope that it will be useful, but
30 % WITHOUT ANY WARRANTY; without even the implied warranty of
31 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32 % General Public License for more details.
33 %
34 % You should have received a copy of the GNU General Public License
35 % along with this program; if not, write to the Free Software
36 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
37 % 02110-1301, USA.
38 %
39 % For additional information visit http://murphylab.web.cmu.edu or
40 % send email to murphy@cmu.edu
41
0.03 6058 42 if nargin < 1
43 error('Exactly 1 argument is required')
44 end
45
0.54 6058 46 if sum(img(:))==0
47 mom=[];
48 warning('black image');
49 return;
50 end
51
1.00 6058 52 [x,y]=find(img>0);
0.48 6058 53 center=mean([x,y],1);
0.01 6058 54 mu00=1;
0.02 6058 55 S=length(x);
56
1.77 6058 57 covxy=cov(x-center(1),y-center(2),1);
0.01 6058 58 mu11=covxy(1,2);
0.03 6058 59 mu20=covxy(1,1);
0.03 6058 60 mu02=covxy(2,2);
61
0.28 6058 62 mom = struct('cx',center(1),'cy',center(2),'mu00',mu00,'mu11', ...
0.06 6058 63 mu11,'mu20', mu20,'mu02',mu02);

Other subfunctions in this file are not included in this listing.