Abstract1. The use of image data to quantify, study and compare variation in the colours and patterns of organisms requires the alignment of images to establish homology, followed by colour-based segmentation of images. Here, we describe an R package for image alignment and segmentation that has applications to quantify colour patterns in a wide range of organisms.2. patternize is an R package that quantifies variation in colour patterns obtained from image data. patternize first defines homology between pattern positions across specimens either through manually placed homologous landmarks or automated image registration. Pattern identification is performed by categorizing the distribution of colours using an RGB threshold, k-means clustering or watershed transformation.3. We demonstrate that patternize can be used for quantification of the colour patterns in a variety of organisms by analysing image data for butterflies, guppies, spiders and salamanders. Image data can be compared between sets of specimens, visualized as heatmaps and analysed using principal component analysis.4. patternize has potential applications for fine scale quantification of colour pattern phenotypes in population comparisons, genetic association studies and investigating the basis of colour pattern variation across a wide range of organisms.
K E Y W O R D Scolour patterns, heatmap, image registration, image segmentation, landmarks
| INTRODUCTIONNatural populations often harbour great phenotypic diversity. Variation in colour and pattern are of the more vivid examples of morphological variability in nature. Taxa as diverse as spiders (Cotoras et al., 2016;De Busschere, Baert, Van Belleghem, Dekoninck, & Hendrickx, 2012), insects (Katakura, Saitoh, Nakamura, & Abbas, 1994;Williams, 2007), fish (Endler, 1983;Houde, 1987), amphibians and reptiles (Allen, Baddeley, Scott-samuel, & Cuthill, 2013;Balogová & Uhrin, 2015;Calsbeek, Bonneaud, & Smith, 2008;Rabbani, Zacharczenko, Green, Abbani, & Acharczenko, 2015), mammals (Hoekstra, Hirschmann, Bundey, Insel, & Crossland, 2006;Nekaris & Jaffe, 2007) and plants (Clegg & Durbin, 2000;Mascó, Noy-Meir, & Sérsic, 2004)
| ALIGNMENTSuperimposing colour patterns to quantify variation in their expression requires the homologous alignment of the anatomical structures they occur in. Image transformations for this alignment can be obtained from landmark based transformations or image registration techniques.
| Landmark based transformationsLandmark based transformations use discrete anatomical points that are homologous among individuals in the analysis. Non-rigid, but uniform transformations from one set of "source" landmarks to a set of "target" landmarks such as affine transformations include translation, rotation, scaling and skewing (Hazewinkel, 2001). Additionally, nonuniform changes in shape between the source and target landmarks can be accounted for by storing the transformation as if it were "the bending of a thin sheet of metal," the so-called thin plate spline (TPS) transformation (Duchon, 1...