Вы находитесь на странице: 1из 12

Journal of Neuroscience Methods 274 (2016) 1–12

Contents lists available at ScienceDirect

Journal of Neuroscience Methods


journal homepage: www.elsevier.com/locate/jneumeth

Optimizing detection and analysis of slow waves in sleep EEG


Armand Mensen ∗ , Brady Riedner, Giulio Tononi
Center for Sleep and Consciousness, Department of Psychiatry, University of Wisconsin, United States

h i g h l i g h t s

• We introduce an open-source toolbox for individual detection and analysis of slow waves in sleep electroencephalography.
• Novel and previously applied automatic detection algorithms are introduced and explored.
• Individual slow waves are detected in sleep recordings from participants along a large search-space of parameter settings.
• Properties of detected slow waves are compared across parameter settings on a range of outcome measures of interest.
• Visualization options for toolbox users are introduced, including the possibility to manual score sleep.

a r t i c l e i n f o a b s t r a c t

Article history: Background: Analysis of individual slow waves in EEG recording during sleep provides both greater sen-
Received 22 March 2016 sitivity and specificity compared to spectral power measures. However, parameters for detection and
Received in revised form analysis have not been widely explored and validated.
19 September 2016
New method: We present a new, open-source, Matlab based, toolbox for the automatic detection and
Accepted 20 September 2016
analysis of slow waves; with adjustable parameter settings, as well as manual correction and exploration
Available online 20 September 2016
of the results using a multi-faceted visualization tool.
Results: We explore a large search space of parameter settings for slow wave detection and measure
Keywords:
Slow waves
their effects on a selection of outcome parameters. Every choice of parameter setting had some effect on
Automatic detection at least one outcome parameter. In general, the largest effect sizes were found when choosing the EEG
Sleep reference, type of canonical waveform, and amplitude thresholding.
EEG Comparison with existing method: Previously published methods accurately detect large, global waves
Toolbox but are conservative and miss the detection of smaller amplitude, local slow waves. The toolbox has
additional benefits in terms of speed, user-interface, and visualization options to compare and contrast
slow waves.
Conclusions: The exploration of parameter settings in the toolbox highlights the importance of careful
selection of detection
Methods: The sensitivity and specificity of the automated detection can be improved by manually adding
or deleting entire waves and or specific channels using the toolbox visualization functions. The toolbox
standardizes the detection procedure, sets the stage for reliable results and comparisons and is easy to
use without previous programming experience.
© 2016 Elsevier B.V. All rights reserved.

1. Introduction Vyazovskiy et al., 2011; Marzano et al., 2013). Much of the research
into local patterns of sleep has used the measure of ‘slow wave
For much of the 20th century sleep was considered to be a global activity’ (Werth et al., 1997; Huber et al., 2004; Stadelmann et al.,
phenomenon of the brain, and its macro-architecture was of pri- 2013), reflective of the changes in the power spectra in the lower
mary interest (Jones, 2005; Saper et al., 2005; Siegel, 2009). The past frequencies (typically around 1–4 Hz), measured across a whole
few decades has witnessed a shift in interest to the spatial domain night or single cycle of sleep. This measure is, however, under-
and local aspects of sleep (Krueger et al., 2008; Nobili et al., 2011; determined since both slow wave incidence and amplitude will
affect power.
Slow waves can originate in a small region of the cortex and then
propagate to other cortical regions based on both EEG and intracra-
∗ Corresponding author.
nial recordings (Amzica and Steriade, 1998). Therefore, there are,
E-mail address: research.mensen@gmail.com (A. Mensen).

http://dx.doi.org/10.1016/j.jneumeth.2016.09.006
0165-0270/© 2016 Elsevier B.V. All rights reserved.
2 A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12

at least, five distinct ways in which local slow wave activity could as individual channel filtering options for each channel displayed.
increase or decrease (Massimini et al., 2004; Menicucci et al., 2009; Navigation and sleep scoring can be performed using the mouse
Murphy et al., 2009): 1, origins and traveling parameters remain or keyboard keys (e.g. left and right arrows to navigate, number
constant but there are local changes in the amplitudes of the slow keys to indicate sleep stage). Importantly, the data used for scor-
waves as they travel over particular regions of the cortex; 2, there ing can be loaded directly from the original recording and is saved
is an increase in the incidence of local waves which originate in in the same file. This is a useful feature, as the file sizes for long
that particular part of the cortex; 3, slow wave origins remain dis- recordings of high-density channels are typically in the 5–20 Gb
tributed but more waves travel to or through a specific area of range. This feature also reduces the number of copies necessary
the cortex; 4, there are local changes in the speed of propagation while simultaneously maintaining a controlled history of process-
resulting in a frequency shift of power spectra; 5, some particular ing. Similarly, the scoring toolbox uses dynamic memory mapping
combination of the above factors. Notably, if any of the above mech- to load into random-access-memory (RAM) only the part of the
anisms have opposing effects they may cancel out in the power file that is currently displayed (e.g. 8 channels of 30 s duration).
spectra. This feature allows for the scoring of files on a typical computer
Conventional power-based methods are relatively easy to cal- where the amount of RAM memory may be smaller than the dataset
culate as the appropriate tools have already been developed and one needs to score. Since filtering is only applied to the displayed
standardized over time. Thus, results are relatively comparable portion of data, and not the raw data itself, this graphical user inter-
across studies, in turn leading to power spectral measures being face (GUI) is also a good way to visualize raw recordings and mark
used repeatedly in research. Nevertheless, an examination of the artifacts manually, prior to any preprocessing methods. Channel
properties of individual slow waves is now also possible and can montages and filtering options are saved within the file and can
yield an increase in specificity and sensitivity without the asso- be used with other datasets to keep the settings consistent across
ciated cost of having to perform new measurements (Riedner participants or recording nights.
et al., 2007). For example, the analysis of the origin of slow waves
revealed a local increase indicative of post-sleep learning in a visual 2.1.2. Wave detection
perception task (Mascetti et al., 2013). Moreover, slopes of individ- The detection of slow waves, regardless of specific settings, fol-
ual slow waves correlate with neural development (Fattinger et al., lows 4 key stages.
2014), and epileptic spike waves can impair individual slow waves
(Bölsterli Heinzle et al., 2014). The advent of parallel computing 1 Calculation of the canonical wave(s).
and the lower cost of technology has made individual waveform 2 Detection of individual slow waves within the canonical wave(s).
analysis practically feasible. However, the necessary tools for the 3 Detection of corresponding waves within the actual channels.
detection of individual slow waves, and the subsequent calcula- 4 Examination of each wave for its traveling streams and its prop-
tion of their traveling parameters have not yet been made freely erties.
available, standardized, or validated. Moreover, tools have not been
made sufficiently simple or generalized so that researchers and There are two conceptually distinct approaches available for the
clinicians can easily explore their own data and have confidence calculation of the canonical wave: either the mean activity over
in the results while also comparing them against set standards. a specified region; or the negative envelope of the channels. The
Here we describe an open source toolbox with the principal simplest canonical wave can be created by calculating the mean
purpose of providing a reliable interface to detect and analyze activity over a single circular region of the electrode array, defin-
individual slow waves found in EEG sleep recordings. The tool- ing its center and radius. Alternatively, multiple canonical waves
box is version-controlled using git and freely available at https:// can be computed by taking the mean activity of distinct regions.
github.com/Mensen/swa-matlab. The main goal of the current arti- Regions can be specified over the mid-line, leading to a frontal,
cle is to introduce the main features of the toolbox for slow-wave central and posterior canonical time series. Another option is to
detection. Secondly, we use several full-night sleep recordings to calculate the mean activity of four regions equidistant around the
examine how a large search-space of different parameter settings center, as was done in the original slow wave detection algorithm
influence the detection and properties of slow waves. While this is (Massimini et al., 2004). These four regions can be arranged as a
not intended to be an extensive overview of how to most accurately square (left/right; frontal/posterior), or as a diamond (single frontal
detect slow waves, it is meant to showcase the toolbox’s functional- and posterior regions; left and right central region). Users may also
ity, typical work-flow, and visualization capabilities while making directly specify their own canonical wave.
the user aware of the strengths and weaknesses of various settings One issue with regional methods is that local waves outside the
and what aspects to consider when analyzing recordings of their specified region will not be represented in the canonical wave and
own. therefore have no chance of being detected. Thus, only waves that
pass through a substantial portion of at least one of the regions can
be detected – a source of bias that may underestimate the amount
2. Materials and methods of locality in sleep. Conversely, if a single region is too large, then
the mean activity within the region may no longer be represen-
2.1. Toolbox overview tative and waves could be missed (see Supplementary Fig. 1 for
comparison of regional methods). Secondly, such a method does not
2.1.1. Sleep scoring scale well to more sparsely recorded arrays where those predefined
Given that different types of waves in sleep occur during differ- regions may only contain a few channels.
ent periods, detection can be improved by parsing the night into its A solution is to calculate the negative envelope of all chan-
various sleep stages. To this end a user-friendly interface was cre- nels. This is akin to examining the butterfly plot (overlaying all
ated for the manual visual scoring of sleep stages and arousal events channels) and tracing the negative contour. Here, we calculate
of high-density EEG channels. This has previously been available the mean activity of the most negative 2.5% of channels at each
primarily through proprietary software in certified sleep centers sample independently in the time series. The advantage is that
and only once specified channels from the high-density caps had the most negative portion can potentially come from any channel
been exported. This set of toolbox functions allows for the on-line in the dataset and is not restricted to a particular region. Fur-
adjustment of displayed channels and specified references, as well thermore, a single canonical wave is representative of the entire
A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12 3

Fig. 1. Typical steps in the detection and analysis of slow waves.


A, the current default canonical wave is the negative envelope of all channels. This wave is the mean of the bottom 2.5% of channels at each sample independently such that
a slow wave could come from anywhere in the dataset. B, examining the canonical wave can take several parameters to explore the properties of either each downward
zero-crossing or local minima, to check that the potential wave matches set criteria for amplitude, wavelength, or slope. C, once slow waves have been detected in the
canonical wave, we can examine the cross-correlation to not only find which waves also show a slow wave (high positive correlation with the canonical), but at what
sampling delay they best fit giving an estimate of the channel origins of the wave and its propagation pattern. D, using a delay map created by interpolating the delay values
onto the scalp, we can find optimal trajectory paths through this gradient in terms of maximum displacement and distance traveled as well as any stream with a notably
distinct angle of travel.

dataset. Thus, the full detection criteria only has to be run on independently and potential waves are examined for whether a
a single time series. Despite these advantages over the regional slow wave was already found within the wavelength of another
approach, there are also 3 limitations: the waveform may be dis- canonical wave.
torted because different waves contribute to its shape such that it By this stage the user has determined the number of unique slow
may not closely correspond to any particular channel; the positive waves in the dataset which meet specific criteria, and the goal is
portion of the wave is eliminated from the canonical wave, leading now to find the corresponding channels and their properties. There
to meaningless peak-to-peak information; and the negative enve- are two available channel detection methods. The same set of initial
lope has rare zero-crossings for further calculation and so must criteria can be applied to individual channels as was applied to the
be high-pass filtered or detrended to bring the mean activity to canonical wave; with the option to adjust all the criteria by a certain
zero, thereby consistently, yet somewhat unpredictably, reducing ratio (default: 90%). In this way, one could use a strict set of crite-
the amplitudes of the waves it intends to represent. ria on the canonical wave (to minimize false positives), but then a
Once the canonical wave channel has been created, the goal more relaxed set of criteria at the channel level (to maximize sen-
is to use a set of parameters to automatically detect potential sitivity). Alternatively, the user has the option to cross-correlate
slow waves. The toolbox has a wide range of parameters that the canonical wave with the individual channels over a specified
can be adjusted, including those used in previous research (Mölle time window, looking for channels that correlate positively with
et al., 2002; Massimini et al., 2004). For example, the points just the negative portion of the canonical wave. The correlation
between downward zero-crossings and the subsequent positive method has important advantages. It is amplitude independent, so
zero-crossing can be seen as a potential slow wave. However, slow any channel that shows the same pattern as the detected slow wave
drifts in the EEG as well as the use of the negative envelope method in the canonical channel will be accepted as a match. Secondly,
may lead to waves not having reliable zero-crossings. An alterna- the temporal delay of the wave at each channel is already calcu-
tive is to examine the local minima of the canonical wave and use lated while searching for the maximum correlation across different
these as initial points to inspect further wave properties. This elim- delays (illustrated in Fig. 1). The original method calculates the
inates the importance of the zero-crossing portion of the waves delay separately according to the time point of the minimum peak
altogether as the nearest local maxima are then seen as the start for each channel. Using correlation, the entire waveform is consid-
and end points of that particular wave. The choice between zero- ered for the delay, not just the peak, and is thus robust to noise.
crossings or local minima/maxima is referred to as the inspection The limitation with the correlation approach is that if the nega-
point. tive envelope was used as the canonical wave, this wave may not
Individual waves must also pass a crucial minimum ampli- correlate well with any particular channel. This limitation is over-
tude threshold. One may specify the absolute minimal amplitude come by also cross-correlating channels with the channel showing
directly in microvolts (default: 80 ␮V). However, several factors the largest negative peak. Finally, a cluster test can be performed
will influence the overall amplitudes of the EEG, such as the chan- on the active channel topography to ensure that all the channels
nel montage, filtering parameters, as well as physiological variables are connected to one another through some neighboring channels;
such as scalp thickness and age (Buchmann et al., 2011; Wilhelm this eliminates island channels which are likely to be artifacts. For
et al., 2014). Therefore, the toolbox also implements a data-driven, either the correlation or threshold channel detection method, if no
dynamic threshold based on the calculation of the median ampli- corresponding channels are found, this individual wave is removed
tude and standard deviation of all the local minima in the canonical from the final output.
wave. With this option, the user specifies the number of stan- To calculate the traveling properties of individual waves, an
dard deviations from the median (default: 5 standard deviations). interpolated delay map over the scalp is created using the individ-
The minimum and maximum wavelength should be specified for ual delays across ‘active’ channels. Each channels’ coordinates are
the canonical wave (default: 250 ms–1250 ms). Depending on the used as a seed to examine the optimal stream lines to and from the
inspection point, wavelength is either defined by the point of down- channel; thus calculating all potential streamlines for the traveling
ward to subsequent upward zero crossing, or as the time between wave. The streamline calculation algorithm works much like plac-
consecutive local maxima. Finally, the potential wave must pass ing a leaf into a wind tunnel and recording its trajectory. At each
a peak-to-peak criterion from the negative to positive peak of the consecutive point of the interpolated delay map, the next point in
wave (default: 140 ␮V; not applied to negative envelope canoni- the stream is determined by following the gradient of the map until
cal waves). For multiple regions, each wave is initially examined a stopping condition is met. There are three conditions for stopping
4 A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12

Fig. 2. Example of the sleep-wave-analysis (swa) explorer window.


Researchers can load the result file after successful detection to freely explore results and make manual adjustments to either the individual waves, by adding or removing
channels (in the central left panel), or adding or deleting entire waves. Any two channels used in the analysis can be viewed in the top panel along with the butterfly plot
of all channels or the canonical wave. The bottom left two panels show summary measures of the entire recording that one can choose using the drop-down menus. On
the right is the amplitude or delay topography of the current slow wave displayed. In the figure the involvement topography is shown with yellow to blue indicative of the
smallest to largest wave amplitudes. The semi-transparent streamlines indicate the longest displacement, the longest distance traveled, and the stream of highest angular
deviation from the first stream. All plots can be exported to their own figure for editing or printing for publication purposes.

the streamline search: the first is that the gradient at the next point ‘butterfly’ arrangement with inactive channels in dashed, lighter
does not exist, indicating that no slow wave was found at the near- gray color. Clicking on a channel allows the user to manually acti-
est channel to that point; second that the change in gradient angle is vate or deactivate any particular channel in case the automatic
greater than 90◦ , indicative of counteracting gradients; and finally detection has missed a channel or was subject to a false positive.
if the gradient at the next coordinate is zero, corresponding to a stop The user can also zoom into any aspect of the wave and re-calculate
of the traveling aspect of the wave. Although streamlines for each its traveling parameters, in the case that active channels have been
active channel are calculated, only a subset of 3 are saved as output: changed. In the bottom left of the window there are two smaller
the longest displacement (the distance between the start and end plots which can display any outcome measure currently available.
points of the wave); the longest distance traveled (the cumulative All summary measures are selected using a drop-down menu. Addi-
sum of all coordinates of the line); and the stream of most angular tional wave summary measures are consistently being added but
deviation from the longest displacement, assuming that stream has currently include: histogram plots of the distribution of global-
a different overall trajectory of at least 45◦ . ity measures, scatter plots comparing amplitude and wavelength,
angular maps of travel direction, as well as EEG topographies of
wave density, amplitude, stream origins, and wave origins. On the
2.1.3. Visualization
right of the explorer window is a large topography map showing
Clear and interpretable visualization of the results is of utmost
either the delay map (time to channel peak), or the intensity map
importance in the toolbox. An overview of the swa Explorer tool
(amplitude of the negative peak) of the currently selected wave.
is given in Fig. 2. This GUI is organized into a single window with
Below the topography are several options to change the look of
four sections. At the top there is a time series plot of the EEG sig-
the map such as whether to display the channel locations or trav-
nal as it was initially loaded. The user is able to select any two
eling streams. Nearly all the plots can be exported to their own
individual channels from the dataset, a ‘butterfly’ view, or the
figure using the ‘+’ button, making it easy to create presentation or
waves canonical channel. This panel can be used to quickly nav-
publication ready figures; as was done in the current article.
igate through the dataset and missed waves can simply be added
by clicking on the axes near the wave. Manual addition of a wave
in this way will bypass the initial criteria for wave selection, cal- 2.1.4. Implementation
culate the necessary parameters on the canonical wave and then The toolbox is currently implemented as semi-independent
pass this information onto the channel detection and traveling algo- scripts and functions in Matlab (The MathWorks, Inc., Natick,
rithms. In the left central portion, the ‘butterfly’ plot of the active Massachusetts, United States), with minor functions implemented
channels of each individual wave can be seen in a narrower time using C for computation speed. The GUI aspects of the toolbox also
window. The canonical wave is also displayed to allow for compari- include portions of JavaTM coding to circumvent certain limitations
son to the rest of the active channels. This section can be expanded inherent to Matlab when it comes to visualization of data. Each
by using the ’+’ symbol at the corner of the plot which opens up function in the toolbox is given the prefix ‘swa’, with a keyword
the channel editing mode. This mode shows all the channels in a to the file’s function (e.g. ‘swa SleepScoring’). In principle; all that
A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12 5

is required to get started with wave detection is the time series; the channel with the closest neighbors until the desired number of
knowledge of the sampling rate; and the electrode locations file. remaining channels was achieved.
However; since several options already exist for importing and
preprocessing EEG data from various sources; we have taken the 2.2.2. Analysis
file and variable structure of the popular analysis toolbox EEGLAB In order to examine how the various parameter settings affect
(Delorme and Makeig, 2004) as the basis for our own scripts. It the detection of slow waves, we ran fully automatic detection on a
should be noted however that EEGLAB is not required for the tool- large set of possible parameter combinations. The parameter set-
box to function. Several template scripts are available in the toolbox tings tested are outlined in Fig. 3, where the main line reflects the
directory to help users get started with scoring sleep stages; export- current default value for each parameter in the toolbox, and the
ing stages; preprocessing; or wave detection. Currently; going sub-values tested for that particular parameter are indicated by
from an empty Matlab environment; loading the data; loading the the curved paths below. While the EEG montage reference is not
default detection parameters; running all the separate detection technically a detection parameter, it has a significant impact on
steps; and saving the results can be completed automatically within the waveforms. Average mastoid reference has been the general
minutes. The efficient algorithms employed allow the user to exper- choice for slow-wave detection likely due to it being standard prac-
iment with optimal detection parameters for the study’s particular tice for sleep scoring in clinical settings (Iber et al., 2007); given its
purpose. Moreover; a batch processing script is available such that relative electric neutrality. However, electrodes near the reference
an entire dataset can be analyzed using the same set of parameters; have reduced amplitude activity because shared activity between
without interruption. them is eliminated. Given the mastoid’s posterior-temporal loca-
The output of the detection process is a single Matlab file which tion, this implies that, even in randomly generated activity, frontal
includes three structure arrays with fixed names Data, Info and SW. electrodes (those furthest from the reference) will have increased
Depending on the options used when saving the results, Data, may amplitudes. This frontal bias for average-mastoid reference may be
contain the original EEG data, or simply a pointer to the binary mitigated by using the average-reference; generally recommended
file that was used in the calculation; so that multiple copies of the for high-density EEG recordings (Pascual-Marqui and Lehmann,
same data need not exist given the typically large file sizes of night 1993). However, as will be discussed later, average referencing
recordings. Data also contains the canonical wave(s), calculated in can invert the polarity at electrode locations where the wave is
the first stage of the detection, and may also keep the sleep staging smaller than the average, making tracking the negative envelope
information. Info has various subfields holding general information more difficult in the case of large, potentially global slow waves.
about the data that was loaded, its electrode positions, and all the It should be noted that, for statistical analysis, the number of
parameters used for wave detection. Finally, SW, has information channels analyzed is expressed using the log2 value, such that a
on detected wave properties. Subfields of the structure contain: unit increase implies twice as many channels analyzed. Another
wave timing; canonical amplitudes; channels involved; and coor- important point is that the low and high cut-off for range param-
dinates of the traveling streams. This file can then be loaded into eters, filter and wavelength, were manipulated together but only
the swa Explorer function to visualize each wave, create summary the lower bound value was entered into the model (e.g. 0.5–4 Hz
measures and plot them, manually edit the channels involved, or was indicated as 0.5; and 1–3 Hz indicated as 1). This has the conse-
manually add missed waves or eliminate false positives. quence that a single jump in the value of these parameters generally
implies a square law, not a linear one, and that the primary driver
of any effect, that is whether it was the low or high end of the range
that drove the effect, is left unspecified. All main effects, that is
2.2. Parameter evaluation direct deviations from the default parameters while maintaining
other settings constant, were tested along with a smaller subset
2.2.1. Data and preprocessing of second order combinations of parameters of interest. Lastly, the
Whole night sleep data was taken for 11 healthy controls. All specific configuration of parameters used in the original detection
participants were right-handed males, between the ages of 25–35 of slow waves as traveling waves, along with some variants on the
with no history of mental illness or sleep-related problems. A 257 amplitude threshold were also tested (Massimini et al., 2004). In
channel electrode net was used for all recordings (EGI; Tucker, total, automatic detection for 48 different parameter combinations
1993), initially referenced to the central electrode (Cz) and recorded were run.
at 1000 Hz sampling rate. Using EEGLAB, recordings were down- Of the possible outcome measures, 9 representative summary
sampled to 200 Hz. The data was then scored into sleep stages and measures of interest were chosen as dependent variables: wave
artifacts were marked using the swa SleepScoring function accord- density, measured as detected slow waves per minute; canoni-
ing to the current standards (Iber et al., 2007). Only stages scored cal wavelength mean and standard deviation; wave amplitude, the
as N3 were exported for further processing steps; not including median over all waves (amplitude distributions tend to be highly
the segments manually marked as artifacts. The remaining data skewed), and deviation; mean wave globality and its deviation, mea-
was then bandpass filtered between 0.3 and 30 Hz. Channels with sured as the percentage of channels which were involved in the
excessive artifacts were then manually removed from the dataset. wave; anterior-posterior traveling preference with positive values
At this point, two versions of the data were created: one version indicating more back-to-front streams; and finally the angular devi-
that underwent independent component analysis (ICA), and sub- ation of all the streamlines calculated. Topographic density maps
sequent removal of noise-related components; and another version were also compared across a selection of settings. Density was
without the ICA steps. Finally, the removed channels were reintro- defined as the number of waves found at each channel, independent
duced using spline interpolation (Perrin et al., 1987). Data was then of its amplitude.
either re-referenced to the average reference (the mean activity of For parameter settings found to significantly affect the wave
all channels for each sample), or average-mastoid (mean activity incidence, we further examined waves that were uniquely found in
of electrodes over the left and right mastoids). The resulting data one method and not the other. We also examined wave properties
structure was then loaded into the toolbox for analysis of individ- for the commonly found waves between methods. Common waves
ual slow waves. To examine the effect of the number of channels defined as those with negative peaks within 100 ms. This compar-
used in the analysis, the individual electrode arrays were spatially ison can be done using the toolbox function swa compareOutput,
down-sampled using an iterative process of continually removing and provides an overview of the parameter changes and outcome
6 A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12

Fig. 3. Typical work-flow and parameters.


Several choices in the preprocessing of EEG recording during sleep have significant impacts on the automatic detection algorithm. Here we explored the effects of whether
the data had been subjected to an ICA artefact removal, the choice of EEG reference with which to compare all channels, the number of channels actually recorded and the
data filtering bandpass window. Detection of individual slow waves is heavily dependent on the range of parameter settings used in the canonical waveform. Once slow
waves have been detected in the canonical wave there are more significant parameter choices to move from waves in the canonical to individual channel detection. After
completed detection across the night we can extract certain summary statistics of interest such as the mean globality (percentage of channels involved in each wave), or the
topographic density of all slow waves in the recording (number of waves detected at each channel).

measures for the unique and shared waves between any two result tion value between the channel and the canonical wave, or the
files. These are crucial comparisons because if the method affects adjustment ratio of the original thresholds by which to measure the
both the number of waves and some other outcome parameter, one individual channels. The default covariance structure of ’variance
cannot be sure that the differences can be attributed to waves that components’ was used, although others were tested and compared
are uniquely detected by the method, or whether properties of the using the Bayesian Information Criteria (BIC) but were not found to
same waves are altered by the parameter settings. This concern be significant improvements in modeling the data. Each outcome
does not apply to all parameter changes, such as amplitude thresh- measure was modeled with a main effect factor for each parame-
old, where differences are directly due to the unique waves found ter change, along with 4 selected 2-way interactions of the binary
for lower thresholds, since all common waves are guaranteed to parameter settings: EEG reference with canonical method; canoni-
have identical properties. cal method with inspection point; canonical method with detection
Data were analyzed using a linear mixed model approach using method; and EEG reference with amplitude criteria. Search window
SPSS version 22 (IBM Corp., Version 22.0. Armonk, NY, USA). All was left out of the model in the case of wave density, amplitude and
parameter settings and their interactions were treated as fixed wavelength outcome measures, since it had essentially no effect
factors (given that they were directly specified) and the interac- on the outcome measures, had therefore zero variance, causing
tion of all parameters was given as the repeated measure. The convergence errors or non-positive Hessian matrices.
amplitude threshold parameter was nested within the amplitude Topographies were statistically compared using mass-
criteria since the meaning of each is directly dependent on whether univariate statistics for each channel independently. Multiple
amplitude was chosen according to the deviation from the mean comparisons were handled using threshold-free cluster-
or an absolute value. In the same way, the channel correlation enhancement (TFCE), followed by non-parametric maximum
threshold was nested within detection method as the thresholding permutation statistics (Mensen and Khatami, 2013, 2015). Briefly,
value could either correspond to a minimum Pearson’s correla- each channel statistic is individually examined for support from
A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12 7

Fig. 4. Parameter changes and their significant impact on outcome measures.


Both the left and right column indicate parameter settings which were adjusted to explore their effect on several outcome measures of interest (the center column). Dashed
lines indicate that the factor had a significant effect only in interaction with a second parameter of interest. Grey scale of the lines themselves are only to add in visualization
and have no significance.

its neighboring channels, such that the statistic is enhanced if absolute threshold by 10 ␮V, we would expect to find another 1.7
neighboring channels show a similar pattern of differences. These waves per minute, or a mean of about 200 slow waves per night.
enhanced statistics are then subjected to a single permutation test Adjusting the wavelength range by only 100 ms, for example from
whereby the allocation of each dataset to each parameter setting 0.25–1 s to 0.35–0.9 s, we expect to find similar differences as those
is randomized 5000 times. This creates a single empirical null of amplitude changes of over 3 fewer waves per minute.
distribution to which each channel is compared to find its indi- Crucially, whether one chooses to use average reference or aver-
vidual p-value (corresponding to the percentage of randomized age mastoids had significant interactions with both the canonical
permutations which show a larger maximum statistic). wave method measure and also whether one chooses to use abso-
lute or relative amplitude thresholds. If the user chooses to use
the negative envelope canonical wave method, there is essentially
3. Results
no difference in wave density between average and average mas-
toid EEG references (mean difference = 0.2, sd = 0.7), however if
Fig. 4 depicts which parameter settings had a significant impact
four regions are used to create the canonical waves, the choice
on which outcome measure. Model parameter estimates and their
of EEG reference is crucial (mean difference = 6.9, se = 1.1), with
standard error are described in supplementary Tables 1 and 2.
average reference leading to a significant reduction in the wave
Parameter estimates indicate how large an effect a change to the
density (F1,81 = 40.90, p <0.001). Additionally, only when using
parameter value has on a given outcome measure. For example, if
the four regions reference does the choice of channel detec-
the relative amplitude criterion is raised by 1, the wave density of
tion method, either correlation or threshold, make a significant
the subsequent output is expected to decrease by 2.98 waves/min.
difference (F1,87 = 12.66, p = 0.001). Here, finding corresponding
It is also crucial to consider the scale of each parameter when exam-
channels using a thresholding approach leads to more waves being
ining its estimate. For example, amplitude thresholds for relative
rejected at this stage compared to the correlation method (mean
criteria reflect the number of standard deviations from the mean,
difference = 3.2, se = 0.9). In contrast, it is only the negative enve-
hence a unit of change may correspond to several tens of micro-
lope method that is significantly affected by the choice of wave
volts, yet for absolute threshold criteria the units are in microvolts
inspection point (F1,81 = 40.60, p < 0.001). Using peak detection
directly. Therefore the estimates between these parameters will
as opposed to zero crossing measures yielded significantly more
vary drastically even when their standardized effects would be sim-
waves (mean difference = 2.8, se = 0.6). Lastly, wave density was
ilar. While each outcome measure is examined in detail individually
significantly affected by the choice of EEG reference when abso-
below, the supplementary tables can be used a quick reference
lute as opposed to relative criteria where used to define the cut-off
when wishing to explore parameter settings for given outcomes.
amplitude thresholds (F1,97 = 15.69, p <0.001). When using aver-
For example, if the primary research question involved the ampli-
age mastoid reference, absolute thresholding detected, on average,
tude of detected slow waves, it is irrelevant whether the user selects
6.335 (se = 1.6) more waves per minute, whereas the value for the
to detect waves based on the zero-crossing or negative peak meth-
relative thresholding was similar to the average reference values.
ods; by contrast, this distinction is crucial when comparing wave
A direct comparison between the default values of the toolbox
density.
and the criteria used by Massimini et al. (2004) revealed highly
significant differences between the two methods (F1,12 = 64.29,
3.1. Wave density p <0.001), whereby the default settings tended to detect a mean
of 15.9 waves/min (se = 1.7), and the original criteria yielded only
Wave density is measured by waves per minute and was calcu- 2.3 waves/min (se = 0.6).
lated by dividing total number of waves detected by the number
of minutes spent in N3. Overall, recordings had a mean of 12.1
waves/min (se = 0.62). As Fig. 4 indicates, nearly all the parame- 3.2. Wave amplitude
ters had a significant influence on the number of waves detected
in each participant; all but the specific channel detection thresh- Wave amplitude indicates the amplitude value in microvolts
old and the number of channels. The most influential parameters at the strongest negative peak among all the individual chan-
affecting the total number of waves found were the amplitude nels found to be part of the wave. Overall, the mean maximum
thresholds for both relative and absolute values, wavelength and amplitude was found to be 103.3 ␮V (se = 9.1) across all partic-
the EEG reference. Changing the amplitude threshold by a single ipants. Significant main effects were found for artifact removal,
deviation results in a mean increase in wave density of approxi- canonical method, amplitude threshold, and the number of chan-
mately 3 waves per minute, which when we consider a mean time nels. For the canonical method parameter, there was an expected
of 120 min spent in N3 during the night indicates we would have increase in median amplitude of 15.6 ␮V (se = 6.5), when the four
an additional 360 waves per recording. Similarly, if we lowered our region method is compared to the negative envelope. Only a
8 A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12

single interaction was found between EEG reference and the type (mean difference = 18.7%, se = 0.5). Yet the correlation approach is
of amplitude criteria used (F1,65 = 6.68, p = 0.012). Not surprisingly, more sensitive to changes in correlation threshold compared to the
using an absolute threshold resulted in non-significant differences adjustment in absolute thresholding, where changes of 0.1 in the
in amplitude between average and mastoid references (F1,80 = 0.54, threshold had expected changes of 8.5% and only 2.8% respectively.
p = 0.464), however, if a relative threshold was used the mastoid ref- Of the two significant interactions; EEG reference with canon-
erences waves were significantly larger by a mean value of 24.5 ␮V ical method (F1,69 = 342.89, p < 0.001), and canonical method with
(se = 11.0, F1,79 = 4.92, p = 0.029). channel detection method (F1,39 = 24.59, p < 0.001), the former is
Does changing the EEG reference result in different waves being the most telling. When using the regional method there is a sig-
detected (ones with different amplitude), or are the same waves nificant but relatively small effect for higher globality when using
found but the change in reference changes the maximum negative average referenced data compared to average mastoids (mean dif-
channel? To explore this issue we examined the unique and shared ference = 3.2%, se = 1.4). The opposite is the case for the default
waves detected between both methods in a single, representative envelope method where mastoid referenced data shows a signifi-
participant. Using a relative threshold of 5 standard deviations for cantly higher proportion of channels in each wave in comparison
both methods resulted in effective thresholds of 45 ␮V for average to average reference (mean difference = 27.4%, se = 0.7). This differ-
reference compared to 85 ␮V for average mastoids. The compar- ence was further explored by comparing the unique and shared
ison of unique and shared waves found that of the fewer waves waves in a single recording. 1317 waves were found in the average
found using the mastoids reference (1491–953 respectively), 14% referenced data, compared to just 870 waves using the mastoid ref-
were unique to the method, as opposed to 40% unique waves for erence with 744 waves common to each method (85.5% of mastoid
the average reference. Despite the different waves found for each waves). In this example, both unique and shared waves showed
method, both unique and shared waves showed a consistent larger similar differences in the globality measure (31.4% and 32.2% dif-
negative amplitude for mastoid reference (amplitude difference of ferences respectively). Thus, the large difference in globality found
41.4 ␮V and 32.1 ␮V respectively). Thus, the differences in ampli- is a general property of different wave forms created by the choice
tudes found for the interaction can largely be attributed to the of reference (illustrated in Fig. 5 for shared comparison, and Fig. 6
generally higher EEG amplitudes found using the mastoid refer- in the topographic density).
ence. Individual participant’s level of globality deviated by a mean
The direct comparison between amplitudes for the default of 11.7% (se = 0.4), yet this variability was significantly affected
values used in the toolbox and the original criteria was found by a host of parameter settings. Notably, this was the only out-
to be significant (F1,20 = 43.24, p <0.001). Default settings had a come measure where the search window parameter has a significant
mean maximum channel amplitude of −86 ␮V (se = 10), opposed impact. Changing the amount of time allowed for corresponding
to −177 ␮V (se = 9), for the original detection criteria. Given the channels to reach criteria values of 100 ms changes deviation by
large discrepancy found for wave density between the methods, 2.6% (se = 0.4). All the specified second-order interactions also had a
we explored the differences in unique and shared waves for a sin- significant effect. The most informative interaction was the interac-
gle participant where for the default settings 1319 waves were tion between the EEG reference and type of canonical wave chosen
detected but only 672 waves for the original criteria. Of the 672 (F1,90 = 31.72, p < 0.001). For both EEG references, there was a sig-
waves, 193 of them were unique to the original detection criteria nificant different between canonical methods, however for average
(28.7%), yet the difference in amplitudes between the two meth- reference the variability in globality increases using the negative
ods was identical for unique waves (43.6 ␮V) and shared waves envelope method compared to the regional method (mean differ-
(43.3 ␮V). The individual standard deviation of amplitudes was ence = 1.5%, se = 0.2), whereas when using mastoid referenced data
fairly stable across parameter settings yet had a relatively large the opposite was true (mean difference = −2.7%, se = 0.7).
grand mean of 75.8 ␮V (se = 12.9) across all participants. Thus the
original criteria was both selective for larger waves in general, but
the common waves were also of higher amplitude (mostly due to 3.4. Travel angle
the average mastoid reference).
Only two parameters showed significant effects on ampli- Directional statistics such as the primary angle of slow wave
tude deviation; canonical method (F1,79 = 3.99, p = 0.049) and the travel cannot be compared in the same way as linear statistics. This
number of channels (F1,27 = 4.39, p = 0.046). The negative enve- is clear when taking the example that the angle 355 ◦ is much closer
lope method resulted in more consistent amplitudes by a mean to 0 than 40 ◦ for example, and that the mean of angle 355 and 5 is
of 20.2 ␮V (se = 10.1), compared to the regional reference. It is 0, not 180. To resolve this problem we decomposed the angle into
worth noting that the mean amplitude deviation was also sub- its directional components, and examined whether the anterior to
stantially lower when the data had been preprocessed using ICA posterior preference in direction previously reported was affected
(mean = 54.4 ␮V, se = 6.3) compared to without (mean = 97.2 ␮V, by any of the parameters (Massimini et al., 2004; Menicucci et al.,
se = 23.4); and that the difference was likely to only be at trend 2009; Murphy et al., 2009). Only the choice of EEG reference had
levels due to the high variability between subjects using standard a significant effect on the anterior-posterior direction of travel for
preprocessing (F1,15 = 3.72, p = 0.078). the longest streamlines (F1,79 = 5.377, p = 0.023). For the mastoid
reference, the mean slow wave travels from the anterior to the
posterior on the scalp (mean y-component = −0.153, se = 0.179).
3.3. Wave globality On the other hand, if the data is average referenced, we found
that the mean direction is reversed and waves tended to travel
Globality had a mean of 32.6% (se = 0.7) across all parameter set- in the posterior-to-anterior direction (mean y-component = 0.166,
tings, indicating that about a third of channels were involved in se = 0.131). However, neither of these two directional preferences
each wave. Most parameter changes resulted in significant differ- for mastoid or average reference was significantly different from
ences to the globality measure. Key parameters were the choice zero (t10 = −0.856, p = 0.393; t10 = 1.269, p = 0.207 respectively).
of EEG reference, the canonical method, as well as the channel While angular deviation is derived using angular statistics, it
detection method and its corresponding threshold setting. Using is a linear statistic and as such is subject to the same model
the cross-correlation method to detect slow waves in individ- used to assess previous outcome measures. Overall, there was a
ual channels generally resulted in significantly higher globality high amount of deviation in the primary directions of the trav-
A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12 9

A.
300 90
60
90
60
120 60 120 60

40 150 40

150 30 150 30
200 20 20

100
180 0 180 0

100
50
210 330 210 330

0 20 40 60 80 100 240 300 0 20 40 60 80 100 240 300


270 270

B.

80 100
60

50
40
20
0
0
−20 −50

-40
−60
-100

-80 −150

−100

-120 -200
-400 0 400 -400 0 400

150
100

100 50

50
0
−50

0
-100
−50

−150

-100
-200
−150
−250

-200 -300
-400 0 400 -400 0 400

Fig. 5. The effect of EEG reference on slow wave detection.


Exploration of parameter settings revealed that one of the most influential choices is the EEG reference used. In this analysis we examined the average reference (most often
used in general EEG research), and the average mastoid (typical in sleep research for scoring and visualization) for a single participant keeping all other parameters constant.
A, two summary measures of all detected slow waves in the example participant. Globality indicates the percentage of channels recorded where a slow wave was found.
Angle map shows the primary angle of travel for the longest displacement stream; where in the mastoid reference there is a tendency to travel from anterior to posterior,
the opposite is found for average reference. B, examples of the same wave found for each reference choice for a wave early in the recording, and another late in the recording.
While the waves have common ‘hot-spots’ of highest amplitude waves in the topography, the butterfly plot of the waves can look quite different as the average reference
finds positive going waveforms in approximately half the channels.

eling slow waves (mean = 77.1◦ , se = 0.7). Only two changes to 3.5. Topographic density
parameter settings had a significant, albeit fairly minor, effect on
this deviation. Angle deviation was slightly higher when using We examined topographical differences resulting from the
the negative envelope method compared to the four regions interaction of changing the EEG reference and the canonical wave
method (mean difference = 1.8, se = 0.91). Moreover, increasing the method. The TFCEANOVA analysis revealed significant main effects
amplitude threshold likewise increased the angular deviation by for both factors and a significant interaction between the fac-
0.6 ◦ (se = 0.23) for the relative amplitude threshold and by 0.8 ◦ tors (see Fig. 6). The percentage measure indicated how often
(se = 0.17) for every 10 ␮V increase in absolute threshold. This the channel was part of the detected slow wave. The main effect
increase is likely due to decrease in the number of waves found of changing EEG reference was present at all 256 channels and
from which the deviation is estimated, and not actual deviations in peaked around central-posterior channels and lateralfrontal chan-
the angles when using higher thresholds. nels (peak channel E223; F1 = 654.70, p < 0.001). Channels in the
10 A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12

Fig. 6. Topographic density, the effect of EEG reference and canonical waveform.
Density is defined at the percentage of the total number of waves found in each channel. As expected from previous research, the frontal-central region showed the highest
density of slow waves over all parameter settings (four topographies in the top left). Topographies are also shown for the mean difference between each of the factors
and the interaction. Significant channels are marked using a white dot. Given that the incidence in the frontal region is the same across references, this implies that the
average-mastoid reference found significantly more global waves compared to the average reference (see text Section 3.3), which was particularly apparent in central and
posterior regions (top right). The choice of canonical reference, either negative envelope or four regions resulted in significantly higher proportion of waves in highly frontal
regions and central-posterior regions. The two parameters interacted to have differential effects most prominent in the central region and also in highly posterior channels.

mastoid referenced data set had a higher percentage of active chan- proportion of active channels for mastoid referenced data (mean
nels with a mean of 26.9% (se = 3.3). The main effect of canonical difference = 4.9%, se = 0.6), while for averaged reference data there
method had significant effects over two clusters of channels: one was no significant difference.
broad frontal (107 total channels; peak channel E37; F1 = 186.56,
p <0.001); and the other central-posterior (55 total channels; peak
channel E100; F1 = 52.53, p = 0.002). In the frontal cluster, the four 4. Discussion
regions method showed a greater proportion of active channels
(mean difference = 5.3%, se = 0.6). However, in the posterior cluster, The analysis of EEG spectral power density has proven
it was the negative envelope method that had a significantly higher immensely useful in both basic and clinical sleep research. Spectral
proportion of active channels (mean difference = 3.1%, se = 0.3). power analysis is beginning to be complemented by the assessment
For the interaction effect, 3 distinct clusters of channels were of the individual underlying waveforms, leading to further progress
found in the frontal, central and posterior regions. The frontal inter- in the field. An important requirement is therefore the ability
action (15 total channels; peak channel E24; F1 = 24.96, p = 0.02), to compare methods and results between studies and research
showed the same main effects described above (higher density for groups. The SWA-toolbox primarily aims to provide researchers
mastoid and regional canonical waves), except that the differences and clinicians with the tools for the detection and analysis of
between canonical methods was not as pronounced when using the the individual waves found during sleep, and standardizes these
mastoid reference (mean difference = 3.9%, se = 0.5), as when using methods such that they can be reliably reproduced and shared.
the average reference (mean difference = 7.5%, se = 0.9); likely due Understanding the variability of sleep slow waves, and realizing
to a ceiling effect of mastoid referenced data. The central interaction that detection methods and parameters have significant effects on
cluster (35 total channels; peak channel E89; F1 = 93.35, p <0.001) outcome measures is essential. The toolbox offers great flexibility of
showed a dissociation of effects with the regional method showing parameters to reproduce results obtained in previous studies using
a higher wave proportion than negative envelope for mastoid ref- different methods, and to explore the consequences of different
erenced data (mean difference = 2.1%, se = 1.0), but the reverse for parameter choices.
average referenced data (mean difference = 4.9%, se = 0.9). Finally, Exploiting the flexibility of parameter settings lead to two sur-
the posterior channels also showed a dissociative interaction effect prising results. First, the number of channels used in the detection
(38 total channels; peak channel E165; F1 = 59.49, p <0.001). In pos- and analysis did not have a significant impact on several major
terior channels, the negative envelope method showed a higher outcome measures, including the total number of detected waves.
Moreover, even when the number of channels had a statistically
A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12 11

significant effect, the effect size was relatively low (e.g. the mean procedure would be to thoroughly evaluate which outcome mea-
amplitude changed by only 5 ␮V when doubling the number of sures are of primary interest prior to data analysis, and manually
channels used). Thus, while using high-density electrode arrays is examine a small subset of parameters that have significant effects
crucial for examining topographical changes with good resolution, on those particular outcome measures. This could be done iter-
there is a rich source of previously recorded data using sparse arrays atively on a subset of the recordings in the study using the
that could be usefully re-analyzed (e.g. full clinical polysomnog- toolbox explorer, and then generalized to automatically examine
raphy recordings). A second surprising result were the marked the remaining recordings. Given that an entire night of recording
differences in wave detection depending on the parameters chosen. can be fully analyzed from preprocessed data using the toolbox
Specifically, the parameters employed in several previous studies within a matter of minutes, and additional functions allow the com-
(Mölle et al., 2002; Massimini et al., 2004) tended to detect fewer parison of results, such a processing pipeline can be highly effective.
waves overall, and those that were detected tended to have higher Of course, studies may wish to report two (or more), combinations
amplitude and to travel more globally. This observation is consis- of parameter settings, and interpret the differences according to
tent with the recent proposal that there may be two distinct types the effects of these parameters differences reported here.
of slow waves: larger waves found in relative isolation during the One crucial parameter was explicitly omitted from in-depth
earlier epochs in the transition from sleep to wake (type I) and con- analysis: the topography of individual wave origins. Wave origin
tinuing a relatively low incidence during later stages; and smaller, has been previously defined at the scalp level as the channel to
more local slow waves found throughout consolidated sleep (type show the earliest negative peak. From a neurophysiological per-
II) (Siclari et al., 2014). Therefore, the criteria used in early stud- spective, the origin should represent the initial population that
ies may have privileged type I waves, with decreased sensitivity enters the hyper-polarized, down state. However, since these small
to type II waves of smaller amplitude. The toolbox default criteria populations of synchronized neurons are unlikely to be visible in
are, by design, on the opposite side of this trade-off, with increased the EEG, the current definition of wave origin is necessarily coarse.
sensitivity to all slow waves, with the potential for an increase in Possible refinements include the determination of the first chan-
false-positives. nel to show a downward zero-crossing; the start of the longest
We found little evidence for a theoretical frontal bias when traveling stream; or the projected intersection of the starts of trav-
using the mastoids reference. The average reference, which would eling streams moving in different directions. Further studies should
eliminate this potential bias, introduces its own bias due to the explore which of these alternatives produce the most robust results
global nature of many slow waves. The more channels which show consistent with intracranial recordings.
a negative deflection, the more negative the mean of these chan-
nels becomes. The result of the average reference is that essentially
half the slow waves are seen as positive-going waveforms, their
amplitude is significantly reduced, and their relationship to one
another is difficult to track. This sets an effective upper-bound of 4.1. Future directions
wave globality to approximately 50%. In turn, the missed detection
of large globally traveling waves gives rise to potentially inconsis- Functions within the toolbox are constantly being updated with
tent results in traveling direction. While the potential for a frontal improved coding, faster implementations of algorithms, feature
bias still remains when using the mastoids reference, the trade-off requests, and bug-fixes. This refinement is expected to continue
when using the average reference is high. As such we recommend and grow as more researchers begin to use the toolbox for their
persisting with the average-mastoid reference since its theoretical analysis, request additional features, and ideally contribute their
flaws appear to have few practical consequences; especially given own code to the toolbox. The Github repository can be used to
the larger possible effects of other changes to detection parame- gain an overview of the current short-term task list by using the
ters. The mastoids reference also allows for consistent comparison search feature for the word “TODO”. Alternatively, the ‘issues’ sec-
to previous work with few electrodes (i.e. <20), where the average tion of the Github page contains several open and closed issues
reference becomes impractical. such as bug reports and their fixes as well as potential enhance-
From a broader perspective, these results send a clear and ments to the toolbox and allows for discussion between users.
important message: slight, seemingly arbitrary changes in detec- Mid- and long term plans include: creation of a simple GUI for
tion settings can have large and widespread effects on the number the loading and selection of parameter estimates which are cur-
and structure of slow waves found. This finding highlights the rently run through a script; the implementation and validation of
importance of explicitly stating how waves were detected and automatic detection algorithms and saw tooth waves, as well as
justifying those choices with reference to the potential effects the automatic detection of eye movements during REM to examine
demonstrated here. It also points to a need for standardized param- their potential relationship; the implementation and optimization
eter settings such that results across studies can be adequately of a larger variety of parameter settings and methods for spindle
compared. It was not the goal of the current analysis to determine a detection (Ferrarelli et al., 2007) using the same methods devel-
set of optimal parameter settings, only to show the effects settings oped for slow waves to detect epileptic events and how they travel
have on outcome measures. The development of an optimal range over the scalp; implementation of source-localization algorithms
of parameters requires substantial agreement on what constitutes and the development of traveling calculations through the three
a ‘true’ slow wave. This could potentially be achieved in the future dimensional source space of the brain and new corresponding visu-
using a panel of experts manually examining individual slow waves alization features (Murphy et al., 2009). There will no doubt be
and creating a gold standard dataset to which automatic procedures additional features as more researchers begin to explore the fea-
can be compared for specificity and sensitivity. The functions in tures of the toolbox, new research made possible by the toolbox is
the toolbox for dataset exploration and manually adding waves, conducted, and novel hypotheses are generated. Through the use
or changing waves at the channel level, are well-suited to such a of git for version control, the purposeful factorization of code, and
future study. the emphasis on heavy commenting within the written functions,
The search for optimal default parameters is ongoing and iter- the toolbox is designed to be both user friendly to researchers and
ative. Future studies will hopefully converge on a set of cardinal clinicians who wish to simply analyze their data, as well as to those
features of EEG slow waves that can then serve to inform and who want to contribute additional functions and expand on the
enhance the detection procedure. At present, the recommended possibilities the toolbox offers.
12 A. Mensen et al. / Journal of Neuroscience Methods 274 (2016) 1–12

Acknowledgements Marzano, C., Moroni, F., Gorgoni, M., Nobili, L., Ferrara, M., De Gennaro, L., 2013.
How we fall asleep: regional and temporal differences in
electroencephalographic synchronization at sleep onset. Sleep Med. 14
We thank Giulio Bernardi, Melanie Boly, Anna Castelnovo, and (November (11)), 1112–1122.
Francesca Siclari for their contributions in developing and test- Mascetti, L., Muto, V., Matarazzo, L., Foret, A., Ziegler, E., Albouy, G., et al., 2013. The
ing features of the toolbox; William Marshall for his assistance impact of visual perceptual learning on sleep and local slow-wave initiation. J.
Neurosci. 33 (February (8)), 3323–3331.
in statistical analysis; and Chiara Cirelli for her helpful com- Massimini, M., Huber, R., Ferrarelli, F., Hill, S., Tononi, G., 2004. The sleep slow
ments and discussion in preparing the manuscript. Armand Mensen oscillation as a traveling wave. J. Neurosci. 24 (August (31)), 6862–6870.
was supported by a Swiss National Science Foundation grant (id: Menicucci, D., Piarulli, A., Debarnot, U., d’Ascanio, P., Landi, A., Gemignani, A., 2009.
Functional structure of spontaneous sleep slow oscillation activity in humans.
P300P3 158505).
PLoS One 4 (10), e7601.
Mensen, A., Khatami, R., 2013. Advanced EEG analysis using threshold-free
Appendix A. Supplementary data cluster-enhancement and nonparametric statistics. Neuroimage 67 (February
(15)), 111–118.
Mensen, A., Khatami, R., 2015. EEG Permutation Testing: An Open-source Matlab
Supplementary data associated with this article can be found, in Toolbox Implementing Various Permutation Strategies for EEG Statistical
the online version, at http://dx.doi.org/10.1016/j.jneumeth.2016. Analysis [cited 2015 Jun 9] Available from: http://dx.doi.org/10.5281/zenodo.
14787.
09.006.
Murphy, M., Riedner, B.A., Huber, R., Massimini, M., Ferrarelli, F., Tononi, G., 2009.
Source modeling sleep slow waves. Proc. Natl. Acad. Sci. U. S. A. 106 (February
(5)), 1608–1613.
References Nobili, L., Ferrara, M., Moroni, F., De Gennaro, L., Russo, G.L., Campus, C., et al., 2011.
Dissociated wake-like and sleep-like electro-cortical activity during sleep.
Amzica, F., Steriade, M., 1998. Electrophysiological correlates of sleep delta waves. Neuroimage 58 (September (2)), 612–619.
Electroencephalogr. Clin. Neurophysiol. 107 (August (2)), 69–83. Pascual-Marqui, R.D., Lehmann, D., 1993. Comparison of topographic maps and the
Bölsterli Heinzle, B.K., Fattinger, S., Kurth, S., Lebourgeois, M.K., Ringli, M., Bast, T., reference electrode: comments on two papers by Desmedt and collaborators.
et al., 2014. Spike wave location and density disturb sleep slow waves in Electroencephalogr. Clin. Neurophysiol. Evoked Potentials Sect. 88 (November
patients with CSWS (continuous spike waves during sleep). Epilepsia 55 (April (6)), 530–531.
(4)), 584–591. Perrin, F., Pernier, J., Bertrand, O., Giard, M.H., Echallier, J.F., 1987. Mapping of scalp
Buchmann, A., Ringli, M., Kurth, S., Schaerer, M., Geiger, A., Jenni, O.G., et al., 2011. potentials by surface spline interpolation. Electroencephalogr. Clin.
EEG sleep slow-wave activity as a mirror of cortical maturation. Cereb. Cortex Neurophysiol. 66 (January (1)), 75–81.
21 (March (3)), 607–615. Riedner, B.A., Vyazovskiy, V.V., Huber, R., Massimini, M., Esser, S., Murphy, M., et al.,
Delorme, A., Makeig, S., 2004. EEGLAB: an open source toolbox for analysis of 2007. Sleep homeostasis and cortical synchronization: III. A high-density EEG
single-trial EEG dynamics including independent component analysis. J. study of sleep slow waves in humans. Sleep 30 (December (12)), 1643–1657.
Neurosci. Methods 134 (March (1)), 9–21. Saper, C.B., Scammell, T.E., Lu, J., 2005. Hypothalamic regulation of sleep and
Fattinger, S., Jenni, O.G., Schmitt, B., Achermann, P., Huber, R., 2014. Overnight circadian rhythms. Nature 437 (October (7063)), 1257–1263.
changes in the slope of sleep slow waves during infancy. Sleep 37 (February Siclari, F., Bernardi, G., Riedner, B.A., LaRocque, J.J., Benca, R.M., Tononi, G., 2014.
(2)), 245–253. Two distinct synchronization processes in the transition to sleep: a
Ferrarelli, F., Huber, R., Peterson, M.J., Massimini, M., Murphy, M., Riedner, B.A., high-density electroencephalographic study. Sleep 37 (October (10)),
et al., 2007. Reduced sleep spindle activity in schizophrenia patients. Am. J. 1621–1637.
Psychiatry 164 (March (3)), 483–492. Siegel, J.M., 2009. The neurobiology of sleep. Semin. Neurol. 29 (September (4)),
Huber, R., Ghilardi, M.F., Massimini, M., Tononi, G., 2004. Local sleep and learning. 277–296.
Nature 430 (July (6995)), 78–81. Stadelmann, K., Latshang, T.D., Lo Cascio, C.M., Tesler, N., Stoewhas, A.-C., Kohler,
Iber, C., Ancoli-Israel, S., Chesson, A., Quan, S., 2007. The AASM Manual for the M., et al., 2013. Quantitative changes in the sleep EEG at moderate altitude
Scoring of Sleep and Associated Events: Rules, Terminology and Technical (1630 m and 2590 m). PLoS One 8 (10), e76945.
Specifications. American Academy of Sleep Medicine, Westchester. Tucker, D.M., 1993. Spatial sampling of head electrical fields: the geodesic sensor
Jones, B.E., 2005. From waking to sleeping: neuronal and chemical substrates. net. Electroencephalogr. Clin. Neurophysiol. 87 (September (3)), 154–163.
Trends Pharmacol. Sci. 26 (November (11)), 578–586. Vyazovskiy, V.V., Olcese, U., Hanlon, E.C., Nir, Y., Cirelli, C., Tononi, G., 2011. Local
Krueger, J.M., Rector, D.M., Roy, S., Van Dongen, H.P.A., Belenky, G., Panksepp, J., sleep in awake rats. Nature 472 (April (7344)), 443–447.
2008. Sleep as a fundamental property of neuronal assemblies. Nat. Rev. Werth, E., Achermann, P., Borbély, A.A., 1997. Fronto-occipital EEG power
Neurosci. 9 (December (12)), 910–919. gradients in human sleep. J. Sleep Res. 6 (June (2)), 102–112.
Mölle, M., Marshall, L., Gais, S., Born, J., 2002. Grouping of spindle activity during Wilhelm, I., Kurth, S., Ringli, M., Mouthon, A.-L., Buchmann, A., Geiger, A., et al.,
slow oscillations in human non-rapid eye movement sleep. J. Neurosci. 22 2014. Sleep slow-wave activity reveals developmental changes in
(December (24)), 10941–10947. experience-dependent plasticity. J. Neurosci. 34 (September (37)),
12568–12575.

Вам также может понравиться