This is a static copy of a profile report

Home

tp_surfmap (202 calls, 10.344 sec)
Generated 05-Nov-2014 07:52:38 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/3D/vesicles/3D/tp_surfmap.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
tp_nucimgfeatfunction202
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
17
bounds = bwboundaries(imgk,8);
17218.241 s79.7%
24
R(k,:) = interp1([theta-2*pi;t...
17211.522 s14.7%
23
[theta,uidx] = unique(theta);
17210.411 s4.0%
22
[theta,rho] = cart2pol(boundX,...
17210.060 s0.6%
19
boundX = bound(:,1) - ctrX;
17210.040 s0.4%
All other lines  0.070 s0.7%
Totals  10.344 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
bwboundariesfunction17218.201 s79.3%
interp1function17211.112 s10.7%
uniquefunction17210.391 s3.8%
repmatfunction17210.240 s2.3%
cart2polfunction17210.040 s0.4%
Self time (built-ins, overhead, etc.)  0.360 s3.5%
Totals  10.344 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function28
Non-code lines (comments, blank lines)10
Code lines (lines that can run)18
Code lines that did run18
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function map = tp_surfmap(img,delta)
2 % TP_SURFMAP convert a 3D surface into a 2D map using Cartesian-Cylindrical
3 % coordinate transformation. DELTA is the resampling step size of theta
4
202 5 img = img > 0;
202 6 [H,W,S] = size(img);
202 7 ctrX = H/2;
202 8 ctrY = W/2;
9
202 10 Phi = -pi:delta:pi;
0.01 202 11 N = length(Phi);
202 12 R = zeros(S,N);
13
202 14 for k = 1:S
1721 15 imgk = img(:,:,k);
16 % Dectect boundary
8.24 1721 17 bounds = bwboundaries(imgk,8);
0.02 1721 18 bound = bounds{1};
0.04 1721 19 boundX = bound(:,1) - ctrX;
1721 20 boundY = bound(:,2) - ctrY;
21 % Resampling
0.06 1721 22 [theta,rho] = cart2pol(boundX,boundY);
0.41 1721 23 [theta,uidx] = unique(theta);
1.52 1721 24 R(k,:) = interp1([theta-2*pi;theta;theta+2*pi],...
25 repmat(rho(uidx),[3,1]),Phi);
0.01 1721 26 end
27
202 28 map = R;