This is a static copy of a profile report

Home

imformats (2 calls, 0.000 sec)
Generated 15-Mar-2007 12:01:56 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\imagesci\imformats.m
[Copy to new window for comparing multiple runs]

Parents (calling functions)

Function NameFunction TypeCalls
imreadM-function1
imagesci\private\imftypeM-function1
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
143
mlock;
20 s0%
114
varargout{1} = find_in_registr...
20 s0%
111
elseif (ischar(varargin{1}))
20 s0%
105
elseif (isequal(lower(varargin...
20 s0%
99
if (isstruct(varargin{1}))
20 s0%
Other lines & overhead  0 s0%
Totals  0.000 s0% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
imformats>build_registryM-subfunction10 s0%
imformats>find_in_registryM-subfunction20 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0.000 s0% 
M-Lint results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in file148
Non-code lines (comments, blank lines)108
Code lines (lines that can run)40
Code lines that did run15
Code lines that did not run25
Coverage (did run/can run)37.50 %
Function listing
   time   calls  line
1 function varargout = imformats(varargin)
2 %IMFORMATS Manage file format registry.
3 % FORMATS = IMFORMATS returns a structure containing all of the values in
4 % the file format registry. The fields in this structure are:
5 %
6 % ext - A cell array of file extensions for this format
7 % isa - Function to determine if a file "IS A" certain type
8 % info - Function to read information about a file
9 % read - Function to read image data a file
10 % write - Function to write MATLAB data to a file
11 % alpha - 1 if the format has an alpha channel, 0 otherwise
12 % description - A text description of the file format
13 %
14 % The values for the isa, info, read, and write fields must be functions
15 % which are on the MATLAB search path or function handles.
16 %
17 % FORMATS = IMFORMATS(FMT) searches the known formats for a format with
18 % extension given in the string "FMT." If found, a structure is returned
19 % containing the characteristics and function names. Otherwise an empty
20 % structure is returned.
21 %
22 % FORMATS = IMFORMATS(FORMAT_STRUCT) sets the format registry to contain
23 % the values in the "FORMAT_STRUCT" structure. The output structure
24 % FORMATS contains the new registry settings. See the "Warning" statement
25 % below.
26 %
27 % FORMATS = IMFORMATS('add', FORMAT_STRUCT) adds the values in the
28 % "FORMAT_STRUCT" structure to the format registry.
29 %
30 % FORMATS = IMFORMATS('factory') resets the file format registry to the
31 % default format registry values. This removes any user-specified
32 % settings.
33 %
34 % FORMATS = IMFORMATS('remove', FMT) removes the format with extension
35 % FMT from the format registry.
36 %
37 % FORMATS = IMFORMATS('update', FMT, FORMAT_STRUCT) change the format
38 % registry values for the format with extension FMT to have the values
39 % stored in FORMAT_STRUCT.
40 %
41 % IMFORMATS without any input or output arguments prettyprints a table of
42 % file format information for the supported formats.
43 %
44 % Warning:
45 %
46 % Using IMFORMATS to change the format registry is an advanced feature.
47 % Incorrect usage may prevent loading of image files. Use IMFORMATS
48 % with the 'factory' setting to return the format registry to a workable
49 % state.
50 %
51 % Note:
52 %
53 % Changes to the format registry do not persist between MATLAB sessions.
54 % To have a format always available when you start MATLAB, add the
55 % appropriate IMFORMATS commands to the startup.m file in
56 % $MATLAB/toolbox/local.
57 %
58 % See also IMREAD, IMWRITE, IMFINFO, FILEFORMATS, PATH.
59
60 % Copyright 1984-2003 The MathWorks, Inc.
61 % $Revision: 1.1.6.3 $ $Date: 2004/07/23 00:19:03 $
62
63 % Verify correct number of arguments
2 64 error(nargchk(0, 3, nargin, 'struct'));
2 65 error(nargoutchk(0, 1, nargout, 'struct'));
66
67 % Declare format structure as persistent variable
2 68 persistent fmts;
69
70 % If format structure is empty (first time)
2 71 if (isempty(fmts))
72
73 % Build default format structure
1 74 fmts = build_registry;
1 75 mlock
76
1 77 end
78
79 % Determine what to do based on number of input arguments
2 80 switch(nargin)
2 81 case 0
82 % 0 inputs: Informational only
83
84 if (nargout == 0)
85
86 % Pretty-print the registry
87 pretty_print_registry(fmts)
88
89 else
90
91 % Return the registry as a struct
92 varargout{1} = fmts;
93
94 end
95
2 96 case 1
97 % 1 input: Look for specific format or modify registry
98
2 99 if (isstruct(varargin{1}))
100
101 % Change the registry to contain the structure
102 fmts = update_registry(varargin{1});
103 varargout{1} = fmts;
104
2 105 elseif (isequal(lower(varargin{1}), 'factory'))
106
107 % Reset the registry to the default values
108 fmts = build_registry;
109 varargout{1} = fmts;
110
2 111 elseif (ischar(varargin{1}))
112
113 % Look for a particular format in the registry
2 114 varargout{1} = find_in_registry(fmts, varargin{1});
115
116 else
117
118 % Error out, wrong input argument type
119 error('MATLAB:imformats:badInputType', ...
120 'Input must be a structure or string.')
121
122 end
123
124 otherwise
125 % n inputs: Modify the registry using a command.
126
127 command = varargin{1};
128
129 switch (lower(command))
130 case 'add'
131 fmts = add_entry(fmts, varargin{2:end});
132 case 'update'
133 fmts = update_entry(fmts, varargin{2:end});
134 case 'remove'
135 fmts = remove_entry(fmts, varargin{2:end});
136 otherwise
137 error('MATLAB:imformats:unsupportedKeyword', ...
138 'Unsupported keyword %s.', command)
139 end
140 end
141
142 % Protect current file's persistent variables from CLEAR
2 143 mlock;
144
145
146 %%%
147 %%% Function build_registry
148 %%%

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