Grass Pollen Classification Software This package contains all Matlab functions needed to calculate the image features used in the analysis of grass pollen described in: L. Mander, M. Li, W. Mio, C. Fowlkes, S. Punyasena, Identification of Grass Pollen Through the Quantitative Analysis of Surface Ornamentation and Texture, Proc Royal Soc B: Biological Sciences, 280(1770):20131905. DOI: 10.1098/rspb.2013.1905 A few remarks: (a) The study was based on grayscale scanning electron microscopy (SEM) images of the surface of pollen grains, but the software can be used for analyses of images exhibiting similar patterns. (b) To simplify use, place all contents of this package and all images to be analyzed in a single folder, say, Pollen. (c) Images can be in any standard format such as .png, .tiff, etc. (d) The package contains three functions that perform the following operations: (i) calculate the size and density features described in the paper; (ii) pre-process the images for computing a topological feature derived from subgraph centrality; (iii) calculate the topological feature. These are referred to as features tau1 and tau2 in the paper. ****************************************************************************************** Step 1. Computation of size and density features The output of these calculations will be a file named SD.MAT containing an Nx2 matrix, where N is the number of images. The first column gives the size features of the input images and the second column gives the density features. Note: the default file type is set to ’png’, but it can be changed to any standard image format. The window size (see paper) is set to 100, but can be changed as well. Within Matlab, set the working directory to the folder Pollen, and execute the following Matlab command: file=dir('*.png'); windowsize=100; for k=1:length(file) [SD(k,1) SD(k,2)]=csd(file(k).name,windowsize); end save SD ****************************************************************************** Step 2. Image Pre-processing Before running this pre-processing algorithm, the user should use the output of Step 1 to classify each image as one of the following two types: small granules (SG) or large granules (LG)(see paper). Once this is done, create two vectors named SG and LG containing the indexes of the small granule samples and large granule samples, respectively. For example, SG=[1 2 4] means that images 1, 2, and 4 have been labeled as having small granules and LG=[3 5] means that images 3 and 5 have been labeled as having large granules. The output H is a cell containing the resulting binary images. Within Matlab, set the working directory to Pollen and execute the following Matlab commands: windowsize=50; for s=1:length(SG) k=SG(s); H{k}=process(file(k).name,windowsize,2); end for s=1:length(LG) k=LG(s); H{k}=process(file(k).name,windowsize,3); end save H ********************************************************************************** Step 3. Computation of the topological feature based on subgraph centrality This calculation will use the information contained in the output H of the previous step. The algorithm offers three different options: topological features of the entire image (1), image foreground only (2), and image background only (3). Within Matlab, set the working directory to Pollen, and execute the following Matlab commands: Note: set flag to 1, 2, or 3 according to the three options above. The default setting is entire image (1). flag=1; for k=1:length(file) G(k,:)=pollen(H{k},flag); end save G The output will be a G.MAT file containing a Nx20 matrix. Each row represents the 20-dimensional topological feature vector of an image.