This is a static copy of a profile report

Home

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 NameFunction TypeCalls
imfinfofunction1427
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
54
raw_tags = tifftagsread ( file...
14271.973 s85.3%
58
info = tifftagsprocess ( raw_t...
14270.090 s3.9%
23
[fid, msg] = fopen(filename, '...
14270.090 s3.9%
32
sig = fread(fid, 4, 'uint8')';
14270.060 s2.6%
51
fclose(fid);
14270.030 s1.3%
All other lines  0.070 s3.0%
Totals  2.313 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
imagesci/private/tifftagsreadMEX-file14271.933 s83.5%
imagesci/private/tifftagsprocessfunction14270.080 s3.5%
Self time (built-ins, overhead, etc.)  0.300 s13.0%
Totals  2.313 s100% 
Code Analyzer results
Line numberMessage
45The value assigned to variable 'byteOrder' might be unused.
47The value assigned to variable 'byteOrder' might be unused.
Coverage results
[ Show coverage for parent directory ]
Total lines in function58
Non-code lines (comments, blank lines)34
Code lines (lines that can run)24
Code lines that did run11
Code lines that did not run13
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 );