This is a static copy of a profile reportHome
train_cell_shape_model3 (1 call, 3.054 sec)
Generated 05-Nov-2014 07:52:32 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/3D/train_cell_shape_model3.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
img2model | function | 1 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
67 | [rad_ratio,cellnucratios,nucbo... | 1 | 2.513 s | 82.3% |  |
85 | save([savepath filesep 'pca_re... | 1 | 0.300 s | 9.8% |  |
84 | [mu,coeff,score,latent] = eff_... | 1 | 0.160 s | 5.2% |  |
109 | save([savepath filesep 'cell_s... | 1 | 0.070 s | 2.3% |  |
77 | rad_ratio( (rad_ratio>1) ) ... | 1 | 0.010 s | 0.3% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 3.054 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
extract_radius_ratio_old | function | 1 | 2.513 s | 82.3% |  |
eff_PCA | function | 1 | 0.160 s | 5.2% |  |
ml_estpdf | function | 2 | 0 s | 0% |  |
filesep | function | 3 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.381 s | 12.5% |  |
Totals | | | 3.054 s | 100% | |
Code Analyzer results
Line number | Message |
84 | The value assigned here to 'score' appears to be unused. Consider replacing it by ~. |
100 | The value assigned to variable 'err' might be unused. |
108 | The value assigned to variable 'cellShapeModel' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 109 |
Non-code lines (comments, blank lines) | 77 |
Code lines (lines that can run) | 32 |
Code lines that did run | 18 |
Code lines that did not run | 14 |
Coverage (did run/can run) | 56.25 % |
Function listing
time calls line
1 function model = train_cell_shape_model3( celltemppath,savepath )
2 % Train cell shape model using 3D Hela images
3
4 % Author: Devin Sullivan - adapted from Tao Peng's train_cell_shape_model2.m
5 %
6 % Copyright (C) 2011-2013 Murphy Lab
7 % Lane Center for Computational Biology
8 % School of Computer Science
9 % Carnegie Mellon University
10 %
11 %Changes prior to 6/13/13 refactoring:
12 % July 26, 2012 I. Cao-Berg Added a statement where it returns an empty model
13 % when the ratios of radii is empty
14 % May 15, 2013 I. Cao-Berg Updated method to support wildcards
15 %
16 %%
17 % June 13, 2013 D. Sullivan refactored to use the per-cell parameters
18 % precomputed using cellfit_percell.m
19 %%
20 %Changes post 6/13/13 refactoring:
21 %
22 %
23 %
24 % This program is free software; you can redistribute it and/or modify
25 % it under the terms of the GNU General Public License as published
26 % by the Free Software Foundation; either version 2 of the License,
27 % or (at your option) any later version.
28 %
29 % This program is distributed in the hope that it will be useful, but
30 % WITHOUT ANY WARRANTY; without even the implied warranty of
31 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32 % General Public License for more details.
33 %
34 % You should have received a copy of the GNU General Public License
35 % along with this program; if not, write to the Free Software
36 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
37 % 02110-1301, USA.
38 %
39 % For additional information visit http://murphylab.web.cmu.edu or
40 % send email to murphy@cmu.edu
41
42 %% Processing images and extract cell boundaries as cell codes
43 % Note this step can be parallelized
44 % savepath = [pwd filesep 'temp' filesep 'cell_shape_eigen'];
45
46 %if no temp path was specified, try default of pwd/temp/cell_shape_eigen
1 47 if isempty(celltemppath)
48 celltemppath = [pwd filesep 'temp' filesep 'cell_shape_eigen'];
49 end
50 %next check if the temp dir exists
1 51 if ~exist(celltemppath,'dir')
52 error('Unable to find per-cell models, please check celltempdir.');
53 end
54
55 % %icaoberg 5/15/2013
56 % try
57 % maskImagesDirectoryPath = param.masks;
58 % catch
59 % maskImagesDirectoryPath = '';
60 % end
61 % find_cell_codes( dnaImagesDirectoryPath, ...
62 % cellImagesDirectoryPath, ...
63 % proteinImagesDirectoryPath, ...
64 % maskImagesDirectoryPath, savepath, param );
65
66 %% Pack up results and run PCA analysis
2.51 1 67 [rad_ratio,cellnucratios,nucbottomslices] = extract_radius_ratio_old( celltemppath );
68
69 %icaoberg 26/7/2012
1 70 if isempty( rad_ratio )
71 model = [];
72 return
73 end
74
75 %rad_ratio(102,:) = [];
76 %icaoberg 26/11/2013
0.01 1 77 rad_ratio( (rad_ratio>1) ) = 1;
78
79 % rad_ratio(any(isinf(rad_ratio),2),:) = [];
80
81 % rad_ratio(isinf(rad_ratio)) = 1;
82 % tic
1 83 if ~exist([savepath filesep 'pca_result.mat'],'file')
0.16 1 84 [mu,coeff,score,latent] = eff_PCA(rad_ratio);
0.30 1 85 save([savepath filesep 'pca_result.mat'],'mu','coeff','score','latent')
86 else
87 load([savepath filesep 'pca_result.mat']);
88 end
89 % toc
90
91
92 %% Cell shape model
1 93 model = struct('name',[],'meanShape',[],'modeShape',[],'eigens',[]);
1 94 model.name = 'RREigen';
1 95 model.meanShape = struct('const',mu);
96
1 97 try
1 98 model.modeShape = struct('const',coeff(:,1:50));
1 99 model.eigens = struct('stat',latent(1:50));
100 catch err
101 model.modeShape = struct('const',coeff(:,1:end));
102 model.eigens = struct('stat',latent(1:end));
103 end
104
1 105 model.cellnucratio.stat = ml_estpdf(cellnucratios,struct('name','norm'));
1 106 model.nucbottom.stat = ml_estpdf(nucbottomslices,struct('name','norm'));
107
1 108 cellShapeModel = model;
0.07 1 109 save([savepath filesep 'cell_shape_model.mat'],'cellShapeModel')