# Large-Scale Permanent Slide Imaging and Image Analysis for Diatom Morphometrics
## 2 Materials and Methods
Convexity analysis often fails on low-resolution images, even for species with strictly convex outlines, especially if the image contrast or sharpness is not optimal. Even though we applied it in our example investigation (see below), we recommend not to do so at this workflow step, at the optional expense of increased efforts for sorting out potential false positives manually. To ensure that settings for validation and ranking are comparable to those of the high-resolution scan (like minimum required object area/perimeter), it is important to set the correct magnification ratio (parameter \"Micrometer Factor\"; also saved in the settings file). Valves of interest are either picked automatically by selecting all results up to (including) ranking index 2, or by manually reviewing and selecting results. Manual selection is generally conducted at least up to ranking index (including) 2, and can be extended up to higher indices if the amount of highest quality results is not sufficient. The position list for the subsequent high-resolution scan (step 6) is exported as a Metafer VSAI file and saved into the same directory and with the same name as the according virtual slide files. Step (5): Setting up the position list for high-resolution scan  
We use the VSViewer software (Metasystems, Altlussheim, Germany) to import the position list provided by SHERPA (step 4) into the virtual slide (step 3), using the \"import annotations\" function; valve positions are displayed by their annotated outline (see blue markings in Figure 3). The annotation function of the viewer enables to manually add positions of interest if some objects deemed relevant were missed by SHERPA (see red box in Figure 3). This allows for combining (semi-)automated and manual selection of valves of interest. Step (6): High-resolution position scan of selected objects of interest for precise morphometric measurements  
The annotated virtual slide from step 5 contains the (\(X\), \(Y\)) position data required for selectively imaging the valves of interest. This high-resolution scan uses the 63\(\times\) objective with oil-immersion and captures 20 focus levels in 0.2 \(\upmu\)m \(Z\)-distances after two focusing steps, a first, coarse autofocusing followed by a fine focusing. This is necessary because object positions imported from a virtual slide do not preserve information on the vertical (\(Z\)) location of individual objects, so these have to be determined from scratch again. In the first autofocus run, the value of the focus function is determined at 40 \(Z\)-positions in 2 \(\upmu\)m distances for a coarse determination of the optimal focal plane (focusing mode 2: horizontal quadratic normalized grey level distances, pixel distance 2, contrast mode 0). The focus is narrowed down by a second scan measuring at 60 focus levels in 0.5 \(\upmu\)m distances (focusing mode 0: absolute local contrast, contrast mode 0). Subsequently, 20 focal planes around the optimal one are captured in 0.2 \(\upmu\)m distances. An extended focus image is produced by stacking the individual focal planes, using the method \"CombPlanesFF\" with focusing mode 0 and a submatrix size of 128. The individual focal plane images, as well as the extended focus image, can be saved for further processing. In general, for analysis with SHERPA, we only use the extended focus image, since this clearly depicts the valve's outline as well as its interior ornamentation, even if not all structures can be visualized completely within a single focal plane because of their three-dimensional extent, or because the valve surface is slightly tilted with respect to the focal plane (see Figure 4). Keeping the individual focal plane images leads to a significantly increased demand for storage space, but allows for better manual evaluation of ambiguous species classifications, since in uncertain cases the three-dimensional structure of features, as well as the influence of stacking artefacts, can be judged.