This is a static copy of a profile reportHome
ml_parsecell (3029 calls, 15799.724 sec)
Generated 05-Nov-2014 07:52:28 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/3D/vesicles/ml_parsecell.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 |
82 | s2=updates2(s2,selcodes); | 3029 | 15790.301 s | 99.9% |  |
87 | cellcode=setfield(cellcode,sel... | 57532 | 8.772 s | 0.1% |  |
88 | end | 57532 | 0.180 s | 0.0% |  |
59 | s2.cellbody=cellbody; | 3029 | 0.080 s | 0.0% |  |
65 | clear cellcode; | 3029 | 0.050 s | 0.0% |  |
All other lines | | | 0.340 s | 0.0% |  |
Totals | | | 15799.724 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
ml_parsecell>updates2 | subfunction | 3029 | 15790.241 s | 99.9% |  |
setfield | function | 57532 | 3.986 s | 0.0% |  |
getfield | function | 57532 | 3.545 s | 0.0% |  |
Self time (built-ins, overhead, etc.) | | | 1.953 s | 0.0% |  |
Totals | | | 15799.724 s | 100% | |
Code Analyzer results
Line number | Message |
2 | Input argument 'isshow' might be unused. If this is OK, consider replacing it by ~. |
52 | The value assigned to variable 'image_index' might be unused. |
56 | The value assigned to variable 'isshow' might be unused. |
70 | Use dynamic fieldnames with structures instead of SETFIELD. |
70 | Use dynamic fieldnames with structures instead of GETFIELD. |
87 | Use dynamic fieldnames with structures instead of SETFIELD. |
87 | Use dynamic fieldnames with structures instead of GETFIELD. |
92 | This statement (and possibly following ones) cannot be reached. |
100 | Best practice is for CATCH to be followed by an identifier that gets the error information. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 102 |
Non-code lines (comments, blank lines) | 65 |
Code lines (lines that can run) | 37 |
Code lines that did run | 19 |
Code lines that did not run | 18 |
Coverage (did run/can run) | 51.35 % |
Function listing
time calls line
1 function cellcode = ...
2 ml_parsecell(cellcode,cellbody,nucbody,da,imgsize,selcodes, isshow )
3
4 %ML_PARSECELL Code cell morphology.
5 % CELLCODE =
6 % ML_PARSECELL(CELLCODE,CELLBODY,NUCBODY,DA,IMGSIZE,SELCODES,ISSHOW)
7 % returns a structure describing a cell. The input argument CELLCODE is
8 % the description from previous calculation. An existing field will not
9 % be updated. CELLBODY is an array of points (n1x2(3) matrix). NUCBODY is
10 % also an array of points (n2x2(3) matrix). DA is the step size of coding
11 % angles. IMGSIZE is the size of the original image. If ISSHOW is true,
12 % the image will be shown. SELCODES is a cell array of strings, which are
13 % feature names for calculation:
14 % {'da','nucarea','nuccenter','nucmangle','nuchitpts',...
15 % 'nuccontour','nucellhitpts','nucdist','nucelldist',...
16 % 'nucecc','cellarea','cellcenter','cellmangle',...
17 % 'cellcontour','cellhitpts','celldist','cellecc'}
18 % If SELCODES is empty, all features will be submitted for calculation.
19 %
20 % See also ML_COMBCCFEATS
21
22 % ??-???-2005 Initial write T. Zhao
23 %
24 % Copyright (C) 2007-2012 Murphy Lab
25 % Carnegie Mellon University
26 %
27 % March 23, 2012 I. Cao-Berg Added isshow flag
28 % April 11, 2012 I. Cao-Berg Added try/catch statements around every imshow call
29 %
30 %
31 % This program is free software; you can redistribute it and/or modify
32 % it under the terms of the GNU General Public License as published
33 % by the Free Software Foundation; either version 2 of the License,
34 % or (at your option) any later version.
35 %
36 % This program is distributed in the hope that it will be useful, but
37 % WITHOUT ANY WARRANTY; without even the implied warranty of
38 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
39 % General Public License for more details.
40 %
41 % You should have received a copy of the GNU General Public License
42 % along with this program; if not, write to the Free Software
43 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
44 % 02110-1301, USA.
45 %
46 % For additional information visit http://murphylab.web.cmu.edu or
47 % send email to murphy@cmu.edu
48
3029 49 if nargin < 7
50 error('Exactly 7 arguments are required')
0.02 3029 51 elseif nargin == 7
3029 52 image_index = 1;
3029 53 end
54
55
0.01 3029 56 isshow = 0;
57
58 %s2 is a structure to record which variables are ready
0.08 3029 59 s2.cellbody=cellbody;
0.01 3029 60 s2.nucbody=nucbody;
0.03 3029 61 s2.da=da;
0.03 3029 62 s2.imgsize=imgsize;
63
0.04 3029 64 if isempty(cellcode)
0.05 3029 65 clear cellcode;
66 else
67 %copy fields in cellcode to s2
68 f=fieldnames(cellcode);
69 for i=1:length(f)
70 s2=setfield(s2,f{i},getfield(cellcode,f{i}));
71 end
72 end
73
0.03 3029 74 if isempty(selcodes)
75 selcodes = {'da','nucarea','nuccenter','nucmangle','nuchitpts',...
76 'nuccontour','nucellhitpts','nucdist','nucelldist',...
77 'nucecc','cellarea','cellcenter','cellmangle',...
78 'cellcontour','cellhitpts','celldist','cellecc'};
79 end
80
81 %Calculate all required fields
15790.30 3029 82 s2=updates2(s2,selcodes);
83
84 %copy fields in s2 to cellcode
0.03 3028 85 cellcode.da=s2.da;
0.04 3028 86 for i=1:length(selcodes)
8.77 57532 87 cellcode=setfield(cellcode,selcodes{i},getfield(s2,selcodes{i}));
0.18 57532 88 end
89
0.01 3028 90 isshow = 0;
0.02 3028 91 if isshow
92 s2=updates2(s2,{'nucedge','celledge','nuccenter','len'});
93 img=double(s2.nucedge)+double(s2.celledge);
94 for a=0:45:359
95 img=ml_setimglnpixel2(img,s2.nuccenter(1:2),a,s2.len);
96 end
97
98 try
99 imshow(img,[]);
100 catch
101 end
102 end
Other subfunctions in this file are not included in this listing.