%% Cell count addition to intensity quantification script % Author: Jordan Rolsma - University of California, Riverside %Features: %Counts cell nuclei within phalloidin borders (debris and artifacts are %filtered out in the main script). %Outputs individual tilescan figures with traced nuclei and cell count %printed on each one. %Note: To use, call this script or paste it directly into the intensity %quantification script below the 'plot trace of nuclei' for loop. %If you wish to save the cell count data, include 'nuccount' as an %input in the line below: %save(sprintf('%s\\%s\\%s_data.mat',outdir1,outdir2,IM_FILE(1:end-4)),'Sname','intDataNuc','intDataCyt','intDataRat','nuccount') %% Code %Plot trace of nuclei for f = 1:length(B) boundary = B{f}; plot(boundary(:,2), boundary(:,1), 'm', 'LineWidth', 1) nuccount = size(centroid(:,1)); if nuccount > 0 nuccount{g} = nuccount; text(700,-50,['Nuclei count:' num2str(nuccount{g})],'color','r','FontSize',14,'FontWeight','bold'); else continue end