This is a static copy of a profile reportHome
imuitools\private\imageDisplayParseInputs>validateCData (1 call, 0.000 sec)
Generated 15-Mar-2007 12:02:01 using real time.
M-subfunction in file C:\Program Files\MATLAB71\toolbox\images\imuitools\private\imageDisplayParseInputs.m
[Copy to new window for comparing multiple runs]
Parents (calling functions)
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
284 | if (~isreal(cdata)) | 1 | 0 s | 0% |  |
278 | if ndims(cdata) == 3 &&... | 1 | 0 s | 0% |  |
270 | if strcmp(image_type,'indexed'... | 1 | 0 s | 0% |  |
260 | if ( (ndims(cdata) == 3) &am... | 1 | 0 s | 0% |  |
254 | if islogical(cdata) &&... | 1 | 0 s | 0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.000 s | 0% | |
Children (called functions)
No childrenM-Lint results
Coverage results
[ Show coverage for parent directory ]
Total lines in file | 44 |
Non-code lines (comments, blank lines) | 16 |
Code lines (lines that can run) | 28 |
Code lines that did run | 6 |
Code lines that did not run | 22 |
Coverage (did run/can run) | 21.43 % |
Function listing
time calls line
247 function cdata = validateCData(cdata,image_type)
248
1 249 if ((ndims(cdata) > 3) || ((size(cdata,3) ~= 1) && (size(cdata,3) ~= 3)))
250 eid = sprintf('Images:%s:unsupportedDimension',mfilename);
251 error(eid, '%s', 'Unsupported dimension')
252 end
253
1 254 if islogical(cdata) && (ndims(cdata) > 2)
255 eid = sprintf('Images:%s:expected2D',mfilename);
256 error(eid, '%s', 'If input is logical (binary), it must be two-dimensional.');
257 end
258
259 % RGB images can be only be uint8, uint16, single, or double
1 260 if ( (ndims(cdata) == 3) && ...
261 ~isa(cdata, 'double') && ...
262 ~isa(cdata, 'uint8') && ...
263 ~isa(cdata, 'uint16') && ...
264 ~isa(cdata, 'single') )
265 eid = sprintf('Images:%s:invalidRGBClass',mfilename);
266 msg = 'RGB images must be uint8, uint16, single, or double.';
267 error(eid,'%s',msg);
268 end
269
1 270 if strcmp(image_type,'indexed') && isa(cdata,'int16')
271 eid = sprintf('Images:%s:invalidIndexedImage',mfilename);
272 msg1 = 'An indexed image can be uint8, uint16, double, single, or ';
273 msg2 = 'logical.';
274 error(eid,'%s %s',msg1, msg2);
275 end
276
277 % Clip double and single RGB images to [0 1] range
1 278 if ndims(cdata) == 3 && ( isa(cdata, 'double') || isa(cdata,'single') )
279 cdata(cdata > 1) = 1;
280 cdata(cdata < 0) = 0;
281 end
282
283 % Catch complex CData case
1 284 if (~isreal(cdata))
285 wid = sprintf('Images:%s:displayingRealPart',mfilename);
286 warning(wid, '%s', 'Displaying real part of complex input.');
287 cdata = real(cdata);
288 end
289
290 %------------------------------------------------
Other subfunctions in this file are not included in this listing.