This is a static copy of a profile report

Home

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)

Function NameFunction TypeCalls
ml_findmainobjfunction404
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
49
[imagelabeled,obj_number] = bw...
4044.596 s50.6%
58
[X,Y,Z] = ind2sub(imgsize,idx)...
4212.133 s23.5%
57
idx = find(imagelabeled==i);
4211.152 s12.7%
48
imagemask = imageproc > 0;
4040.631 s6.9%
59
objects{i} = [X,Y,Z,imageproc(...
4210.310 s3.4%
All other lines  0.270 s3.0%
Totals  9.093 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
bwlabelnfunction4044.556 s50.1%
ind2subfunction4212.123 s23.3%
num2strfunction8420.190 s2.1%
Self time (built-ins, overhead, etc.)  2.223 s24.4%
Totals  9.093 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function60
Non-code lines (comments, blank lines)39
Code lines (lines that can run)21
Code lines that did run12
Code lines that did not run9
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