Home > analysis > countCellPerFrame.m

countCellPerFrame

PURPOSE ^

SYNOPSIS ^

function countCellPerFrame(remote)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function countCellPerFrame(remote)
0002 
0003 if (remote==0)
0004     iPath = 'C:\Research\DataSets\LILLYwbcrollingapc\';
0005 else
0006     iPath = '/v1/rich/DataSets/LILLYwbcrollingapc/';
0007 end
0008 
0009 cd(iPath);
0010 dataFolders = dir(iPath);
0011 
0012 fid = fopen('AverageCellsperFrame.txt','w');
0013 
0014 for fo = 3: length(dataFolders)
0015     if (dataFolders(fo).isdir ==1)
0016         dataFolder = dataFolders(fo).name;
0017         
0018         try
0019             
0020             load(strcat(dataFolder,'/','_frames.mat'));
0021             load(strcat(dataFolder,'/','_tracks.mat'));
0022             
0023             noFrames = length(frames);
0024             nCells = [];
0025             for fr = 1: noFrames
0026                nCells = [nCells; frames(fr).nCells]; 
0027             end
0028             
0029             m_nCells = mean(nCells);
0030             
0031             cellCount = 0;
0032             for tr = 1:tracksR(end,1)
0033                track = tracksR((tracksR(:,1)==tr),:);
0034                 if size(track,1) > 3
0035                     cellCount = cellCount + 1;
0036                 end
0037             end
0038             
0039             fprintf(fid,'%s %4.0f %7.2f\n',dataFolder, cellCount,m_nCells);
0040             
0041         catch
0042            disp(['Data file in ', dataFolder ,' is not available']);  
0043         end 
0044     end 
0045 end
0046 
0047 fclose(fid);
0048 
0049 
0050 end

Generated on Thu 17-Mar-2011 14:45:51 by m2html © 2005