This is a static copy of a profile reportHome
strel>MakeLineStrel (404 calls, 3.805 sec)
Generated 05-Nov-2014 07:52:52 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/strel.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 |
847 | se = strel; | 404 | 3.275 s | 86.1% |  |
858 | se.nhood = false(M,N); | 404 | 0.320 s | 8.4% |  |
855 | [c,r] = iptui.intline(-x,x,-y,... | 404 | 0.090 s | 2.4% |  |
859 | idx = sub2ind([M N], r + max(a... | 404 | 0.040 s | 1.1% |  |
861 | se.height = zeros(M,N); | 404 | 0.030 s | 0.8% |  |
All other lines | | | 0.050 s | 1.3% |  |
Totals | | | 3.805 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
strel>strel.strel | subfunction | 404 | 3.255 s | 85.5% |  |
intline | function | 404 | 0.080 s | 2.1% |  |
sub2ind | function | 404 | 0.010 s | 0.3% |  |
Self time (built-ins, overhead, etc.) | | | 0.461 s | 12.1% |  |
Totals | | | 3.805 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 22 |
Non-code lines (comments, blank lines) | 7 |
Code lines (lines that can run) | 15 |
Code lines that did run | 13 |
Code lines that did not run | 2 |
Coverage (did run/can run) | 86.67 % |
Function listing
time calls line
845 function se = MakeLineStrel(len,theta_d)
846
3.27 404 847 se = strel;
848
0.01 404 849 if (len >= 1)
850 % The line is constructed so that it is always symmetric with respect
851 % to the origin.
404 852 theta = theta_d * pi / 180;
404 853 x = round((len-1)/2 * cos(theta));
404 854 y = -round((len-1)/2 * sin(theta));
0.09 404 855 [c,r] = iptui.intline(-x,x,-y,y);
0.01 404 856 M = 2*max(abs(r)) + 1;
0.01 404 857 N = 2*max(abs(c)) + 1;
0.32 404 858 se.nhood = false(M,N);
0.04 404 859 idx = sub2ind([M N], r + max(abs(r)) + 1, c + max(abs(c)) + 1);
0.02 404 860 se.nhood(idx) = 1;
0.03 404 861 se.height = zeros(M,N);
862 else
863 % Do nothing here, which effectively returns the empty strel.
864 end
865
404 866 end
Other subfunctions in this file are not included in this listing.