This is a static copy of a profile reportHome
region_seg>get_curvature (234500 calls, 1379.138 sec)
Generated 05-Nov-2014 07:52:51 using cpu time.
subfunction in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/preprocessing/3D/ashariff/region_seg.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
region_seg | function | 234500 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
240 | curvature = ((phi_x2.*phi_yy +... | 234500 | 321.124 s | 23.3% |  |
210 | [y x] = ind2sub([dimy,dimx],id... | 234500 | 245.890 s | 17.8% |  |
220 | idup = sub2ind(size(phi),yp1,x... | 234500 | 77.417 s | 5.6% |  |
226 | iddl = sub2ind(size(phi),ym1,x... | 234500 | 67.503 s | 4.9% |  |
221 | iddn = sub2ind(size(phi),ym1,x... | 234500 | 66.782 s | 4.8% |  |
All other lines | | | 600.421 s | 43.5% |  |
Totals | | | 1379.138 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
sub2ind | function | 1876000 | 511.077 s | 37.1% |  |
ind2sub | function | 234500 | 241.444 s | 17.5% |  |
Self time (built-ins, overhead, etc.) | | | 626.617 s | 45.4% |  |
Totals | | | 1379.138 s | 100% | |
Code Analyzer results
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 34 |
Non-code lines (comments, blank lines) | 12 |
Code lines (lines that can run) | 22 |
Code lines that did run | 22 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
208 function curvature = get_curvature(phi,idx)
0.78 234500 209 [dimy, dimx] = size(phi);
245.89 234500 210 [y x] = ind2sub([dimy,dimx],idx); % get subscripts
211
212 %-- get subscripts of neighbors
10.96 234500 213 ym1 = y-1; xm1 = x-1; yp1 = y+1; xp1 = x+1;
214
215 %-- bounds checking
11.63 234500 216 ym1(ym1<1) = 1; xm1(xm1<1) = 1;
9.66 234500 217 yp1(yp1>dimy)=dimy; xp1(xp1>dimx) = dimx;
218
219 %-- get indexes for 8 neighbors
77.42 234500 220 idup = sub2ind(size(phi),yp1,x);
66.78 234500 221 iddn = sub2ind(size(phi),ym1,x);
65.18 234500 222 idlt = sub2ind(size(phi),y,xm1);
66.06 234500 223 idrt = sub2ind(size(phi),y,xp1);
66.69 234500 224 idul = sub2ind(size(phi),yp1,xm1);
66.31 234500 225 idur = sub2ind(size(phi),yp1,xp1);
67.50 234500 226 iddl = sub2ind(size(phi),ym1,xm1);
64.09 234500 227 iddr = sub2ind(size(phi),ym1,xp1);
228
229 %-- get central derivatives of SDF at x,y
43.59 234500 230 phi_x = -phi(idlt)+phi(idrt);
28.39 234500 231 phi_y = -phi(iddn)+phi(idup);
43.44 234500 232 phi_xx = phi(idlt)-2*phi(idx)+phi(idrt);
42.68 234500 233 phi_yy = phi(iddn)-2*phi(idx)+phi(idup);
64.39 234500 234 phi_xy = -0.25*phi(iddl)-0.25*phi(idur)...
235 +0.25*phi(iddr)+0.25*phi(idul);
3.77 234500 236 phi_x2 = phi_x.^2;
3.01 234500 237 phi_y2 = phi_y.^2;
238
239 %-- compute curvature (Kappa)
321.12 234500 240 curvature = ((phi_x2.*phi_yy + phi_y2.*phi_xx - 2*phi_x.*phi_y.*phi_xy)./...
1.85 234500 241 (phi_x2 + phi_y2 +eps).^(3/2)).*(phi_x2 + phi_y2).^(1/2);
Other subfunctions in this file are not included in this listing.