Abstract
Objective
We present a novel signal processing algorithm for automated, noninvasive detection of Cortical Spreading Depolarizations (CSDs) using electroen-cephalography (EEG) signals and validate the algorithm on simulated EEG signals. CSDs are waves of neurochemical changes that suppress neuronal activity as they propagate across the brain’s cortical surface. CSDs are believed to mediate secondary brain damage after brain trauma and cerebrovascular diseases like stroke. We address two key challenges in detecting CSDs from EEG signals: (i) attenuation and loss of high spatial resolution information; and (ii) cortical folds, which complicate tracking CSD waves.
Methods
Our algorithm detects and tracks “wavefronts” of a CSD wave, and stitch together data across space and time to make a detection. To test our algorithm, we provide different models of CSD waves, including different widths of CSD suppressions and different patterns, and use them to simulate scalp EEG signals using head models of 4 subjects.
Results and conclusion
Our results suggest that low-density EEG grids (40 electrodes) can detect CSD widths of 1.1 cm on average, while higher density EEG grids (340 electrodes) can detect CSD patterns as thin as 0.43 cm (less than minimum widths reported in prior works), among which single-gyrus CSDs are the hardest to detect because of their small suppression area.
Significance
The proposed algorithm is a first step toward noninvasive, automated detection of CSDs, which can help in reducing secondary brain damages.
Keywords: Cortical Spreading Depolarization (CSD), Electroencephalography (EEG), Trauma Brain Injury (TBI), Detection, Algorithm
I. Introduction
IN this work, we provide an algorithm for noninvasive and automated detection of Cortical Spreading Depolarizations (CSDs) which is tested on simulated electroencephalography (EEG) signals. CSDs are waves of neurochemical changes that propagate slowly (1 to 8 mm/min) across the cortical surface and result in a suppression of normal neuronal electrical activity [3]–[5] (see Fig. 1). CSDs occur because of loss of electrochemical gradient across neuronal membranes [6]. Increasing evidence shows that CSDs may contribute to secondary brain injury after trauma, stroke, and hemorrhage by causing microvascular constriction and brain tissue hypoperfusion [6]–[8]. Approximately 2.5 million TBIs occur in the United States per year1, and among all of the deaths due to injuries, 30% are due to TBIs2 [9]. Higher frequency of occurrence of CSDs is correlated with higher tissue damage [7], and surgical measures that reduce CSD incident lead to improved clinical outcomes [10]. Therefore, there is a need for early detection and inhibition of CSDs. At present, aside from visual examination of electrophysiological data [11], there is no established technique for automated noninvasive detection of CSDs. We view our work as the first step in that direction.
Two main challenges in detecting CSD from noninvasive EEG recording are: (i) transient disappearance of parts of a CSD wave from EEG recordings when it enters sulci; and (ii) spatially blurred observation of the underlying cortical activity recorded by scalp EEGs. This spatial blurring is due to the decay of high resolution information passing through bone and soft tissue, which complicates detection of narrow CSDs. In idealized spherical models, a CSD wave forms an annular ring of depressed brain activity that propagates across the cortical surface. However, due to the presence of folds (gyri and sulci) in the human cortex, a CSD wave would appear in EEG recordings as broken parts that we call “wavefronts,” which can evolve to break down or combine with other wavefronts as the wave propagates. To address the first difficulty, we need to reduce the problem to a simpler problem of detecting these wavefronts instead of a full CSD wave. To address the second difficulty, we use higher-density EEG grids, and project the signal on the brain surface using a tool called “surface-Laplacian” [12]. Instead of deciding on the presence of CSD from the channels independently, we track wavefronts that move consistently across time with speed consistent with the range of CSD propagation speed. To obtain these wavefronts, we use displacement vectors which are known as “optical flows” and used in computer vision for object tracking [13], [14].
We test our algorithm on EEG data generated by simulating CSD propagation on the cortex using two models: (i) an ion diffusion-based “mesoscale” model of CSDs that builds on Tuckwell’s model of CSD propagation [15], with some modifications as described in Section II-A. Tuckwell’s model abstracts the physiological mechanisms of CSD propagation and helps us test our detection algorithm in an accepted model of CSDs. It makes a connection between the current understanding of CSD waves and our proposed algorithm. However, this model has a fixed width of suppression (~2 cm), and generates idealized ring shapes of CSD propagation (on planarized surfaces), while in practice, the width and the shape of CSD suppression can vary (by “width of CSD suppression” we mean the spatial width of the CSD wave parallel to the direction of propagation; see Fig. 3a). Therefore, we also use (ii) a more abstract model that suppresses regular brain activity (modeled as a random Gaussian process) to generate “complex” CSD patterns (e.g., a non-ideal ring shape, semi-planar wavefronts, and single-gyrus propagation). These patterns are simply imposed onto the random brain activity, and the generation is thus somewhat “artificial.” This artificial generation of CSD models allows us to tune suppression widths and shape of CSD waves, yielding a broader set of signals to test our algorithm on them. To generate EEG signals, the simulated CSD wave is projected to the scalp using subject-specific forward models (with 33,255 sources on the cerebral cortex (gray matter) and 40 and 340 sensors for low-density (LD) and high-density (HD) EEGs, respectively). We use MRI images from 4 subjects aged 18 to 74 years from the OASIS dataset3 to generate the forward models. Our results suggest that while low-density EEG grids can detect a significant fraction of CSDs, higher-density grids are required for detecting narrow CSD waves.
A. Related works
In [11], Dreier et al. summarize the works of the Co-Operative Studies on Brain Injury Depolarizations (COSBID) group which utilize direct-current (DC) shift of ECoG signals to detect post-trauma CSDs. They show that in parts of the cortex without spontaneous neural activity (electrophysiologic penumbra), there is a specific type of spreading depolarization waves, called isoelectric spreading depolarization (ISD). ISDs can be recorded and visually observed using near-DC-ECoG signals, which contains the low frequency and near DC components of the recorded ECoG signals (below 0.5 Hz). This detection technique, however, could be hard to apply to noninvasive EEG signals where the preprocessing often filters out near-DC signals. We note that DC-coupled EEG recordings can be made from the scalp, and this can enable detection of CSDs using DC shifts in EEG [16], [17]. However, DC-coupled EEG is not commonly used today, thus we focus on high-frequency suppression in this work.
While ECoG signals are invasive, in [17], Hartings et al. show that CSDs can be detected noninvasively using EEG in patients with severe TBI. This work built on an earlier work of Drenckhahn et al. [16], who present similar results on patients with malignant hemispheric stroke and subarachnoid hemorrhage. Hartings et al. first identify CSDs in electrocorticography (ECoG) recordings through visual inspection, and also visually inspect time-aligned scalp EEG recordings to find amplitude depressions associated with the depolarization. They show that 81% of the identified events has manifestations in the “time compressed” (i.e., downsampled) EEG recordings. The authors first downsample the EEG signals in time to visually observe electrical silences in EEG signals and then check if these silences spread spatially. However, in this work, the skull of the patients is fractured, potentially reducing the spatial blurring in the EEG signals. Further, the widths of CSD depressions are quite large in severe TBI, making these CSDs easier to detect noninvasively. Finally, the visual inspection technique used is not automated. All three limitations are overcome in our work.
A contrasting, and perhaps cautionary, recent work is that of Hofmeijer et al. [18], where the authors monitored 18 stroke and 18 TBI patients. Using 21 electrode EEG systems, no CSDs were observed through visual inspection. The authors speculate that, among other reasons, this could be because of volume conduction and low resolution of the EEG system used. Because higher-density EEG systems continue to yield a higher spatial resolution [19], [20], a deeper understanding of what CSDs can be detected noninvasively through low and high-density EEG needs to be obtained experimentally. Our work provides a simulation-based understanding of this issue, and while an experimental validation is required, the simulations do suggest that low-density EEGs can miss narrow-width CSDs, consistent with the speculation in [18].
Towards developing automated algorithms, one related work is that of Gharibans et al. [21], who propose an automated algorithm to detect a slowly propagating gastric waves using noninvasive electrogastrogram (EGG). This detection algorithm, like ours, is based on consistency in speed and direction of propagation. However, our algorithm is more suited to the CSD detection problem because: (i) unlike in CSD propagation, there are no folds on the stomach surface to cause “disappearance” of the recorded wavefronts, and (ii) their algorithm utilizes spatial averaging over all electrodes, which limits the algorithm to detect time of spread, but not the spatial location. Similarly, in [22], Bastany et al. monitor spreading depolarization DC potential changes in rats using three different analyses, namely, spectrogram, bi-spectrogram, and pattern distribution. However, rat cortex also does not have any folds, and further, rats have thinner skulls than humans, causing less spatial blurring in EEG recordings.
B. Paper organization
The rest of the paper is organized as follows. In Section II, we introduce our “mesoscale” model of CSD propagation that builds on a similar model of Tuckwell et al. [15], [23]. To complement Tuckwell’s model, we also introduce our models of complex CSD patterns that have varying CSD widths and patterns. In Section III we provide our automated CSD detection algorithm. In Section III-C, we quantify the performance of detection using low and high-density EEG on CSDs of varying widths of suppression, and for different head models. Finally, we conclude in Section IV, where we discuss limitations of the proposed algorithm and some possible directions for future work.
II. CSD modeling
In the following, we describe how we simulate the CSD wave on the cortex using a 2D “mesoscale” model, and perform forward modeling to project the signal onto the scalp to obtain simulated EEG data. To achieve realistic simulations of CSD waves, we use real brain models that have gyri and sulci. Fig. 2 summarizes the main steps of CSD modeling.
A. 2D models of CSDs: a mesoscale model, and imposed complex CSD patterns
We borrow the 2D model of Tuckwell [23], which is based on extracellular space (ECS) and intracellular space (ICS) ion concentration changes. Tuckwell’s model is based on “reaction-diffusion” of ions and neurotransmitters. “Reaction” refers to the ion exchange between ICS and ECS, which is at the cell level and is the microscopic part of the model, and “diffusion” refers to the ionic propagation in the ECS and between neurons, which is the macroscopic part of the model. The resulting “mesoscale” model takes six components into account: 4 ions K+, Ca++, Na+, Cl− and two neurotransmitters, one inhibitory which we call “TI,” such as GABA; and one excitatory (“TE”), such as glutamate. Among these six components, ICS concentrations of K+, Na+, and Cl− are associated with the post-synaptic membrane, and ICS concentration of Ca++ and fluxes of TI and TE are associated with the pre-synaptic neuron. This mesoscale model consists of six coupled 2D parabolic partial differential equations (PDEs), which update the ECS concentrations of the 6 components on the 2D space and time as follows:
(1) |
where u(x, y, t) is the vector of ECS and ICS concentrations, Dui is the diffusion coefficient of the corresponding ECS component, and (u) is the flux term of each component. To solve the PDEs in (1), we perform discretization using Euler’s method. Further details of this model are available in Appendices of [1].
Some notable aspects of Tuckwell’s model are: (i) it does not account for cell swelling, which can increase the refractory period. However, the speed of CSD wave propagation is unaffected by cell swelling [24] even if the width could be affected. Thus, we also use other CSD models where the width and the speed of depression are tunable parameters; (ii) the dynamics of calcium in the pre-synaptic region are related to the amount of transmitter release at the synaptic cleft (see the Appendices of [1]), thus this model includes the dynamics of calcium [25]; (iii) the model instigates CSD using a local increase in the extracellular potassium concentration. In brain injuries, substantial intracellular potassium is released into the ECS of the injured part due to neural damage or death, which is believed to instigate CSDs. In fact, the amount of released K+ is proportional to the severity of the injury [26], [27]. Beyond injury, there may be other factors as well that are involved in CSD instigation in neurological disorders.
Another assumption in [23] is the homogeneity of the medium in which the ions diffuse, which makes the shape of the generated CSD wave an idealized annular ring. Several factors can result in spatial heterogeneity of ion diffusions such as (i) the shape and the geometry of ECS that causes additional delay in ion propagation compared to a free medium, and (ii) presence of dead cells and fixed negative charges in the ECS, particularly in injured brains [28]. To make our simulations more realistic, we introduce heterogeneity in our model of the cortical medium, which is explained in detail in the Appendices of [1].
In addition to the heterogeneous ring shape of propagation, CSD can have more complex patterns of propagation, namely, propagation on a single gyrus [29], [30], and spreading with multiple semi-planar wavefronts that split from an original wave [30]–[32]. Complex patterns of CSDs may appear when spreading depolarizations occur in energy compromised areas, e.g., lesions in brain [33]. To test the performance of our detection algorithm, we simulate these complex patterns of CSD on a 2D plane, similar to the 2D plane in the mesoscale model, and then project them on the cortex. Fig. 3a shows a CSD on left hemisphere with propagating semi-planar wavefronts with a width of suppression of 2.5 cm. Fig. 3b represents the propagation of a narrow CSD wavefront (5 mm) on a single gyrus, which is highlighted in blue.
B. Projection of cortical signals onto the scalp
To test the detection of CSDs using noninvasive scalp EEG, we first simulate a CSD wave on a real brain model and then obtain the resulting scalp EEG. To transition from our 2D model to real brain model, we perform mappings in four steps: (i) the 2D model is mapped onto a segment of an unrolled cylinder; (ii) the unrolled cylinder is projected onto a unit sphere, by radially contracting all points in a direction perpendicular to the axis of the cylinder (see Fig. 4)4; (iii) as an intermediate step, a unit sphere is used to represent the entire cortical surface through “inflation” of cortex (see Fig. 5). This intermediate inflated cortex is a smooth surface. Such inflation is readily performed using tools such as Freesurfer5 which is an open source software; (iv) the sphere (along with the CSD mapped onto it) is finally deflated to reassume the intricate gyrencephalic structure of the cortex. Fig. 5a shows a CSD generated on the left hemisphere. Since the 2D CSD from the mesoscale model is mapped onto an inflated spherical 3D model of the cortex, the CSD wave gets projected onto both sulci and gyri, not only on gyri. Hence, the spreading depolarization wave travels inside sulcal regions (see Fig. 6), and the time it takes for CSD to get out of a sulcus depends on the depth of the sulcus.
To obtain the EEG recordings, we use a forward model based on the subject’s head model (obtained from MRI scans) to project the electrical activity of brain sources on to the scalp. In this paper, an open source MRI database (OASIS) is used to obtain real head models. We choose MRI image set of 4 healthy subjects in this dataset with different ages (OASIS1: 74, OASIS2: 55, OASIS4: 28 and OASIS5: 18 years old) and use FreeSurfer to process these MRI images and extract different layers of head, i.e., scalp, skull, cerebrospinal fluid (CSF) and brain (cerebral cortex). Next, using a Matlab toolbox FieldTrip [35], which is designed for EEG data analysis, we generate a forward matrix with the first dimension equal to the number of EEG sensors on scalp and the second dimension equal to the number of electrical sources in brain (dipoles normal to the surface of cortex [12], [36]). In our simulations, we use 33,255 cortical sources and Nch(= 40 for low-density, or 340 for high-density) EEG electrodes on scalp. The EEG electrode locations are generated by projecting the spherical harmonic locations on the scalp and removing parts such as face and neck (Fig. 7).
After constructing this forward model, the next step is generating electrical signals of CSD propagation on the cortex and project them on the scalp. To do so, we use two aspects of CSDs: i) During a CSD wave propagation, the activity of sources where the wave is passing is suppressed; and ii) Electrical activities of sources that lie within brain grooves (sulci) are hard to be recorded from the scalp, because of their depth, and also because some of these dipoles are parallel to the cortical surface. This breaks the CSD wave into disjoint parts that we call “wavefronts.” For the illustration purpose and to show how does the CSD wavefronts look like on the cortex we use the depth of sulci, extracted from MRI images, to create these breaks (See Fig. 5b). For the simulated EEG signals, the generated forward model automatically takes into account the “electrical disappearance” in sulci.
We simulate background electrical activity on the cerebral cortex during CSD propagation using normal random process and then suppress it at the locations of the CSD wave. We suppress the electrical activity using a smooth falling edge, and then gradually have it recover using a similar rising edge, with a variable delay6, after the CSD propagation. The delay is to model the fact that spreading depression usually outlasts spreading depolarization [11]. In this way, we utilize the spatiotemporal locations of CSD wavefronts in the “mesoscale” model to generate these suppressions in the electrical activity, and consequently, the main characteristics of CSD waves, including the speed of propagation and width of suppression, are reflected in the electrical signals. The simulated electrical signal used in our experiments lasts for an hour, and in the first 30 minutes, there is a CSD propagation that starts on the left hemisphere with the speed of 3 mm/min. Signal “SCrtx” in Fig. 8b is the simulated cortical signal. As the final step in this section, we obtain the EEG signals on the scalp (signal “SEEG”) by applying the subject-specific forward model to the simulated cortical signals. Fig. 9 shows the resulting SEEG signal. Visual comparison of our simulated signals with the actual ECoG and EEG recordings of CSD propagation (e.g., [17]) suggests that our simulated electrical signals are a reasonable approximation of CSD waves.
III. Detection algorithm
Detection of CSDs from EEG recordings is challenging because of the following reasons: (i) as explained in the previous section, EEG is less sensitive to activity inside a sulcus, breaking the recorded wave into multiple wavefronts; (ii) the decay of high spatial frequencies as the signal passes through skull and soft tissue. This makes the detection of CSDs with narrow width and/or small overall area of suppression hard, e.g., detection of CSDs with semi-planar wavefronts, which may affect only a single gyrus, is difficult using EEG; (iii) uncertainty in the point of initiation of CSD makes the detection challenging; and (iv) different speeds of propagation in different brain regions due to the spatial heterogeneity of the diffusivity of ions involved in the CSD propagation (see the “heterogeneous model” in the Appendices of [1]).
To overcome these challenges, the key idea is to identify and track CSD wavefronts and stitch together data across time and space to detect the CSD wave. In doing so, we first pre-process the simulated EEG signals to obtain a sequence of interpolated 2D spatial maps, from which we extract spatiotemporal coordinates of suppressed activity. Because a CSD wave manifests as traveling wave of suppressed brain activity on the cortex, we track suppressions that spread across time and space and score the wavefronts based on their orientations and speeds to classify the propagating waves and detect CSDs. In the following sections, we explain each of these steps in detail.
A. EEG pre-processing
The goal of this step is to extract the neural suppression pattern out of the simulated EEG signals, as these signals may have a low spatial resolution. Also, we partially compensate (using Laplacian spatial filtering) for the attenuation of high spatial frequencies caused by layers in between the electrical sources of the cortex and the EEG electrodes on the scalp surface, such as cerebrospinal fluid (CSF), skull and scalp. Pre-processing the EEG signals helps improve the signal to noise ratio (SNR) of CSD suppressions and obtain a sequence of 2D spatial maps, on which we later apply image processing techniques for CSD detection. All of the following pre-processing steps are summarized in Fig. 9.
Laplacian spatial filtering
Laplacian filter is an approximation of the 2D spatial second derivative that is a good approximation for high-density EEG. Operationally, it extracts localized activity with high spatial frequencies [37], [38]. Since narrow CSD waves have high spatial frequencies, Laplacian filter is a good choice to extract the suppressions from the EEG signals and overcome the attenuation of high spatial frequencies in these signals. In contrast, for wide CSDs Laplacian filtering may not help. To not make any assumptions on the width of CSD in the detection process, we apply our detection algorithm on signals both before “SEEG”) and after “SLSF”) applying the Laplacian filter, and make a decision based on both. As the electrode distance increases, the Laplacian filter becomes less sensitive to the highly localized activity, e.g., narrow CSDs [37]. Therefore, we only apply the filter to high-density EEG electrodes (Nch = 340). To apply the Laplacian filter on the SEEG signal at each electrode location, we consider its neighboring electrodes in radial distance of 3 cm and update the voltages of electrodes as follows [37]:
(2) |
where Vi(t) and are the voltages of signal SEEG and its Laplacian (SLSF) respectively at electrode i and at time t, and dij is the radial distance between electrodes i and j. Fig. 9 shows how the use of Laplacian helps in extracting a narrow CSD suppression from the signal SEEG.
Envelope extraction and cross correlation
In this step, we calculate the average power of EEG signals using a sliding time window for all Nch channels. We arbitrarily assign a width of 14 seconds (20 samples) to this time window, which is small compared to the temporal width of CSD suppression. This low pass filtering temporally smoothens the EEG power. Signal “SPW” in Fig. 10a shows this average power.
Next, we perform envelope extraction. We use peak envelope extraction method, proposed in [39] and implemented in [40], which detects and extracts local maxima7. In Fig. 10b, signal “Senv” is the extracted envelope with zero DC offset. It is necessary to remove the DC offset of signal Senv for the next step, which is the amplification of the CSD suppression. We do this amplification using the cross correlation of signal Senv with a pattern of a negative step function (signal “SPtrn” in Fig. 10c). We exploit the fact that CSD suppression causes a reduction in the power of EEG signals. This power reduction forces the signal Senv, which has zero DC offset, to go to the negative values. We choose a 1-minute wide negative pulse for SPtrn in a way to be able to extract all types of CSDs which may have from 1 to 64 minutes long suppressions at any location [5], [17], [41]. The output signal after the envelope extraction and amplification of the silencing is shown in Fig. 10d as signal “SX corr.”
Cylindrical projection
Our detection algorithm utilizes optical flow, a video-processing technique designed for 2D images. In order to obtain 2D spatial maps of pre-processed EEG data (SX corr), we project the scalp EEG electrode locations onto a 2D plane using cylindrical projection and assign the signal SXcorr to each corresponding electrode (image ISparse in Fig. 11).
To address the uncertainty in the location of the focal point of CSD waves, we take two different cylindrical projections which are oriented normal to each other. Fig. 11 illustrates an example of this dual cylindrical projection. By using these dual projections, we ensure that the CSD wave is represented without distortion at the edges of the 2D plane. In Fig. 11b, the starting point is near the upper right corner, and the shape of the CSD wave is quite distorted, which makes the tracking of wavefronts unreliable. In Fig. 11a, this problem is resolved, and the wave appears near the center of the 2D plane. Therefore, we use both cylindrical projections in our detection algorithm, but keep track of CSD propagation based on the one that captures the CSD wavefronts (if any is present).
Interpolation and thresholding
The 2D spatial map of the scalp simulated signals that we obtain using the previous steps (ISparse in Fig. 11a and b) is spatially sparse due to the limited number of EEG electrodes, even more so with low-density EEG. Therefore, we apply a 2D Gaussian kernel with σ = 6.8 mm to spatially interpolate and create smooth images out of these sparse 2D maps. Image ISmooth in Fig. 11c and d shows these interpolated 2D spatial maps.
Having these 2D spatial maps, we apply a two-step thresholding process to obtain binary images: a global and a local threshold. We first apply a global threshold to reject pixels with minimal values in ISmooth. Concretely, we assign zero to pixels with values lower than 40% of the global maximum (the average of highest pixel values among all images). As a second thresholding step, for each smoothened image, we set the pixels for regions whose magnitudes lies within upper 60% of pixel value range in that image (local threshold). This threshold is kept not too high to reject valid CSD wavefronts, even allowing for a relatively high “false-alarm” rate where positive detections will be rejected later through stitching data across time and space. Fig. 12 shows the resulting binary image (IBW). The regions of higher magnitude correspond to regions of suppressed electrical activity, and they appear as connected components in IBW. Some of these connected components are parts of the CSD propagating wave, and others correspond to non-CSD evanescent waves, which we expect to reject in the ensuing processing.
B. Tracking of wavefronts and stitching data across space and time for an overall detection decision
In order to identify whether the wavefronts belong to a CSD propagation, we track the motion of wavefronts across frames using optical flows of pixels, followed by computing a score function based on the direction of propagation and speed and through a stitching process across time and space. Thresholding on the overall score function is used to detect the CSD waves. Fig. 12 shows different steps of the detection algorithm and the connection between them.
Downsampling and calculating optical flow
Optical flow is a technique used in computer vision to calculate the movement of objects between frames based on the spatiotemporal brightness variations and is used in many tasks such as motion estimation, object tracking and segmentation [13], [14]. We leverage optical flow to obtain the speed and orientation of the wavefronts’ motions. We use the Horn-Schunck algorithm for computing optical flows, which is proposed in [13] and implemented in [42]. However, since the speed of CSD propagation is very slow, we temporally downsample the binary images by means of sub-sampling every ten frames (every 7 seconds), to make it easy for the optical flow algorithm to capture the CSD wavefronts’ movement across frames.
Image IOpt in Fig. 14c shows the motion vectors as a collection of arrows where the length of each arrow corresponds to the magnitude of velocity and its orientation gives the direction of propagation of the corresponding pixel in IBW.
Quantization of orientations
As shown in Fig. 14c, in each binary image there are some connected components. In this step, we assign a bounding box to each connected component, and we call it “BBox” (red boxes in IOpt). To reduce the computational cost and focus on the larger connected components, we reject the bounding boxes with an area less than 20 mm2. Based on the size of the Gaussian kernel that we use for spatial interpolation (σ = 6.8 mm, see Section III-A), this is a reasonable threshold for the size of bounding boxes.
Next, we compute a histogram of the orientation of optical flows for each of these bounding boxes. Fig. 13b shows an example of this histogram. The histogram contains 12 bins of 30° each. Based on this histogram, the prominent directions of propagations can be extracted, e.g., if there are two significant directions of propagation in a bounding box, it indicates that the wavefront might split into two parts during the next few frames. To extract these prominent orientations, we apply a thresholding operation on each of these histograms at 50% of the largest population among the bins. For the remaining optical flows, we quantize the orientations based on the central point of their corresponding bins in the histogram, e.g., if the orientation lies in the interval of 60° to 90°, its new value becomes 75°. Fig. 13c shows these quantized optical flows.
Orientations bounding boxes (OBBox)
In this step, we define a new set of bounding boxes based on the quantized orientations. For each value of orientation, we find the optical flows that are connected through pixels and have similar orientations, and we assign a bounding box to each of them (green boxes in Fig. 13c). We name these new bounding boxes “OBBox.” We apply a threshold based on the size of these OBBoxes, similar to the threshold for BBoxes as we explained in the previous section, to reject very small OBBoxes and focus on the significant parts of the wavefronts which move together in the same direction.
Scoring OBBoxes based on the consistency of propagation
In this step, we score these OBBoxes based on the consistency in the direction and speed of propagation. Since each OBBox contains optical flows with similar orientation, we consider this orientation as the direction of propagation of OBBox, and we assign the average magnitude of the optical flows inside each OBBox as its speed of propagation. Our scoring algorithm consists of two main parts: (i) define the spatiotemporal neighbors for each OBBox; and (ii) assign a weighted score to each OBBox based on direction and speed of propagation.
First, for each OBBox we define its neighbors as the OBBoxes which lie within a radius of 2 cm (center-to-center distance) and temporal range of about 2 minutes (20 frames before and 20 frames after the current frame). Since a CSD wave propagates slowly (8 mm/min at the maximum [17]), inside this window of 2 minutes, we can expect the CSD wavefronts to have a displacement of less than 2 cm. This explains the reason for choosing the values above as the spatiotemporal range of neighbors.
As the second step in the scoring algorithm, we check if the speed of each OBBox is consistent with that of a CSD wave (1-8 mm/min). If so, we search its spatiotemporal neighbors, as defined in the first step, to find matching bounding boxes, i.e., an OBBox with the same direction of propagation and an average speed of 1-8 mm/min. We define the score of each OBBox (“SCR”) as the sum of the area of its matching neighbors. Thus, we now have a weighted score function for OBBoxes. Note that although the cylindrical projections (Section III-A) reduces the speed of propagation for the projected wavefronts in some parts of the 2D plane (depending on the orientation of the cylindrical projection), the upper bound of 8 mm/min on the speed of CSD still holds and there is no faster CSD propagating wavefront on the 2D spatial maps after projection.
In addition to the spatiotemporal scoring (SCR), we check the temporal consistency of this score function, i.e., whether these matching OBBoxes are well distributed over the temporal range of 20 frames, or just concentrated in a few frames. This helps us differentiate and reject the short-time non-CSD evanescent waves from the consistent and slowly propagating CSD wavefronts. We assign a binary score to each of the 40 neighboring frames; if a frame contains one or more matching OBBoxes, we assign 1 to this score; otherwise, we assign a 0. We call this the “temporal score.” If less than 60% of these frames have non-zero temporal scores, we reset (make zero) the spatiotemporal score of corresponding OBBox. This scoring algorithm allows us to extract the OBBoxes that are candidate pieces of a CSD wave. However, there is still room to improve the results regarding rejecting false alarms, using exploiting the temporal characteristic of CSD propagation, i.e., the duration of propagation. This is done in the next step.
Stitching process and the final decision on detection
In this step, we make the final decision based on the spatiotemporal scores of OBBoxes. First, to reject the boxes with minimal scores, we apply a spatial threshold, i.e., the 10% of the maximum available score at each frame. Also, we reject the frames (and all of the OBBoxes within them) with a total score of less than 10% of average scores among all frames. Here, the frame score is simply the sum of the scores of all OBBoxes within it. Fig. 14b shows this frame score (, where n is the number of total frames) after thresholding.
We stitch the frames as follows: we slide a time window of 10 minutes over the frames and calculate the number of frames with non-zero scores “BSCR”=1, see Fig. 14b) which lie inside this time interval. If this value is greater than half of the total number of frames inside this time interval (5 min), we select the middle frame. Fig. 14b shows these selected frames as a group of connected time indices using a binary function “Tout” (1=selected frame). We check the temporal length of these connected frames to be more than 5 minutes. After this step, we keep the OBBoxes of the selected frames and reject others. The final outputs of this detection algorithm are: (i) the spatial location of the remaining OBBoxes, which indicates the location of CSD wavefronts in each frame (Iout in Fig. 14d); and (ii) the temporal locations of these selected frames as the time indices of CSD propagation in the simulated dataset (Tout in Fig. 14b). The output of our detection algorithm using HD-EEG simulated signals (Nch = 340) on a wave generated using Tuckwell’s model (Section II-A) is shown in Fig. 14.
C. Detection results: comparing low and high-density EEG
We apply the detection algorithm on four different real head models, which we extract from the OASIS dataset of MRI scans. CSD suppression widths for TBI can range from 0.8 to 6.4 cm [5], [17], [41], and the range could be broadened by including migraines (very short suppressions). Thus, we test the performance of our algorithm for a wider range of widths of suppression, namely 0.3 to 6.4 cm. Here we explore how high-density EEG could improve the performance of CSD detection concerning the minimum detectable width of suppression.
We apply the detection algorithm on simulated signals from both low-density (LD) and high-density (HD) EEG grids (see Fig. 7). For the LD-EEG, we use 40 electrodes (Nch = 40), and for the HD-EEG, we use the same 340 electrodes (Nch = 340) as used in the previous sections. For both scenarios, we start with a CSD wave with a large width of suppression and reduce it to find the minimum detectable width of CSD. However, the mesoscale model of CSD, which is proposed in Section II, has a fixed width of CSD and is not appropriate for this experiment. To address this issue we “artificially” (i.e., without using Tuckwell’s model) generate CSDs on the real brain using the simulation of a propagating non-ideal ring-shaped wave emanating from a focal point.
Following the steps of CSD modeling in Fig.2, we first generate CSD waves on a 2D plane. In this 2D image, there are seven sectors of 51.4° each to which we assign different speeds of propagation in the range of CSD propagation’s speed (1-8 mm/min). In this simulation, we use the head models of 4 subjects and based on section II-B, we generate two forward models for each subject, one for the case of LD-EEG simulations (40 sensors and 33,255 sources) and the other for the HD-EEGs (with 340 sensors and 33,255 sources). Following steps in Section III, we find the minimum widths of CSD waves that are still detectable by our algorithm. When using HD vs. LD-EEG, there are two differences to note: (i) we only apply the Laplacian filter to HD-EEG electrodes because the Laplacian is only effective at high densities [37]. HD-EEG captures cortical signals at a higher spatial resolution relative to LD-EEG [19], [20], and Laplacian filter can extract a high-spatial-frequency view of cortical activity; and (ii) because the spatial resolution of LD-EEG is low, we use larger Gaussian kernel (σ=13.8 mm) for spatial interpolation to obtain smooth 2D maps (ISmooth).
The results of these simulations are provided in Table I. The average minimum detectable CSD-width using LD-EEG is 1.1 ± 0.22 cm, which covers the majority, but not all known widths of CSDs. However, the average minimum detectable CSD-width using HD-EEG electrodes is 0.43 ± 0.13 cm, which covers almost all types of CSD waves. Fig. 20 in [1] shows the output of CSD detection (Tout) for narrow (1 cm) and wide (6.4 cm) CSD silencing for four different head models, using HD-EEG simulations. In our simulations, CSD propagation happens in the first 30 minutes and starts on the left hemisphere. Based on the results in Fig. 20 in [1], our algorithm is able to detect the CSD propagation.
TABLE 1:
Subject | EEG | Interpolation (σ mm) | Minimum detectable width of CSD (cm) |
---|---|---|---|
OASIS1 | HD LD |
6.8 13.8 |
0.4 1.0 |
OASIS2 | HD LD |
6.8 13.8 |
0.3 1.1 |
OASIS4 | HD LD |
6.8 13.8 |
0.4 1.4 |
OASIS5 | HD LD |
6.8 13.8 |
0.6 0.9 |
Avg. | HD LD |
- - |
0.43±0.13 1.1±0.22 |
Fig. 15a and b, respectively show the detection results for two complex patterns of CSD waves, namely, propagation with semi-planar wavefronts, and on single gyrus. Based on these results, our detection algorithm successfully detects the entire 30 minutes propagation of semi-planar wavefronts of a CSD wave with 2.5 cm width of suppression. However, for a narrow CSD wavefront (5 mm wide) propagating on a single gyrus, our detection algorithm misses the first few minutes of propagation due to the small total area of suppression which is below the chosen threshold for the area of bounding boxes (see Section III-B).
For a fair comparison, we simulate an hour of EEG signals where there is no propagating electrical suppression, which is rejected by our algorithm (see Fig. 22 in [1]).
IV. Discussions and Conclusions
Our detection algorithm can detect different types of CSD waves, including narrow and complex patterns of CSD, using HD-EEG as long as the following conditions hold: (i) the CSD wave must have a width of suppression of at least 5 mm; (ii) the wavefronts overall must have a total area of suppression of at least 20 mm2. To the best of our knowledge, this threshold is less than the minimum reported area of suppression in the literature which is 80 mm2 for a single CSD wave in stroke patients [29]; and (iii) the wave must propagate for at least 5 minutes. Note that some short and temporally isolated CSDs [29] may not be detected using this algorithm.
This detection algorithm is not real-time. The speed of diagnosis and treatment in brain injuries is an important factor and can affect patients’ quality of life after the injury. Future work will extend this algorithm to enable real-time detection.
EEG grids of 340 electrodes might indeed seem unrealistic in today’s clinical settings, especially in situations where EEG electrode placement is limited by skull fractures, wounds, sutures, etc. This poses two engineering challenges. First, on the instrumentation side, when the clinical situation allows, how can one place hundreds of electrodes on the scalp within few minutes? Second, on the signal-processing side, can the algorithms for CSD detection be advanced to detect using limited (nonuniform) EEG arrays, and what would these arrays look like? Even for these lower electrode-count systems, our techniques might still be useful. Specifically, the preprocessing steps of our detection algorithm (see Fig. 10) can enhance the single-channel visual inspection of our simulated EEG signals for CSD detection. Going beyond TBI, migraine CSDs have smaller CSD widths [7], which makes their detection hard. Migraine CSDs have to be detected noninvasively, and thus HD-EEG is likely required.
Another shortcoming of our model is that it does not include low EEG baseline amplitudes, e.g., near lesions and in ischemic tissues. While obtaining realistic models of this aspect difficult, we believe it is important because it will also directly affect our preprocessing step where the cross correlation and thresholding computation might miss some CSDs because the baseline EEG itself is smaller. Simply normalizing each EEG channel (or signals in source space, obtained, e.g., after source localization or Laplacian filtering) can result in blowing up of noise, thus the algorithm will need to be adapted carefully. Owing to these significant complications in this problem, addressing this issue is left as future work. Finally, the algorithm needs to be tested through in-vivo recordings.
Acknowledgments
We thank the reviewers of this paper whose insightful comments led to significant improvements in the paper. We also thank Shawn Kelly and Marlene Behrmann for helpful discussions. We acknowledge the support of a grant from the Chuck Noll Foundation for Brain Injury Research, and CMU CIT Innovation seed funding.
A. Chamanzar, George, and Grover were supported in part by the CMU CIT Incubation Award, NSF WiFiUS program, and a CMU BrainHUB award. Dr. Elmer’s research is supported by the NIH (NINDS) grant 1K23NS097629. Due to space limitations, some of the details appear in an online version of this paper [1]. The preliminary results of this work were presented in part at the 12th World Congress on Brain Injury, New Orleans, LA, USA, 2017 [2].
Footnotes
The following three sources add up to this number: National Hospital Discharge Survey (NHDS), 2010 (https://www.cdc.gov/nchs/nhds/nhds_tables.htm); National Hospital Ambulatory Medical Care Survey (NHAMCS), 2010 (https://www.cdc.gov/nchs/ahcd/web_tables.htm); and, National Vital Statistics System (NVSS), 2010 (https://www.cdc.gov/nchs/nvss/index.htm). All data sources are maintained by the CDC National Center for Health Statistics.
National Vital Statistics System (NVSS), 2006–2010. The data source is maintained by the CDC National Center for Health Statistics.
For all of the spherical plots in this paper, we use the SSHT package [34] available at: http://www.jasonmcewen.org
We report results based on suppression widths, so this aspect is not discussed in our results section.
This envelope extraction algorithm first detects the tallest peak in the whole signal and ignores the other peaks in the distance of 20 samples (14 seconds) from that. Then it repeats for the remaining peaks and iterates until it considers all of the remaining peaks in the signal. It connects the extracted peaks using spline interpolation to obtain the envelope of the signal.
Contributor Information
Alireza Chamanzar, Carnegie Mellon University.
Shilpa George, Carnegie Mellon University.
Praveen Venkatesh, Carnegie Mellon University.
Maysamreza Chamanzar, Carnegie Mellon University.
Lori Shutter, Departments of Emergency Medicine and Critical Care Medicine, University of Pittsburgh.
Jonathan Elmer, Departments of Emergency Medicine and Critical Care Medicine, University of Pittsburgh.
Pulkit Grover, Carnegie Mellon University.
References
- [1].Chamanzar Alireza et al. An algorithm for automated, noninvasive detection of cortical spreading depolarizations based on eeg simulations. BioRxiv, https://www.biorxiv.org/content/early/2018/08/16/393058, 2018. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [2].Chamanzar Alireza et al. Systematic and automated algorithms for detecting cortical spreading depolarizations using eeg and ecog to improve tbi diagnosis and treatment In Brain Injury, volume 31, page 990 Taylor & Francis, 2017. [Google Scholar]
- [3].Somjen George G. Ions in the brain: normal function, seizures, and stroke. Oxford University Press, 2004. [Google Scholar]
- [4].Zandt Bas-Jan et al. How does spreading depression spread? physiology and modeling. Reviews in the Neurosciences, 26(2):183–198, 2015. [DOI] [PubMed] [Google Scholar]
- [5].Dreier Jens P et al. Delayed ischaemic neurological deficits after subarachnoid haemorrhage are associated with clusters of spreading depolarizations. Brain, 129(12):3224–3237, 2006. [DOI] [PubMed] [Google Scholar]
- [6].Dreier Jens P. The role of spreading depression, spreading depolarization and spreading ischemia in neurological disease. Nature medicine, 17(4):439–447, 2011. [DOI] [PubMed] [Google Scholar]
- [7].Lauritzen Martin et al. Clinical relevance of cortical spreading depression in neurological disorders: migraine, malignant stroke, subarachnoid and intracranial hemorrhage, and traumatic brain injury. Journal of Cerebral Blood Flow & Metabolism, 31(1):17–35, 2011. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [8].Dreier Jens P et al. Cortical spreading ischaemia is a novel process involved in ischaemic damage in patients with aneurysmal subarachnoid haemorrhage. Brain, 132(7):1866–1881, 2009. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [9].Centers for disease control and prevention (cdc), https://www.cdc.gov/.
- [10].Hartings Jed A et al. Surgical management of traumatic brain injury: a comparative-effectiveness study of 2 centers. Journal of neurosurgery, 120(2):434–446, 2014. [DOI] [PubMed] [Google Scholar]
- [11].Dreier Jens P et al. Recording, analysis, and interpretation of spreading depolarizations in neurointensive care: Review and recommendations of the cosbid research group. Journal of Cerebral Blood Flow & Metabolism, 37(5):1595–1625, 2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [12].Nunez Paul L and Srinivasan Ramesh. Electric fields of the brain: the neurophysics of EEG. Oxford University Press, USA, 2006. [Google Scholar]
- [13].Horn Berthold KP and Schunck Brian G. Determining optical flow. Artificial intelligence, 17(1-3):185–203, 1981. [Google Scholar]
- [14].Lucas Bruce D et al. An iterative image registration technique with an application to stereo vision. 1981.
- [15].Tuckwell Henry C and Hermansen Christopher L. Ion and transmitter movements during spreading cortical depression. International Journal of Neuroscience, 12(2): 109–135, 1981. [DOI] [PubMed] [Google Scholar]
- [16].Drenckhahn Christoph et al. Correlates of spreading depolarization in human scalp electroencephalography. Brain, 135(3):853–868, 2012. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [17].Hartings Jed A et al. Spreading depression in continuous electroen-cephalography of brain trauma. Annals of neurology, 76(5):681–694, 2014. [DOI] [PubMed] [Google Scholar]
- [18].Hofmeijer Jeannette et al. Detecting cortical spreading depolarization with full band scalp electroencephalography: an illusion? Frontiers in neurology, 9:17, 2018. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [19].Grover Pulkit and Venkatesh Praveen. An information-theoretic view of EEG imaging. Proceedings of the IEEE, 105(2):367–384, February 2017. [Google Scholar]
- [20].Robinson Amanda K et al. Very high density eeg elucidates spatiotemporal aspects of early visual processing. Scientific reports, 7(1): 16248, 2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [21].Gharibans Armen A et al. High-resolution electrogastrogram: A novel, noninvasive method for determining gastric slow-wave direction and speed. IEEE Transactions on Biomedical Engineering, 64(4):807–815, 2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [22].Bastany Zoya JR et al. Non-invasive monitoring of spreading depression. Neuroscience, 333:1–12, 2016. [DOI] [PubMed] [Google Scholar]
- [23].Tuckwell Henry C. Mathematical modeling of spreading cortical depression: spiral and reverberating waves. In AIP Conference Proceedings, volume 1028, pages 46–64. AIP, 2008. [Google Scholar]
- [24].Yao Wei et al. A continuum neuronal model for the instigation and propagation of cortical spreading depression. Bulletin of mathematical biology, 73(11):2773–2790, 2011. [DOI] [PubMed] [Google Scholar]
- [25].Heidelberger Ruth et al. Calcium dependence of the rate of exocytosis in a synaptic terminal. Nature, 371(6497):513–515, 1994. [DOI] [PubMed] [Google Scholar]
- [26].Prins Mayumi et al. The pathophysiology of traumatic brain injury at a glance. Disease models & mechanisms, 6(6): 1307–1315, 2013. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [27].Bose Tanima et al. Role of ion channels in regulating ca2+ homeostasis during the interplay between immune and cancer cells. Cell death & disease, 6(2):e1648, 2015. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [28].Syková Eva and Nicholson Charles. Diffusion in brain extracellular space. Physiological reviews, 88(4): 1277–1340, 2008. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [29].Woitzik Johannes et al. Propagation of cortical spreading depolarization in the human cortex after malignant stroke. Neurology, 80(12):1095–1102, 2013. [DOI] [PubMed] [Google Scholar]
- [30].Santos Edgar et al. Heterogeneous propagation of spreading depolarizations in the lissencephalic and gyrencephalic brain. Journal of Cerebral Blood Flow & Metabolism, 37(7):2639–2643, 2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [31].Kaufmann Dan et al. Heterogeneous incidence and propagation of spreading depolarizations. Journal of Cerebral Blood Flow & Metabolism, 37(5): 1748–1762, 2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [32].Santos Edgar et al. Radial, spiral and reverberating waves of spreading depolarization occur in the gyrencephalic brain. Neuroimage, 99:244–255, 2014. [DOI] [PubMed] [Google Scholar]
- [33].Milakara Denny et al. Simulation of spreading depolarization trajectories in cerebral cortex: Correlation of velocity and susceptibility in patients with aneurysmal subarachnoid hemorrhage. NeuroImage: Clinical, 16:524–538, 2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [34].McEwen Jason D and Wiaux Yves. A novel sampling theorem on the sphere. IEEE Transactions on Signal Processing, 59(12):5876–5887, 2011. [DOI] [PubMed] [Google Scholar]
- [35].Oostenveld Robert et al. Fieldtrip: open source software for advanced analysis of meg, eeg, and invasive electrophysiological data. Computational intelligence and neuroscience, 2011:1, 2011. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [36].Baillet Sylvain et al. Electromagnetic brain mapping. IEEE Signal processing magazine, 18(6): 14–30, 2001. [Google Scholar]
- [37].McFarland Dennis J et al. Spatial filter selection for eeg-based communication. Electroencephalography and clinical Neurophysiology, 103(3):386–394, 1997. [DOI] [PubMed] [Google Scholar]
- [38].Zhou Pei-bai. Numerical analysis of electromagnetic fields. Springer Science & Business Media, 2012. [Google Scholar]
- [39].Oppenheim Alan V et al. Discrete-time signal processing. New Jersey, Printice Hall Inc, 1989. [Google Scholar]
- [40].Matlab and signal processing toolbox release 2015b, the mathworks, inc., natick, massachusetts, united states. [Google Scholar]
- [41].Hartings Jed A et al. Spreading depolarizations have prolonged direct current shifts and are associated with poor outcome in brain trauma. Brain, 134(5):1529–1540, 2011. [DOI] [PubMed] [Google Scholar]
- [42].Matlab and computer vision system toolbox release 2014b, the math-works, inc., natick, massachusetts, united states. [Google Scholar]