This is a static copy of a profile report

Home

ml_findmainobj (404 calls, 10.414 sec)
Generated 05-Nov-2014 07:52:52 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/ml_findmainobj.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
preprocessfunction404
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
34
objs = ml_findobjs(img, conn);
4049.093 s87.3%
53
imobj = zeros(size(img));
4040.601 s5.8%
51
inds = sub2ind(size(img), vox(...
4040.451 s4.3%
36
[~, ind] = max(cellfun(@(x) si...
4040.070 s0.7%
54
imobj(inds) = pix;
4040.060 s0.6%
All other lines  0.140 s1.3%
Totals  10.414 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
ml_findobjsfunction4049.093 s87.3%
sub2indfunction4040.421 s4.0%
ml_findmainobj>create@(x)size(x,1)anonymous function4040.050 s0.5%
ml_findmainobj>@(x)size(x,1)anonymous function4210.010 s0.1%
Self time (built-ins, overhead, etc.)  0.841 s8.1%
Totals  10.414 s100% 
Code Analyzer results
Line numberMessage
43The first argument of WARNING should be a message identifier. Using a message identifier allows users better control over the message.
Coverage results
[ Show coverage for parent directory ]
Total lines in function56
Non-code lines (comments, blank lines)32
Code lines (lines that can run)24
Code lines that did run16
Code lines that did not run8
Coverage (did run/can run)66.67 %
Function listing
   time   calls  line
1 function [ imobj ] = ml_findmainobj(img, conn )
2 %finds the largest non-zero pixel region in an image
3
4 % grj 3/29/13
5 % Copyright (C) 2007-2013 Murphy Lab
6 % Carnegie Mellon University
7 %
8 % This program is free software; you can redistribute it and/or modify
9 % it under the terms of the GNU General Public License as published
10 % by the Free Software Foundation; either version 2 of the License,
11 % or (at your option) any later version.
12 %
13 % This program is distributed in the hope that it will be useful, but
14 % WITHOUT ANY WARRANTY; without even the implied warranty of
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 % General Public License for more details.
17 %
18 % You should have received a copy of the GNU General Public License
19 % along with this program; if not, write to the Free Software
20 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 % 02110-1301, USA.
22 %
23 % For additional information visit http://murphylab.web.cmu.edu or
24 % send email to murphy@cmu.edu
25
0.02 404 26 if ~exist('conn', 'var')
404 27 if ndims(img) == 2
28 conn = 8;
404 29 else
404 30 conn = 26;
404 31 end
0.02 404 32 end
33
9.09 404 34 objs = ml_findobjs(img, conn);
35
0.07 404 36 [~, ind] = max(cellfun(@(x) size(x, 1), objs));
37
404 38 if ~isempty( ind )
404 39 vox = objs{ind};
40 else
41 disp( 'Number of unique values found in image' )
42 unique( img );
43 warning( 'No objects found in image. Exiting method.' );
44 imobj = [];
45 return
46 end
47
0.03 404 48 pix = vox(:,4);
0.03 404 49 vox = double(vox(:,1:3));
50
0.45 404 51 inds = sub2ind(size(img), vox(:,1), vox(:,2), vox(:,3));
52
0.60 404 53 imobj = zeros(size(img));
0.06 404 54 imobj(inds) = pix;
55
0.01 404 56 end

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