Here the pineapple's spirals (which botanists call "parastichies") appear as rows. To count them, first choose a recognizable individual scale in the photo on the left. Then trace the leftward-leaning row that passes through it (the blue line). Continue to draw all the additional left-leaning rows (the dashed blue lines) all the way to the edge.
Next find the same scale as where you started in the righthand photo. Draw its rightward-leaning row (the green line). Then trace all the other rightward-leaning rows as far as you can (the dashed green lines). We marked black dots at the top as reference points, indicating where a full rotation of the pineapple starts and ends. All told, we count 8 "down" parastichies (in blue) and 13 "up" parastichies (in green).
This counting method cannot, however, be implemented using a computer program. So in the Plant Math lab, we use what we call "zigzag fronts" instead. To see the fronts, first choose a point on the left and find where it re-appears on the right (where the scales join on the rotated pineapple). Then trace a zigzagging line following the parastichies, in a way that is the highest possible without crossing the horizontal line marked in white dashes.
Next count the segments in the front. Segments passing through 2 scales count double. Here, there are 13 blue segments, and 8 green. The blue segments count the number of green parastichies that they cross at their endpoint. Likewise the green segments count the number of blue parastichies.