Code covered by the BSD License  

Highlights from
Process Cell Images

Process Cell Images

by

 

Optimized for minicell image analysis

caliMat=ProcessNewImages(cellArray)
function caliMat=ProcessNewImages(cellArray)
caliMat=[]; 

for i=1:numel(cellArray) 
%remove the glare 
rollingObject=strel('disk',10); 
background = imopen(cellArray{i},rollingObject);
I2=cellArray{i}-background; 

%convert to black and white ;
level = graythresh(I2);
I2 = im2bw(I2,level);

%improve the contrast
I2=double(I2); 
I3=imadjust(I2); 

%remove insignificant images--> current threshold is for 10 pixels
I3 = bwareaopen(I3, 10); 
 

%label each cell and count 
I4=bwlabel(I3);
count=bwconncomp(I4); 


%get a size distribution of the cells, so you can set a 
%threshold for minicell max size 

cc = bwconncomp(I3, 4);
total=cc.NumObjects; 
cellData = regionprops(cc, 'basic');
cell_areas1 = [cellData.Area]; 
SortedAreas=transpose(sort(cell_areas1)); 


% add the new vector to a return matrix part 1 
caliMat=[caliMat;SortedAreas]; 



% optional: plot the cell arrays in a histogram 

figure, hist(SortedAreas, total);
title('Histogram of Cell Area'); 
x=1:1:total; 
y=SortedAreas(1):1:SortedAreas(end); 
bar(x,SortedAreas);  

end 
end 

Contact us