# Large-Scale Permanent Slide Imaging and Image Analysis for Diatom Morphometrics
## 2 Materials and Methods
Settings for finding the focus are, similarly to classifiers, recorded as named parameter combinations, and the classifier files only record this name. Metafer settings and configuration files, as used in this project, are provided as Supplementary Materials. **Image analysis** and object measurement is realized by our software SHERPA (version 1.1c) [5], which is a freely available Microsoft Windows software developed specifically for diatom morphometry. SHERPA can apply a set of different image processing methods for detecting objects in light microscopic images, and compares their contour outline to a set of shape templates to identify objects of interest. An internal rating and ranking system assesses the relevance and quality of results to reduce efforts for reviewing them manually, but nevertheless enables for manual review of objects found and for correction of faulty segmentations which lead to flawed object outlines. All parameter settings can be saved and restored to reproduce the settings. For the selected objects of interest, coordinates with respect to the images they were found in, as well as a wide variety of morphometric feature descriptors, can be exported. The coordinates (in our workflow originating from the low-resolution area scans) can be saved into an XML annotation file which can be read by the VSViewer software (version 2.1.103, Metasystems, Altlussheim, Germany) and subsequently converted into a position list for high-resolution imaging in the Metafer imaging software (version 3.10.4, Metasystems, Altlussheim, Germany). For morphometric analysis, measurements obtained by SHERPA can be exported as CSV files along with cut-outs of the original images and intermediate image processing results. We process this CSV output by R scripts that allow for a quick, easy and flexible analysis of various morphometric descriptors, but, being simple comma-delimited text tables, they can be viewed and analysed just as well with any other spreadsheet/data analysis software. The number of parameters influencing the results of an image analysis procedure with SHERPA is substantial. Settings regard the parametrization of pre-processing applied for each of one or more segmentation methods and the optional subsequent contour optimization, the identification of valves of interest, and the filtering, scoring and ranking of results. To ensure transparency and reproducibility, SHERPA supports saving a combination of settings and re-applying it to several image data sets. The according configuration files and templates are provided as Supplementary Materials. In the following, we describe the workflow illustrated in Figure 1 in detail (the numbering in that figure refers to the workflow steps as they are described below):  
Step (1): Preparation  
Throughout this contribution, microscopic imaging is performed from so-called permanent slides, prepared by embedding oxidized frustule samples into a mounting medium. Since strong object contrast is vital for successfully automating image processing, we recommend using a high refractive index mountant like Naphrax. Another critical issue is sample density. On the one hand, the density has to be sparse and uniform enough to preferably show objects clearly separated from each other, because overlapping impedes automatic valve detection by SHERPA and thus could increase manual efforts required for selecting and reworking valve shapes. On the other hand, the density has to be high enough for focus map creation to find objects at random positions on the slide. We qualitatively found that optimal sample density for the automated procedure is somewhat lower than that for manual counting. Step (2): Low-resolution area scan for locating valves of interest  
Our two-cycle microscopy and image analysis procedure starts with a low-resolution area scan (see Figure 2), creating a slide overview with a magnification appropriate to the investigated diatom.