This is a static copy of a profile reportHome
demo3D11 (1 call, 57718.877 sec)
Generated 05-Nov-2014 07:52:28 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/demos/3D/demo3D11/demo3D11.m
Copy to new window for comparing multiple runs
Parents (calling functions)
No parent Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
185 | answer = img2slml( dimensional... | 1 | 57700.331 s | 100.0% |  |
79 | urlwrite([url filesep tarball]... | 4 | 17.054 s | 0.0% |  |
103 | movefile( filenames{k}, [ pwd ... | 808 | 0.841 s | 0.0% |  |
99 | filenames = ml_ls( [ pwd files... | 16 | 0.340 s | 0.0% |  |
102 | [ path filename extension ] = ... | 808 | 0.240 s | 0.0% |  |
All other lines | | | 0.070 s | 0.0% |  |
Totals | | | 57718.877 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
img2slml | function | 1 | 57700.311 s | 100.0% |  |
urlwrite | function | 4 | 17.044 s | 0.0% |  |
ml_ls | function | 16 | 0.330 s | 0.0% |  |
fileparts | function | 808 | 0.230 s | 0.0% |  |
filesep | function | 1661 | 0.030 s | 0.0% |  |
pwd | function | 829 | 0.030 s | 0.0% |  |
ml_initparam | function | 3 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.901 s | 0.0% |  |
Totals | | | 57718.877 s | 100% | |
Code Analyzer results
Line number | Message |
44 | Best practice is for CATCH to be followed by an identifier that gets the error information. |
102 | The value assigned here to 'path' appears to be unused. Consider replacing it by ~. |
124 | The value assigned here to 'status' appears to be unused. Consider replacing it by ~. |
126 | The value assigned to variable 'err' might be unused. |
143 | The value assigned here to 'status' appears to be unused. Consider replacing it by ~. |
145 | The value assigned to variable 'err' might be unused. |
159 | The value assigned here to 'status' appears to be unused. Consider replacing it by ~. |
161 | The value assigned to variable 'err' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 185 |
Non-code lines (comments, blank lines) | 89 |
Code lines (lines that can run) | 96 |
Code lines that did run | 72 |
Code lines that did not run | 24 |
Coverage (did run/can run) | 75.00 % |
Function listing
time calls line
1 function answer = demo3D11( param )
2 % demo3D11
3 %
4 % Trains a generative model of the cell framework using the four patterns in the 3D HeLa
5 % dataset from the Murphy Lab
6
7 % Created: Ivan E. Cao-Berg
8 %
9 % Copyright (C) 2012-2104 Murphy Lab
10 % Lane Center for Computational Biology
11 % School of Computer Science
12 % Carnegie Mellon University
13 %
14 % May 15, 2013 I. Cao-Berg Updated method to support wildcards
15 %
16 % This program is free software; you can redistribute it and/or modify
17 % it under the terms of the GNU General Public License as published
18 % by the Free Software Foundation; either version 2 of the License,
19 % or (at your option) any later version.
20 %
21 % This program is distributed in the hope that it will be useful, but
22 % WITHOUT ANY WARRANTY; without even the implied warranty of
23 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 % General Public License for more details.
25 %
26 % You should have received a copy of the GNU General Public License
27 % along with this program; if not, write to the Free Software
28 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 % 02110-1301, USA.
30 %
31 % For additional information visit http://murphylab.web.cmu.edu or
32 % send email to murphy@cmu.edu
33
1 34 curr_path = which('demo3D11.m');
1 35 curr_path = curr_path(1:end-10);
1 36 cd(curr_path);
37
1 38 if nargin == 0
39 param = [];
40 model = [];
1 41 else
1 42 try
1 43 model = param.model;
44 catch
45 model = [];
46 end
1 47 end
48
0.01 1 49 model = ml_initparam( model, ...
50 struct( 'downsampling', [1,1,1] ) );
1 51 param = ml_initparam( param, ...
52 struct( 'seed', 3 ) );
1 53 param = ml_initparam( param, ...
54 struct( 'preprocess', true ) );
55
1 56 param.model = model;
1 57 clear model
58
59 %list of available patterns
1 60 patterns = { 'Nuc', 'Mit', 'LAM', 'TfR' };
61
62 %icaoberg 11/16/2012
1 63 url = 'http://murphylab.web.cmu.edu/data/Hela/3D/multitiff';
64
1 65 imageDirectory = [ pwd filesep 'images' ];
0.01 1 66 if ~exist( imageDirectory, 'dir' )
1 67 mkdir( imageDirectory );
1 68 end
69
1 70 if exist( imageDirectory, 'dir' ) && length( dir(imageDirectory) ) == 196
71 disp('Image directory found and built');
1 72 else
1 73 for index=1:1:length(patterns)
4 74 pattern = patterns{index};
4 75 disp( pattern )
4 76 tarball = [ '3DHela_' pattern '.tgz' ];
0.01 4 77 if ~exist( tarball, 'file' )
4 78 disp([ 'Downloading Dataset: ' tarball ]);
17.05 4 79 urlwrite([url filesep tarball], tarball);
80
4 81 disp( 'Extracting files' );
0.03 4 82 system(['tar -xvf ' pwd filesep tarball] );
83 else
84 disp( 'Pattern found on disk. Extracting files from existing tarball' );
85 if ~exist( [pwd filesep pattern], 'file' )
86 disp( 'Extracting files' );
87 untar( tarball );
88 else
89 disp( 'Extracted folder found. Skipping extraction' );
90 end
91 end
4 92 end
93
1 94 for i=1:1:length(patterns)
4 95 pattern = patterns{i};
4 96 files = {'cell*ch0*.tif', 'cell*ch1*tif', 'cell*ch2*tif', '*mask*'};
97
4 98 for j=1:1:length(files)
0.34 16 99 filenames = ml_ls( [ pwd filesep pattern filesep files{j} ] );
100
16 101 for k=1:1:length(filenames)
0.24 808 102 [ path filename extension ] = fileparts( filenames{k} );
0.84 808 103 movefile( filenames{k}, [ pwd filesep 'images' filesep pattern '_' filename extension ] )
808 104 end
16 105 end
4 106 end
1 107 end
108
1 109 dimensionality = '3D';
1 110 pattern = 'framework';
111
1 112 dna = [imageDirectory filesep '*cell*ch0*.tif'];
1 113 cell = [imageDirectory filesep '*cell*ch1*.tif'];
1 114 protein = [imageDirectory filesep '*cell*ch2*.tif'];
1 115 param.masks = [imageDirectory filesep '*mask*.tif'];
116
117 % generic model options
118 % ---------------------
119 % model.name (optional) Holds the name of the model. Default is empty.
1 120 param.model.name = '3d_hela_framework_model';
121
122 % model.id (optional) Holds the id of the model. Default is empty.
1 123 try
1 124 [status,result] = system( 'uuidgen' );
0.01 1 125 param.model.id = result(1:end-1);
126 catch err
127 param.model.id = num2str(now);
128 end
129
130 % model.filename Holds the output filename.
1 131 param.model.filename = [ lower(pattern) '.xml' ];
132
133 % nuclear shape model options
134 % ---------------------------
135 % nucleus.type Holds the nuclear model type. Default is "major axis".
1 136 param.nucleus.type = 'major axis';
137
138 % nucleus.name (optional) Holds the name of the nuclear model. Default is empty.
1 139 param.nucleus.name = 'all';
140
141 % nucleus.id (optional) Holds the id of the nuclear model. Default is empty.
1 142 try
1 143 [status,result] = system( 'uuidgen' );
1 144 param.nucleus.id = result(1:end-1);
145 catch err
146 param.nucleus.id = num2str(now);
147 end
148
149 % cell shape model options
150 % ------------------------
151 % cell.type Holds the cell model type. Default is "ratio".
1 152 param.cell.type = 'ratio';
153
154 % cell.name (optional) Holds the name of the cell model. Default is empty.
1 155 param.cell.model = 'framework';
156
157 % cell.id (optional) Holds the id the cell model. Default is empty.
1 158 try
1 159 [status,result] = system( 'uuidgen' );
1 160 param.cell.id = result(1:end-1);
161 catch err
162 param.cell.id = num2str(now);
163 end
164
165 % other options
166 % -------------
167 % verbose (optional) Displays messages to screen. The default is true.
1 168 param.verbose = true;
169
170 % debug (optional) Reports errors and warnings. Default is false.
1 171 param.debug = true;
172
173 % train.flag (optional) Selects what model is going to be trained ('nuclear',
174 % 'framework', or 'all'). Default is 'all'
1 175 param.train.flag = 'framework';
176
177 %this is the resolution of the datasets
1 178 param.model.resolution = [0.049, 0.049, 0.2000];
179
180 %documentation
1 181 param.documentation.author = 'Murphy Lab';
1 182 param.documentation.email = 'murphy@cmu.edu';
1 183 param.documentation.description = 'This is the framework trained on all images from the HeLa dataset.';
184
57700.33 1 185 answer = img2slml( dimensionality, dna, cell, protein, param );