# Large-Scale Permanent Slide Imaging and Image Analysis for Diatom Morphometrics
## 2 Materials and Methods
Usually we employ a 20\(\times\) magnification objective, with a lamp intensity of 150, in combination with a maximal integration time of 0.011 s. Individual fields-of-view overlap by 64 \(\upmu\)m in both \(X\) and \(Y\) directions. Finding the focus for each image position is performed in two steps: First, at the start of each run, a focus map of the slide is prepared. For this, the optimal focus position is located over a 2 mm grid spanned over the target area by determining the value of a focus function at 25 positions in 5 \(\upmu\)m steps and finding the \(Z\) position giving the maximum absolute local contrast (focusing mode 0: absolute local contrast, contrast mode 0). Subsequently, the focus map is created by linear interpolation of determined optimal focus \(Z\) values over (\(X\), \(Y\)), covering the target area. After the focus map is created, the area scan itself is performed by fine focusing at each position, followed by final image capture. For fine focusing, the value of the focus function is determined (focusing mode 2: horizontal quadratic normalized gray level distances, pixel distance 2, contrast mode 0), this time in 40 planes in \(Z\)-steps of 2 \(\upmu\)m. This second, fine focusing step can sometimes be omitted, but it often leads to substantial improvement in the sharpness of resulting images (depending on density and contrast of diatom valves). Finally, images at 10 focus positions in \(Z\)-distances of 2 \(\upmu\)m are captured and stacked together to extended focus depth images which are saved for further processing. These stacked images represent the input to SHERPA for locating diatom valves, as well as to the stitching procedure to create a virtual slide. Step (3): Stitching of virtual slides  
The overlapping low-resolution images are stitched together to a virtual slide using the VSlide software (Metasystems, Althusheim, Germany). These virtual slides enable for visualizing the valves of interest as identified and selected via SHERPA in the context of the whole slide (see steps 4 & 5 below) and also for manually adding further positions for the later high-resolution scan (see step 6 below). Although in principle, it is not strictly required to stitch images to a virtual slide at this stage, this is necessary with the imaging system we are using for two practical reasons: First, the object coordinates relative to individual field-of-view images (as recorded by SHERPA) are transformed to coordinates relative to the whole slide scanned at this step. Second, import of positions into a virtual slide is necessary for feeding a list of positions back into the imaging software in the specific Metafer imaging system we are using. Figure 2: Overview of the low-resolution slide area scan procedure (step 2 of the workflow). Left: manual selection of rectangular target area. Centre: focus map creation over a 2 mm \(\times\) 2 mm grid. Right: focus stack capture in overlapping fields-of-view over target area. Step (4): Selecting objects of interest for high-resolution scan via SHERPA  
For locating and selecting valves of interest, the low-resolution images (step 2) are processed by SHERPA. Object outlines are compared to a user defined set of shape templates, in case of the example analysis explicated below to the _F. kerguelensis_ templates provided with SHERPA. The template set selected defines the taxonomic scope (more precisely, the scope in terms of outline shapes) of an analysis. Hereby analyses focusing on a narrow range of outline shapes are possible, like in our example application, as are analyses targeting a broad diversity of diatom shapes. For the latter purpose, SHERPA provides a set of ca. 500 outline templates covering a broad range of diatom shapes, which can be further extended by the user to match the specific set of taxa of interest from a particular habitat. Shape optimization and manual corrections are usually not applied since this analysis step is used only for localizing valves, not for measuring them.