To analyze the radii and density of nanowires per square micrometer of substrate, an algorithm determines which patch of pixels belongs to a particular nanowire. The algorithm first detects edges (the black lines in the second image) and removes the background (the sky blue color). Then it determines, by flood filling, contiguous patches that are bounded by the background or an edge; each contiguous patch is a potential nanowire. The number of patches in a given area is counted and the radius of each patch is determined. To visualize how well the algorithm identifies nanowires, each patch of pixels that was determined to be a nanowire is assigned a color, generating the image.