0001 function model2report_percell(param)
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 
0018 
0019 
0020 
0021 
0022 
0023 
0024 
0025 
0026 
0027 
0028 
0029 
0030 
0031 
0032 
0033 
0034 
0035 
0036 
0037 
0038 
0039 files = ml_dir([param.objstatsdir filesep '*.mat']);
0040 
0041 
0042 
0043 meanint = zeros(1,length(files));
0044 stdint = zeros(1,length(files));
0045 totnum = zeros(1,length(files));
0046 meansize = zeros(length(files),3);
0047 stdsize = zeros(length(files),3);
0048 meanvolume = zeros(1,length(files));
0049 stdvolume = zeros(1,length(files));
0050 
0051 for i = 1:length(meanint)
0052     load([param.objstatsdir filesep files{i}]);
0053     meanint(i) = mean(intensities);
0054     stdint(i) = std(intensities);
0055     meansize(i,:) = mean(objsize);
0056     stdsize(i,:) = std(objsize);
0057     totnum(i) = objnum;
0058     
0059     vol = (4/3*pi).*(objsize(:,1)/.2.*objsize(:,2)./2.*objsize(:,3)./2);
0060     meanvolume(i) = mean(vol);
0061     stdvolume(i) = std(vol);
0062     
0063 end
0064 
0065 
0066 
0067 if isfield(param.model,'resolution');
0068     
0069     if size(param.model.resolution,2)==2 || size(param.model.resolution,2)==3
0070         meanvolume = meanvolume.*prod(param.model.resolution);
0071         ylabelstr = 'mean volume (um)';
0072     else
0073         disp(['Resolution specified but not recognized. Please input a '...
0074              '1x2 or 1x3 vector']);
0075     end
0076 else
0077     ylabelstr = 'mean volume (pixels^3) - careful of non-cubic pixels';
0078 end
0079 
0080 
0081 try
0082     titlestr = 'Object volume';
0083     xlabelstr = 'Cell num';
0084     niceplot([1:length(files)],meanvolume,xlabelstr,ylabelstr,titlestr,'plot','.')
0085 catch
0086     warning('Unable to open display' );
0087 end
0088 
0089 
0090 try
0091     xlabelstr = 'Cell num';
0092     ylabelstr = 'number of objects/cell';
0093     titlestr = 'Number of objects';
0094     niceplot([1:length(files)],totnum,xlabelstr,ylabelstr,titlestr,'plot','.')
0095 catch
0096     warning('Unable to open display' );
0097 end
0098 
0099 
0100 
0101 
0102 
0103 
0104 
0105 
0106 files = ml_dir([param.compartmentdir filesep '*.mat']);
0107 
0108 for i = 1:length(files)
0109     load([param.compartmentdir filesep files{i}]);
0110     propfluortot(i,:) = propfluor;
0111     
0112 end
0113 
0114 
0115 xlabelstr = 'Cell num';
0116 ylabelstr = 'Proportion of fluorescence';
0117 titlstr = 'Compartmental fluorescent proportions';
0118 
0119 try
0120     niceplot([1:length(files)],propfluortot,xlabelstr,ylabelstr,titlestr,'semilogy','.')
0121     legend(compartmentlist,'FontSize',20,'Fontname','Ariel')
0122 catch
0123     warning('Unable to open display' );
0124 end