Modern positron emission tomography (PET) detectors are typically made from 2D modular arrays of scintillation crystals. Their characteristic flood field response (or flood histogram) must be segmented in order to correctly determine the crystal of annihilation photon interaction in the system. Crystal identification information thus generated is also needed for accurate system modeling as well as for detailed detector characterization and performance studies. In this paper, we present a semi-automatic general purpose template-guided scheme for the segmentation of flood histograms. We first generate a template image that exploits the spatial frequency information in the given flood histogram using Fourier-space analysis. This template image is a lower order approximation of the flood histogram, and can be segmented with horizontal and vertical lines drawn midway between adjacent peaks in the histogram. The template is then registered to the given flood histogram by a diffeomorphic polynomial-based warping scheme that is capable of iteratively minimizing intensity differences. The displacement field thus calculated is applied to the segmentation of the template resulting in a segmentation of the given flood histogram. We evaluate our segmentation scheme for a photomultiplier tube based PET detector, a detector with readout by a position-sensitive avalanche photodiode (PSAPD) and a detector consisting of a stack of photomultiplier tubes and scintillator arrays. Further, we quantitatively compare the performance of the proposed method to that of a manual segmentation scheme using reconstructed images of a line-source phantom. We also present an adaptive method for distortion reduction in flood histograms obtained for PET detectors that use PSAPDs.