{'fraction_non_alphanumeric': 0.02822338079005414, 'fraction_numerical': 0.008070984559855625, 'mean_word_length': 5.023248792270532, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A geometric method for spatiotemporal coherent structure analysis

We describe a geometric method to quantify wave patterns observed in the nervous system, which are non-stationary and with a mixture of spiral, target, plane and irregular waves. The method analyzes fluctuations of the energy angular distribution in two-dimensional Fourier spectrum of wave patterns, which reflects changes of the orientation distribution of wavefronts. We show that the number of the genuine peaks in generalized phase spectrum is close to the number of the coherent space-time clusters arising in wave patterns, and propose to use the number as a complexity measure.


I. Introduction
Wave patterns with a mixture of spirals, plane, target and irregular patterns have been observed in both the brain and heart [1][2][3][4]. Quantifying these patterns is important and remains challenging. In the past few decades, several methods or measures, such as two-point correlation functions, extensive scaling of Lyapunov exponents and fractal dimensions etc., have been used to characterize spatiotemporal patterns [5]. Recently, the empirical orthogonal function (EOF) was used to characterize spatiotemporal patterns in neural tissue [6,7]. The minimal number of eigenmodes required to account for the essential dynamical features of a spatiotemporal pattern was suggested to be used as a dimension measure [8]. While the EOF method is powerful in extracting coherent structures [6][7][8][9][10], it requires the extracted eigenmodes to be orthogonal to each other. This constraint is rarely reflected in the physical or biological patterns being analyzed, hence imposes a limit on the physical interpretability of each extracted eigenmode [11]. By using a binary reduction technique, P. Jung et. al. [14] decomposed spatiotemporal patterns into contiguous space-time regions, which were defined as coherent clusters, and showed the powerlaw cluster-size distribution for spiral turbulence.
In this paper, we investigate wave patterns recorded from neural tissues with the voltage-sensitive dye imaging (VSDI) technique [4], and extend the definition of the coherent space-time cluster to the space-time region(s) within which wave patterns have identical spatiotemporal symmetry (see Appendix A). Thus, one cluster may contain multiple spatially isolated regions. But due to the existence of non-local connectivity in neural tissues, the spatially isolated regions with identical spatiotemporal symmetry in the 2D plane may be just different "cross sections" of the same coherent cluster. Therefore, in this paper, we assume that two spatially isolated regions in the 2D plane are in the same coherent cluster, if wave patterns in the two regions have exactly the same spatiotemporal symmetry.
In actual data sets, boundaries of the clusters are highly dynamic and unclear, which causes technical difficulty in accurately identifying these cluster boundaries. To circumvent this difficulty, we inspect the characteristics of spatiotemporal symmetry of wave patterns, instead of identifying the clusters directly. Inspired by the spectral energy distribution properties of clusters with different spatiotemporal symmetries, we develop a geometric method to characterize the dynamics of wave patterns. We show that the number of genuine peaks (NGPs) provides an estimate of the number of clusters. By applying the method to both artificially generated and experimentally recorded wave patterns, we show that the method provides a more physically relevant measure for patterns typical of active neuronal systems.

II. GP Spectrum Analysis
We investigate the spatiotemporal evolution of wave mixtures with rotational and non-rotational patterns. A coherent space-time cluster (for short, coherent cluster) is defined as space-time regions within which wave patterns have identical spatiotemporal symmetry (see Appendix A). In terms of the spatiotemporal symmetry of the wave patterns, coherent clusters can be categorized into two categories: translation invariant clusters and rotation invariant clusters. Wave patterns in the translation invariant clusters consist of traveling plane waves and emitting (absorbing) target waves, whereas wave patterns in the rotation invariant clusters comprise rotating spiral waves. A prominent characteristic that distinguishes these two categories is whether wave fronts change orientation. In a translation invariant cluster, the orientations of wave fronts do not change, whereas in a rotation invariant cluster the orientations of wave fronts change continuously.
Theoretically, any two-dimensional (2D) image can be decomposed into sinusoidal components in 2D space. Each sinusoidal component in physical space corresponds to a 2D Dirac delta function in wave number space, which lies in the wave vector direction of the sinusoidal component. Thus, the total integrated differential energy distributed in the same direction in wave number space corresponds to those of the sinusoidal components with the same corresponding orientation in physical space.
According to Parseval's theorem, as long as the energy of the image components does not change, the corresponding spectral energy is also invariant. Therefore, the spectral energy of a translation invariant cluster keeps constant in all directions in wave number space due to the fixed orientations of its wave fronts. For a rotation invariant cluster, however, the spectral energy oscillates with identical frequency in all directions. If multiple clusters with different spatiotemporal symmetries coexist within the area being observed, due to the highly nonlinear nature of wave patterns observed in neuronal systems, origination, collision, and merging of wave fronts will occur frequently. These events cause changes in the spectral energy and its oscillation patterns. So intuitively, the fluctuation characteristics of the spectral energy of wave patterns shed light on its spatiotemporal complexity. The more organized the wave patterns are, the simpler the fluctuation of spectral energy will be. Conversely, the more disordered the wave patterns are, the more complex the fluctuation of spectral energy will be. Based on this intuition, we develop the following geometric method to quantify the complexity of wave patterns.
The amplitude of wave patterns is denoted by a scalar field ) , , ( t y x f , and its wave number spectrum is given by: where x k and y k are wave numbers in x and y directions, respectively. Accordingly, the differential energy dE is given by: . By integrating differential spectral energies distributed in same direction, the energy angular distribution (EAD) is obtained as: is the maximal radial coordinate of the wave number space in the θ direction.
In order to capture the most prominent relative fluctuations in the EAD, we choose the direction with the largest variation and its perpendicular direction for comparison.
These two directions are referred to as the principal direction-pair, and denoted by a In actual data, there may be more than one principal direction-pair.
In this case, only one is selected without any preference. We compare the EAD values by: The dimensionless quantity ) (t ψ is termed as generalized phase (GP).
In However, it is important to notice that, in general, not every peak in GP spectrum corresponds to a coherent cluster. In neural tissues, origination, extinction, collision and merging of wave fronts are common, and these events frequently change the orientation distribution of wave patterns. Accordingly the number of peaks in the GP spectrum calculated from an actual data set may be more than the number of the coherent clusters arising in wave patterns. To clarify the effects of these dynamicsrelated events on the estimation of coherent cluster number, we apply the GP amplitude spectrum analysis to different wave patterns with mixture of multiple rotational and translational coherent clusters. By using a model network of spiking neurons arranged in a 51 51× two-dimensional lattice (see Appendix B for model details), wave patterns simulated at different excitation levels are produced for GP spectrum analysis. For the wave patterns simulated at a lower excitation level, two spirals both rotating at around 8Hz stably coexist throughout the whole simulation, during which one or two short-lived spirals or ring waves occasionally arise. Figure 1 Ac illustrates one representative snapshot extracted from the middle of the simulation. 500 consecutive snapshots are extracted for the GP and GP spectrum calculation. The results (see figure 1Bc for GP and figure   1Cc for GP amplitude spectrum) show that the GP spectrum contains three predominant frequency components (the peaks marked with black and gray arrows).
Since the orientation of a plane wave before and after rotating o 180 is same, the GP oscillation frequency is twice the frequency of the orientation changes in wave patterns. Accordingly, the peak at 17Hz (black arrow) corresponds to the two spirals rotating at around 8Hz, and the other two peaks respectively at around 2Hz and 6Hz (gray arrows) correspond to the changes in orientation distributions caused by events such as collisions, originations and/or extinctions of transient clusters. We tried the GP spectrum analysis on simulated patterns at a variety of different excitation levels, and all results showed similar qualitative accuracy in estimating the number of the coherent clusters by that of the predominant frequency components in GP amplitude spectrum.
Although the aforementioned dynamics-related events seem create more peaks in GP spectrum than corresponding coherent clusters, the number of predominant frequency components is close to the number of coherent clusters. Simulations show that new coherent clusters may be created by collisions of wave fronts, and some of them even become persistent. Moreover, the higher the excitation level the network is, the more wave front collisions create new clusters. Thus, the actual creation of new clusters (short-lived or persistent) partially compensate the overcount caused by these dynamics-related events.
Based on the above observations, it is natural to ask if we can directly use the number of peaks in GP spectrum to approximate the number of the coherent clusters arising in wave patterns. Unfortunately, the answer is still negative, because in addition to the dynamics-related events, in practice, the unavoidable limitations of spatial sampling also cause fluctuations in the EAD, and accordingly lead to extra peaks in GP spectrum. Due to the limited spatial sampling, wave fronts entering and/or leaving the bounded spatial sampling region result in changes in spectral energy of wave patterns.
By carefully setting the spatial sampling window, for example, we can make the window sufficiently large relative to the size of single coherent clusters, the effect of limited spatial sampling can be optimally suppressed, and accordingly the amplitude of the extra peaks may be significantly decreased.

Figure 2 should be inserted around here
In summary, GP spectrum typically has 4 types of peaks: type-1: peaks corresponding to predominant coherent clusters; type-2: peaks corresponding to dynamics-related events including those corresponding to short-lived coherent clusters; type-3: peaks irrelevant to wave pattern dynamics; type-4: random noise. Numerical calculations on simulative wave patterns with different excitation levels show that the GP spectrum of wave patterns usually contains three different modes: low-frequency mode (Mode I), medium-frequency mode (Mode II), and high-frequency mode (Mode III). Most prominent peaks locate in mode I. In mode II, the GP spectrum shows an exponential decay, which corresponds to the sharp decrease in the occurrence of dynamics relevant events with increasing frequency. In mode III, the GP spectrum is flat, which indicates that only random noises remain in this frequency range. In figure 2A and B, three different modes (separated by two dash-dotted lines) of the GP spectrum of a typical wave pattern (same wave pattern as the one shown in the d column of figure 1) are illustrated. In figure 2B, the GP spectra in mode II and mode III are linearly fitted and shown in solid line and dashed line respectively. The slopes of the two lines are 4.5412 -and 0.0908 respectively. In figure 2C and D, the GP spectrum of the spatiotemporal pattern of random noise is linearly fitted, and the slope is -6 10 1.5163× .
From the above discussion, we have seen that type-1 and type-2 peaks are relevant to the dynamics of the system and may correspond to the actual coherent clusters. In order to emphasize their relevance to wave pattern dynamics, we call these types of peaks genuine peaks, and call the other two types of peaks false peaks. Intuitively, short-lived coherent clusters tend to last longer than changes caused by collisions of wave fronts or wave fronts entering or leaving the spatial sampling region, and therefore have more significant effects on changes of spectral energy. Accordingly, dynamics-irrelevant events may be more transient than dynamics relevant events, and have smaller amplitude. Due to the fact that most peaks in mode II are type-2 peaks, by taking half of the maximum amplitude of the peaks in mode II as a threshold, the effects of false peaks may be optimally removed.
The threshold for counting the number of the genuine peaks (NGP) can be defined as: where j ∆ is the amplitude of the peaks in mode II of the GP spectrum, and M denotes the total number of peaks in mode II. When counting the number of the genuine peaks (NGPs), if ζ ≥ ∆ i , NGPs is increased by one at the i -th peak, where i ∆ is the amplitude of the i -th peak in GP spectrum, N i , , 2 , 1 L = , and N designates the total number of peaks in the spectrum.

III. Quantifying Actual Wave Patterns
By using an EOF based method, we can show that the dimensionality of the neuronal wave patterns consistently decreases during the middle of the episodes of oscillations recorded from the middle layers of a mammalian cortex [7]. Here, we apply the GP spectrum analysis on the neuronal wave patterns recorded from rat cortical slices by voltage-sensitive dye imaging (see [4] and [15] for details of the experimental preparations), and show that the results confirm this observation.

Figure 3 should be inserted around here
In figure 3, we calculate the GP (fig 3 first panel) and its power spectrum from a typical imaging trial, and compare the spatiotemporal complexity estimated by different indicators. The wave pattern in this trial can be visualized in a previously published data movie [16]. The initial section of the trial contains less organized irregular waves, with mixed emitting target and spiral waves (0-2500 frames collected at 1629 frames per second). Subsequently, the system becomes less complex with the development of a brief period emitting target waves followed by a period with a wellorganized spiral (frames 3800-5200) and a period of plane waves (frames 6200-7000).
By the end of the recorded trial, the system becomes complex again with less organized irregular patterns (frames 7500-10000).
The GP power spectrum is calculated by a short-time Fourier transform with a 500frame sliding window, and plotted in the second panel in time-frequency representation (TFR). The TFR indicates that multiple coherent clusters, including the coexistence of spiral and target waves, occurred in the initial section with irregular activity. In the middle section, target, spiral and plane waves alternatively dominate.
The NGP (fig 3, third panel) is close to 1 when the system is dominated by a single wave pattern, whether target, spiral, or plane. The NGP is higher at the beginning and ending sections when multiple coherent clusters originate and die out transiently, and also increases during the reorganizing transition between pattern types (marked with asterisks *).
Visual inspection of the data movie confirms that the NGP and the actual number of coherent clusters agree well with the dynamics of the wave patterns, even when there are only short transitions between the patterns. Compared to KLD and instantaneous effective dimension (IED, [7]), NGP appears to have significantly higher sensitivity in the temporal domain to the changes in wave patterns (fig 3 bottom plots). While the complexity estimated by IED is qualitatively consistent with the NGP, NGP more accurately reflects the number of coherent clusters of these changing wave patterns.

Discussion and Conclusion
In summary, in the past few decades, various measures have been used to measure the complexity of a system [5]. As a powerful tool for extracting coherent structures, the empirical orthogonal function (EOF) was used to characterize spatiotemporal patterns in neural tissue [6,7]. Unfortunately however, the orthogonality requirement on the extracted eigenmodes imposes a limit on the physical interpretability. In this paper, we follow the idea of P. Jung et. al. [14], and extend the definition of the coherent spacetime cluster to the space-time regions within which wave patterns have identical spatiotemporal symmetry. By inspecting the evolutional features of the orientation distribution [17], we develop a geometric method to estimate the number the coherent clusters. By applying the method on both simulated and actual wave patterns, we show that the NGP gives a qualitatively accurate estimation of the number of coherent clusters.
With notation borrowed from statistical mechanics, P. Jung et. al. [14] defined spatiotemporal entropy of spatiotemporal patterns. With the extended definition of coherence clusters, the spatiotemporal entropy can be defined similarly. It can be shown that with fixed spatial sampling window, the number of coherence clusters arising in wave patterns is proportional to the spatiotemporal entropy of the wave patterns, and using a sliding temporal sampling window, the instantaneous spatiotemporal entropy can be estimated by computing the NGP. Therefore, in comparison with the EOF based methods, the NGP provides a more sensitive and physically relevant measure of the complexity.

Acknowledgement
This work was supported by NIH Grants R01NS036447 (J.Y.W.) and K02MH04193 (S.J.S). We thank Kay A Robbins for valuable comments on this manuscript.

Appendix A -Spatiotemporal Symmetry and Coherent Clusters
Let ) , , ( t y x f Ω be the scalar field of a wave pattern with . Let the operators of translation symmetry in space and time, rotation symmetry, and translation symmetry in space in radial direction be respectively defined as follows, denotes the displacement vector. Then the spatiotemporal symmetry of wave patterns is defined as follows. The wave pattern ) ,

Appendix B -Spiking Neural Network
Various neuronal network models for simulating wave patterns have been proposed (for review, see [18]). In this paper we use a slightly modified version of the spiking neural network model proposed by W. M. Kistler, R. Seitz, and J. L. van Hemmen [19] for wave pattern generation.
The spiking neural network consists of a 51 51× neuronal lattice, in which each point ) , ( j i y x represents a neuron, and in order to simplify notation, we use ) , . The distances between adjacent rows and adjacent columns are both set as 1. The time step in simulations is set as 10ms. The spatiotemporal pattern of the neuronal membrane potentials is given by: describes the refractory contribution, and describes the synaptic contribution. The stimulation ) , , ( t j i V stm is set as: The initial state of the network in simulations at both excitation levels is set as: In refractory contribution, describes the after potential elicited by spikes, and ) (ξ Θ is the Heaviside step function.
In synaptic contribution, ) ( ) ( denotes the firing times of the neuron ) , ( j i , and the index