This is a static copy of a profile reportHome
maketform>box2 (3442 calls, 0.791 sec)
Generated 05-Nov-2014 07:53:02 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/maketform.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 |
712 | t = assigntform(N, N, @fwd_box... | 3442 | 0.340 s | 43.0% |  |
676 | if ~isfinitedouble(inBounds) | 3442 | 0.140 s | 17.7% |  |
680 | if ~isfinitedouble(outBounds) | 3442 | 0.110 s | 13.9% |  |
710 | tdata.shift = outBounds(1,:) -... | 3442 | 0.050 s | 6.3% |  |
695 | qDegenerate = (inBounds(1,:) ... | 3442 | 0.030 s | 3.8% |  |
All other lines | | | 0.120 s | 15.2% |  |
Totals | | | 0.791 s | 100% | |
Children (called functions)
Code Analyzer results
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 46 |
Non-code lines (comments, blank lines) | 25 |
Code lines (lines that can run) | 21 |
Code lines that did run | 13 |
Code lines that did not run | 8 |
Coverage (did run/can run) | 61.90 % |
Function listing
time calls line
667 function t = box2( inBounds, outBounds )
668
669 % Construct an affine TFORM struct that maps a box bounded by INBOUNDS(1,k)
670 % and INBOUNDS(2,k) in dimensions k to a box bounded by OUTBOUNDS(1,k) and
671 % OUTBOUNDS(2,k).
672 %
673 % inBounds: 2-by-N
674 % outBounds: 2-by-N
675
0.14 3442 676 if ~isfinitedouble(inBounds)
677 error(message('images:maketform:invalidInbounds'))
678 end
679
0.11 3442 680 if ~isfinitedouble(outBounds)
681 error(message('images:maketform:invalidOutbounds'))
682 end
683
0.02 3442 684 N = size(inBounds,2);
3442 685 if (ndims(inBounds) ~= 2 ...
686 || ndims(outBounds) ~= 2 ...
687 || size(inBounds,1) ~= 2 ...
688 || size(outBounds,1) ~= 2 ...
689 || size(outBounds,2) ~= N)
690
691 error(message('images:maketform:inboundsAndOutbounds2ByN'))
692
693 end
694
0.03 3442 695 qDegenerate = (inBounds(1,:) == inBounds(2,:));
3442 696 if any((outBounds(1,:) == outBounds(2,:)) ~= qDegenerate)
697
698 error(message('images:maketform:invalidInboundsAndOutbounds'))
699
700 end
701
0.01 3442 702 num = outBounds(2,:) - outBounds(1,:);
0.02 3442 703 den = inBounds(2,:) - inBounds(1,:);
704
705 % Arbitrarily set the scale to unity for degenerate dimensions.
0.02 3442 706 num(qDegenerate) = 1;
3442 707 den(qDegenerate) = 1;
708
0.02 3442 709 tdata.scale = num ./ den;
0.05 3442 710 tdata.shift = outBounds(1,:) - tdata.scale .* inBounds(1,:);
711
0.34 3442 712 t = assigntform(N, N, @fwd_box, @inv_box, tdata);
Other subfunctions in this file are not included in this listing.