This is a static copy of a profile report

Home

imagesci/private/readtif>process_region (11550 calls, 0.471 sec)
Generated 05-Nov-2014 07:52:37 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/matlab/imagesci/private/readtif.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
imagesci/private/readtiffunction11550
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
149
region_struct = struct([]);
115500.120 s25.5%
152
return;
115500.110 s23.4%
150
if isempty(region_cell)
115500.100 s21.3%
All other lines  0.140 s29.8%
Totals  0.471 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function54
Non-code lines (comments, blank lines)20
Code lines (lines that can run)34
Code lines that did run3
Code lines that did not run31
Coverage (did run/can run)8.82 %
Function listing
   time   calls  line
146 function region_struct = process_region(region_cell)
147 %PROCESS_PIXELREGION Convert a cells of pixel region info to a struct.
148
0.12 11550 149 region_struct = struct([]);
0.10 11550 150 if isempty(region_cell)
151 % Not specified in call to readtif.
0.11 11550 152 return;
153 end
154
155 if ((~iscell(region_cell)) || (numel(region_cell) ~= 2))
156 error(message('MATLAB:imagesci:readtif:pixelRegionCell'))
157 end
158
159 for p = 1:numel(region_cell)
160
161 checkIntegers(region_cell{p});
162
163 if (numel(region_cell{p}) == 2)
164
165 start = max(0, region_cell{p}(1) - 1);
166 incr = 1;
167 stop = region_cell{p}(2) - 1;
168
169 elseif (numel(region_cell{p}) == 3)
170
171 start = max(0, region_cell{p}(1) - 1);
172
173 if (~isinf(region_cell{p}(2)))
174 incr = region_cell{p}(2);
175 else
176 error(message('MATLAB:imagesci:readtif:infIncrement'));
177 end
178
179 stop = region_cell{p}(3) - 1;
180
181 else
182
183 error(message('MATLAB:imagesci:readtif:tooManyPixelRegionParts'));
184
185 end
186
187 if (start > stop)
188 error(message('MATLAB:imagesci:readtif:badPixelRegionStartStop'))
189 end
190
191 if (incr < 1)
192 error(message('MATLAB:imagesci:readtif:badPixelRegionIncrement'))
193 end
194
195 region_struct(p).start = start;
196 region_struct(p).incr = incr;
197 region_struct(p).stop = stop;
198
199 end

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