This is a static copy of a profile reportHome
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 Name | Function Type | Calls |
preprocess | function | 404 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
34 | objs = ml_findobjs(img, conn); | 404 | 9.093 s | 87.3% |  |
53 | imobj = zeros(size(img)); | 404 | 0.601 s | 5.8% |  |
51 | inds = sub2ind(size(img), vox(... | 404 | 0.451 s | 4.3% |  |
36 | [~, ind] = max(cellfun(@(x) si... | 404 | 0.070 s | 0.7% |  |
54 | imobj(inds) = pix; | 404 | 0.060 s | 0.6% |  |
All other lines | | | 0.140 s | 1.3% |  |
Totals | | | 10.414 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
43 | The 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 function | 56 |
Non-code lines (comments, blank lines) | 32 |
Code lines (lines that can run) | 24 |
Code lines that did run | 16 |
Code lines that did not run | 8 |
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.