This is a static copy of a profile reportHome
ml_findobjs (404 calls, 9.093 sec)
Generated 05-Nov-2014 07:52:34 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/3D/vesicles/ml_findobjs.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 |
49 | [imagelabeled,obj_number] = bw... | 404 | 4.596 s | 50.6% |  |
58 | [X,Y,Z] = ind2sub(imgsize,idx)... | 421 | 2.133 s | 23.5% |  |
57 | idx = find(imagelabeled==i); | 421 | 1.152 s | 12.7% |  |
48 | imagemask = imageproc > 0; | 404 | 0.631 s | 6.9% |  |
59 | objects{i} = [X,Y,Z,imageproc(... | 421 | 0.310 s | 3.4% |  |
All other lines | | | 0.270 s | 3.0% |  |
Totals | | | 9.093 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
bwlabeln | function | 404 | 4.556 s | 50.1% |  |
ind2sub | function | 421 | 2.123 s | 23.3% |  |
num2str | function | 842 | 0.190 s | 2.1% |  |
Self time (built-ins, overhead, etc.) | | | 2.223 s | 24.4% |  |
Totals | | | 9.093 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 60 |
Non-code lines (comments, blank lines) | 39 |
Code lines (lines that can run) | 21 |
Code lines that did run | 12 |
Code lines that did not run | 9 |
Coverage (did run/can run) | 57.14 % |
Function listing
time calls line
1 function objects = ml_findobjs(imageproc, conn)
2 %ML_FINDOBJS Find objects in an image.
3 % OBJECTS = ML_FINDOBJS(IMGPROC) returns a cell array of objects. Each
4 % object is a 4-column matrix with each row [X, Y, Z, gray level]. Any
5 % value less than 1 in IMGPROC will be considered as background.
6
7 % ??-???-???? Initial write T. Zhao
8 % Copyright (c) Murphy Lab, Carnegie Mellon University
9 %
10 % Edited:
11 % 09/03/13 - D. Sullivan, consolidated call to bwlabeln
12 % 01/03/14 - G. Johnson, allow for connectivity option
13
14 % Copyright (C) 2007-2014 Murphy Lab
15 % Carnegie Mellon University
16 %
17 % This program is free software; you can redistribute it and/or modify
18 % it under the terms of the GNU General Public License as published
19 % by the Free Software Foundation; either version 2 of the License,
20 % or (at your option) any later version.
21 %
22 % This program is distributed in the hope that it will be useful, but
23 % WITHOUT ANY WARRANTY; without even the implied warranty of
24 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 % General Public License for more details.
26 %
27 % You should have received a copy of the GNU General Public License
28 % along with this program; if not, write to the Free Software
29 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
30 % 02110-1301, USA.
31 %
32 % For additional information visit http://murphylab.web.cmu.edu or
33 % send email to murphy@cmu.edu
34
404 35 if nargin > 2
36 error('Exactly 1 or 2 argument is required')
37 end
38
0.02 404 39 if ~exist('conn', 'var')
40 nd = ndims(imageproc);
41 if nd == 2
42 conn = 8;
43 else
44 conn = 26;
45 end
46 end
47
0.63 404 48 imagemask = imageproc > 0;
4.60 404 49 [imagelabeled,obj_number] = bwlabeln(imagemask,conn);
50 %9/3/13 D. Sullivan consolidated bwlabeln call
51 % imagelabeled = bwlabeln(imagemask);
52 % obj_number = max(imagelabeled(:));
0.01 404 53 objects = cell(1,obj_number);
0.01 404 54 imgsize = size(imageproc);
404 55 for i=1:obj_number
0.22 421 56 disp(['Parsing object ' num2str(i) ' of ' num2str(obj_number)]);
1.15 421 57 idx = find(imagelabeled==i);
2.13 421 58 [X,Y,Z] = ind2sub(imgsize,idx);
0.31 421 59 objects{i} = [X,Y,Z,imageproc(idx)];
421 60 end