This is a static copy of a profile reportHome
images/private/morphop>NhoodShapesOrthogonal (12120 calls, 6.639 sec)
Generated 05-Nov-2014 07:53:20 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/private/morphop.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 |
406 | nhood_size = size(getnhood(se(... | 72720 | 5.177 s | 78.0% |  |
407 | P(k,1:numel(nhood_size)) = nho... | 72720 | 0.531 s | 8.0% |  |
413 | TF = any( sum(P~=1,1) == 1); | 12120 | 0.230 s | 3.5% |  |
408 | end | 72720 | 0.210 s | 3.2% |  |
401 | num_strels = numel(se); | 12120 | 0.120 s | 1.8% |  |
All other lines | | | 0.371 s | 5.6% |  |
Totals | | | 6.639 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
strel>strel.getnhood | subfunction | 72720 | 3.214 s | 48.4% |  |
Self time (built-ins, overhead, etc.) | | | 3.425 s | 51.6% |  |
Totals | | | 6.639 s | 100% | |
Code Analyzer results
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 26 |
Non-code lines (comments, blank lines) | 18 |
Code lines (lines that can run) | 8 |
Code lines that did run | 8 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
388 function TF = NhoodShapesOrthogonal(se)
389
390 % Algorithm:
391 % * Create a matrix P where each row contains the size vector for the nhood of
392 % one strel in the sequence se. (se is already a sequence so we don't need to
393 % call getsequence(se) again here.)
394 %
395 % * Trailing singleton dimensions are added as needed for strels with fewer
396 % dimensions.
397 %
398 % * Find all values of P~=1. If there's only one of these in each column,
399 % the set of strels se is orthogonal.
400
0.12 12120 401 num_strels = numel(se);
402
0.09 12120 403 P = ones(num_strels,2);
404
0.06 12120 405 for k = 1:num_strels
5.18 72720 406 nhood_size = size(getnhood(se(k)));
0.53 72720 407 P(k,1:numel(nhood_size)) = nhood_size;
0.21 72720 408 end
409
410 % Fill in trailing singleton dimensions as needed
0.07 12120 411 P(P==0) = 1;
412
0.23 12120 413 TF = any( sum(P~=1,1) == 1);