This is a static copy of a profile report

Home

tif2img (619 calls, 331.749 sec)
Generated 05-Nov-2014 07:52:36 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/tif2img.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ml_readimagefunction619
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
61
img(:,:,i) = imread( filename,...
11361329.065 s99.2%
54
info = imfinfo( filename );
6191.802 s0.5%
49
if ~(exist(filename)==2)
6190.441 s0.1%
62
end
113610.270 s0.1%
70
end%tif2img
6190.010 s0.0%
All other lines  0.160 s0.0%
Totals  331.749 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
imreadfunction11361126.926 s38.3%
imfinfofunction6191.802 s0.5%
Self time (built-ins, overhead, etc.)  203.021 s61.2%
Totals  331.749 s100% 
Code Analyzer results
Line numberMessage
45ISSTR will be removed in a future release. Use ISCHAR instead.
49EXIST with two input arguments is generally faster and clearer than with one input argument.
Coverage results
[ Show coverage for parent directory ]
Total lines in function70
Non-code lines (comments, blank lines)52
Code lines (lines that can run)18
Code lines that did run11
Code lines that did not run7
Coverage (did run/can run)61.11 %
Function listing
   time   calls  line
1 function img = tif2img( filename )
2 %TIF2IMG Reads a multichannel tif and loads the image to workspace.
3 %
4 % Inputs:
5 % filename = string containing path to image file. files may be of any BioFormats supported type.
6 %
7 % Outputs:
8 % img = resulting image matrix
9
10 % Author: Ivan E. Cao-Berg (icaoberg@cmu.edu)
11 % Created: August 5, 2008
12 %
13 % Copyright (C) 2008-2012 Murphy Lab
14 % Carnegie Mellon University
15 %
16 % April 11, 2012 I. Cao-Berg Removed contrast stretch of the image
17 % June 25, 2012 I. Cao-Berg Updated code so that the Matlab array
18 % inherits the properties of the tiff, i.e. the
19 % bit-depth
20 %
21 %
22 % This program is free software; you can redistribute it and/or modify
23 % it under the terms of the GNU General Public License as published
24 % by the Free Software Foundation; either version 2 of the License,
25 % or (at your option) any later version.
26 %
27 % This program is distributed in the hope that it will be useful, but
28 % WITHOUT ANY WARRANTY; without even the implied warranty of
29 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30 % General Public License for more details.
31 %
32 % You should have received a copy of the GNU General Public License
33 % along with this program; if not, write to the Free Software
34 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
35 % 02110-1301, USA.
36 %
37 % For additional information visit http://murphylab.web.cmu.edu or
38 % send email to murphy@cmu.edu
39
619 40 if nargin ~= 1
41 error('CellOrganizer: Wrong number of input arguments');
619 42 else%loads a multichannel tif to workspace
43
619 44 img=[];
0.01 619 45 if ~isstr(filename)
46 disp('CellOrganizer: filename has to be a string');
47 return;
48 end
0.44 619 49 if ~(exist(filename)==2)
50 disp('CellOrganizer:filename does not exist');
51 return;
52 end
53 %get information about this image
1.80 619 54 info = imfinfo( filename );
55 %recurse and load every channel to the workspace
0.01 619 56 for i=1:1:size( info, 1 )
57 %icaoberg june 25, 2012 by passing the image info
58 %the method imread inherits the properties of the original file
59 %most importantly the bit depth
60 %img(:,:,i) = imread( filename, i ); %#ok<AGROW>
329.07 11361 61 img(:,:,i) = imread( filename, i, 'Info', info ); %#ok<AGROW>
0.27 11361 62 end
63
64 %icaoberg june 25, 2012
65 %don't make the assumption images are uint8
66 %img = uint8( img );
67 %contrast-stretch the image
68 %img = ml_bcimg( img, [], [0 255] );
0.01 619 69 end
0.01 619 70 end%tif2img