This is a static copy of a profile report

Home

strel>strel.getsequence (16669 calls, 1.542 sec)
Generated 05-Nov-2014 07:53:22 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)

Function NameFunction TypeCalls
images/private/morphop>ParseInputssubfunction14245
strel>strel.getsequencesubfunction2424
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
446
if ~isempty(se.CachedSequence)
162650.320 s20.8%
447
seq = se.CachedSequence;
131300.180 s11.7%
435
if length(se) > 1
166690.160 s10.4%
458
se.CachedSequence = seq;
31350.100 s6.5%
441
elseif isempty(se)
162650.090 s5.8%
All other lines  0.691 s44.8%
Totals  1.542 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
strel>strel.getsequencesubfunction24240 s0%
Self time (built-ins, overhead, etc.)  1.542 s100.0%
Totals  1.542 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)35
Code lines (lines that can run)25
Code lines that did run23
Code lines that did not run2
Coverage (did run/can run)92.00 %
Function listing
   time   calls  line
403 function seq = getsequence(se)
404 %GETSEQUENCE Extract sequence of decomposed structuring elements.
405 % SEQ = GETSEQUENCE(SE), where SE is a structuring element array,
406 % returns another structuring element array SEQ containing the
407 % individual structuring elements that form the decomposition of SE.
408 % SEQ is equivalent to SE, but the elements of SEQ have no
409 % decomposition.
410 %
411 % Example
412 % -------
413 % STREL uses decomposition for square structuring elements larger than
414 % 3-by-3. Use GETSEQUENCE to extract the decomposed structuring
415 % elements:
416 %
417 % se = strel('square',5)
418 % seq = getsequence(se)
419 %
420 % Use IMDILATE with the 'full' option to see that dilating sequentially
421 % with the decomposed structuring elements really does form a 5-by-5
422 % square:
423 %
424 % imdilate(1,seq,'full')
425
426 % Testing notes
427 % se: STREL array; individual elements may or may not be
428 % decomposed.
429 %
430 % seq: STREL array; individual elements may not be
431 % decomposed.
432 % That is, length(getsequence(seq(k))) must be 1. seq
433 % should be a column vector.
434
0.16 16669 435 if length(se) > 1
404 436 se = se(:);
0.01 404 437 seq = getsequence(se(1));
0.01 404 438 for k = 2:length(se)
0.03 808 439 seq = [seq; getsequence(se(k))]; %#ok<AGROW>
808 440 end
0.09 16265 441 elseif isempty(se)
442 % A bit of a hack here to return a 1-by-0 strel array.
443 seq = strel;
444 seq(1) = [];
0.06 16265 445 else
0.32 16265 446 if ~isempty(se.CachedSequence)
0.18 13130 447 seq = se.CachedSequence;
0.03 3135 448 else
0.07 3135 449 if isempty(se.decomposition)
0.01 2933 450 seq = se;
202 451 else
0.01 202 452 seq = getsequence(se.decomposition(1));
202 453 for k = 2:length(se.decomposition)
0.03 1010 454 seq = [seq; getsequence(se.decomposition(k))]; %#ok<AGROW>
0.02 1010 455 end
202 456 end
457
0.10 3135 458 se.CachedSequence = seq;
3135 459 end
0.08 16265 460 end
461
0.08 16669 462 end

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