This is a static copy of a profile report

Home

images/private/tform (3442 calls, 9.103 sec)
Generated 05-Nov-2014 07:52:42 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/images/images/private/tform.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
tformfwdfunction1721
tforminvfunction1721
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
56
X = feval( t.(f.fwd_fcn), U, t...
34426.629 s72.8%
42
[U, D] = checkCoordinates( f, ...
34421.242 s13.6%
30
[t, A] = checkTform(f, numout,...
34420.711 s7.8%
27
iptchecknargin(2,inf,numel(var...
34420.080 s0.9%
61
X = reshape( X, [D L] );
34420.050 s0.6%
All other lines  0.391 s4.3%
Totals  9.103 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
maketform>inv_compositesubfunction17216.399 s70.3%
images/private/tform>checkCoordinatessubfunction34421.212 s13.3%
images/private/tform>checkTformsubfunction34420.591 s6.5%
maketform>fwd_affinesubfunction17210.160 s1.8%
iptchecknarginfunction34420 s0%
Self time (built-ins, overhead, etc.)  0.741 s8.1%
Totals  9.103 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function68
Non-code lines (comments, blank lines)36
Code lines (lines that can run)32
Code lines that did run26
Code lines that did not run6
Coverage (did run/can run)81.25 %
Function listing
   time   calls  line
1 function outputs = tform(direction, numout, varargin)
2 % Perform either a forward or inverse spatial transformation,
3 % in support of TFORMFWD and TFORMINV.
4
5 % Copyright 1993-2010 The MathWorks, Inc.
6 % $Revision: 1.1.6.8.2.1 $ $Date: 2011/07/18 00:35:47 $
7
8 % Set up a structure to control which direction things go,
9 % and to provide strings to use in error calls.
10
0.05 3442 11 if strcmp(direction,'fwd')
1721 12 f.name = 'TFORMFWD';
0.01 1721 13 f.ndims_in = 'ndims_in';
1721 14 f.ndims_out = 'ndims_out';
0.02 1721 15 f.fwd_fcn = 'forward_fcn';
0.01 1721 16 f.argname = 'U';
1721 17 f.arglist = 'U1,U2,U3,...';
1721 18 else
1721 19 f.name = 'TFORMINV';
0.02 1721 20 f.ndims_in = 'ndims_out';
0.01 1721 21 f.ndims_out = 'ndims_in';
0.02 1721 22 f.fwd_fcn = 'inverse_fcn';
0.01 1721 23 f.argname = 'X';
0.01 1721 24 f.arglist = 'X1,X2,X3,...';
1721 25 end
26
0.08 3442 27 iptchecknargin(2,inf,numel(varargin),f.name);
28
29 % Get the TFORM struct, t, and the remaining input arguments, A.
0.71 3442 30 [t, A] = checkTform(f, numout, varargin{:});
31
0.01 3442 32 P = t.(f.ndims_in); % Dimensionality of input space.
0.01 3442 33 L = t.(f.ndims_out); % Dimensionality of output space.
34
35 % Validate and organize the input coordinate data so that:
36 % U contains the input coordinates in an (N + 1)-dimensional array.
37 % D contains the sizes of the first N dimensions of U, after correctly
38 % accounting for trailing singleton dimensions that may have been
39 % dropped or added.
40
0.05 3442 41 if length(A) == 1
1.24 3442 42 [U, D] = checkCoordinates( f, P, A{1} );
43 else
44 [U, D] = concatenateCoordinates( f, P, A );
45 end
46
47 % Reshape U to collapse the first N dimensions into a single column.
48 % Each row of U is now a coordinate vector (of length NDIMS_IN) in
49 % t's input space.
50
0.02 3442 51 U = reshape( U, [prod(D) P] );
52
53 % Apply the transformation, mapping U from the input space to the
54 % output space.
55
6.63 3442 56 X = feval( t.(f.fwd_fcn), U, t );
57
58 % X is an array in which each row is a coordinate vector in t's output
59 % space. Reshape X to be D(1)-by-D(2)-by-...-by-D(N)-by-NDIMS_OUT.
60
0.05 3442 61 X = reshape( X, [D L] );
62
63 % Construct output.
0.04 3442 64 if (numout <= 1)
0.01 3442 65 outputs{1} = X;
66 else
67 outputs = separateCoordinates( X, numel(D), L );
68 end

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