Home > cellorganizer > utilities > model2report_percell.m

model2report_percell

PURPOSE ^

Function that creates useful reports on percell statistics

SYNOPSIS ^

function model2report_percell(param)

DESCRIPTION ^

Function that creates useful reports on percell statistics 
Sometimes we may wish to use percell for comparision as in a movie 

Inputs: 
param = structure of params including temporary folder where the various
        models are saved.

Outputs: 

A set of graphs and pvalues

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function model2report_percell(param)
0002 %Function that creates useful reports on percell statistics
0003 %Sometimes we may wish to use percell for comparision as in a movie
0004 %
0005 %Inputs:
0006 %param = structure of params including temporary folder where the various
0007 %        models are saved.
0008 %
0009 %Outputs:
0010 %
0011 %A set of graphs and pvalues
0012 
0013 %Author: Devin Sullivan 6/17/13
0014 %
0015 % Copyright (C) 2007-2013  Murphy Lab
0016 % Carnegie Mellon University
0017 %
0018 % This program is free software; you can redistribute it and/or modify
0019 % it under the terms of the GNU General Public License as published
0020 % by the Free Software Foundation; either version 2 of the License,
0021 % or (at your option) any later version.
0022 %
0023 % This program is distributed in the hope that it will be useful, but
0024 % WITHOUT ANY WARRANTY; without even the implied warranty of
0025 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0026 % General Public License for more details.
0027 %
0028 % You should have received a copy of the GNU General Public License
0029 % along with this program; if not, write to the Free Software
0030 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0031 % 02110-1301, USA.
0032 %
0033 % For additional information visit http://murphylab.web.cmu.edu or
0034 % send email to murphy@cmu.edu
0035 
0036 %%
0037 %Objects
0038 %Figure out how many cell images there are
0039 files = ml_dir([param.objstatsdir filesep '*.mat']);
0040 
0041 
0042 %initialize stats
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     %volume
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 %adjust volume if you know the resolution to have a measurment in um
0066 %instead of pixels
0067 if isfield(param.model,'resolution');
0068     %convert the pixel volumes to micrometers
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 %volume plot
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 %number plot
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 % figure,plot(1:length(files),totnum,'.','MarkerSize',20);
0099 % title('Number of objects','FontSize',20)
0100 % xlabel('Cell num','FontSize',20);
0101 % ylabel('number of objects/cell','FontSize',20);
0102 %%
0103 
0104 %%
0105 %Compartments
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 %proportional fluorescence plot
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

Generated on Sun 29-Sep-2013 18:44:06 by m2html © 2005