This is a static copy of a profile reportHome
imagesci/private/imtifinfo (1427 calls, 2.313 sec)
Generated 05-Nov-2014 07:52:35 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/matlab/imagesci/private/imtifinfo.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
imfinfo | function | 1427 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
54 | raw_tags = tifftagsread ( file... | 1427 | 1.973 s | 85.3% |  |
58 | info = tifftagsprocess ( raw_t... | 1427 | 0.090 s | 3.9% |  |
23 | [fid, msg] = fopen(filename, '... | 1427 | 0.090 s | 3.9% |  |
32 | sig = fread(fid, 4, 'uint8')'; | 1427 | 0.060 s | 2.6% |  |
51 | fclose(fid); | 1427 | 0.030 s | 1.3% |  |
All other lines | | | 0.070 s | 3.0% |  |
Totals | | | 2.313 s | 100% | |
Children (called functions)
Code Analyzer results
Line number | Message |
45 | The value assigned to variable 'byteOrder' might be unused. |
47 | The value assigned to variable 'byteOrder' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 58 |
Non-code lines (comments, blank lines) | 34 |
Code lines (lines that can run) | 24 |
Code lines that did run | 11 |
Code lines that did not run | 13 |
Coverage (did run/can run) | 45.83 % |
Function listing
time calls line
1 function info = imtifinfo(filename)
2 %IMTIFINFO Information about a TIFF file.
3 % INFO = IMTIFINFO(FILENAME) returns a structure containing
4 % information about the TIFF file specified by the string
5 % FILENAME. If the TIFF file contains more than one image,
6 % INFO will be a structure array; each element of INFO contains
7 % information about one image in the TIFF file.
8 %
9 % See also IMREAD, IMWRITE, IMFINFO.
10
11 % Copyright 1984-2010 The MathWorks, Inc.
12 % $Revision: 1.1.6.12 $ $Date: 2011/05/17 02:27:54 $
13
14 % This function is a MATLAB program that does *not* use a libtiff-based
15 % MEX-file because the im*info functions are used when trying to
16 % guess the format of an input file because the user didn't
17 % specify the format. We don't want to take the memory hit of
18 % loading a big MEX-file just to see if we have a TIFF file.
19
20 % TIFF files might be little-endian or big-endian. Start with
21 % little-endian. If we're wrong, we'll catch it down below and
22 % reopen the file.
0.09 1427 23 [fid, msg] = fopen(filename, 'r', 'ieee-le');
0.01 1427 24 if (fid == -1)
25 error(message('MATLAB:imagesci:imtifinfo:fileOpen', filename, msg));
26 end
27
28
29
30 %
31 % Check that it is a valid tiff file.
0.06 1427 32 sig = fread(fid, 4, 'uint8')';
0.01 1427 33 if (isequal(sig, [73 73 43 0]) || isequal(sig, [77 77 0 43]))
34 % We do not as of yet handle Big Tiff
35 fclose(fid);
36 error(message('MATLAB:imagesci:imtifinfo:bigTiffNotSupported'));
37 end
0.02 1427 38 if (~isequal(sig, [73 73 42 0]) && ...
39 ~isequal(sig, [77 77 0 42]))
40 fclose(fid);
41 error(message('MATLAB:imagesci:imtifinfo:notTIFF'));
42 end
43
0.01 1427 44 if (sig(1) == 73)
0.02 1427 45 byteOrder = 'little-endian';
46 else
47 byteOrder = 'big-endian';
48 end
49
50
0.03 1427 51 fclose(fid);
52
53
1.97 1427 54 raw_tags = tifftagsread ( filename );
1427 55 if numel(raw_tags) == 0
56 error(message('MATLAB:imagesci:imtifinfo:noImages'));
57 end
0.09 1427 58 info = tifftagsprocess ( raw_tags );