This is a static copy of a profile reportHome
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)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
57 | covxy=cov(x-center(1),y-center... | 6058 | 1.772 s | 40.4% |  |
52 | [x,y]=find(img>0); | 6058 | 1.001 s | 22.8% |  |
46 | if sum(img(:))==0 | 6058 | 0.541 s | 12.3% |  |
53 | center=mean([x,y],1); | 6058 | 0.481 s | 11.0% |  |
62 | mom = struct('cx',center(1),'c... | 6058 | 0.280 s | 6.4% |  |
All other lines | | | 0.310 s | 7.1% |  |
Totals | | | 4.386 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
cov | function | 6058 | 1.602 s | 36.5% |  |
mean | function | 6058 | 0.320 s | 7.3% |  |
Self time (built-ins, overhead, etc.) | | | 2.463 s | 56.2% |  |
Totals | | | 4.386 s | 100% | |
Code Analyzer results
Line number | Message |
48 | The first argument of WARNING should be a message identifier. Using a message identifier allows users better control over the message. |
55 | The value assigned to variable 'S' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 63 |
Non-code lines (comments, blank lines) | 45 |
Code lines (lines that can run) | 18 |
Code lines that did run | 12 |
Code lines that did not run | 6 |
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.