Sleep Spindles Detector toolbox analyses raw EEG signals to then extrapolate the number of sleep spindles using either the absolute or relative Sigma power (11-16Hz).
The toolbox is optimised for Python 3.10 and above and was tested on both Windows and macOS ARM.
Note
All dependencies are listed in requirements, Python 3.10 minimum.
If you use this toolbox, please cite as followed:
- Guillot, S.J. (2023). Sleep spindles detector (2023.10.31-post1). GitHub, Zenodo. https://doi.org/10.5281/zenodo.10066031
These pipelines were created and is maintained by SJG.
Contributions are more than welcome so feel free to submit a pull request!
To report a bug, please open a new issue.
Note that this program is provided with NO WARRANTY OF ANY KIND under Apache 2.0 license.
To install the toolbox, simply use:
conda install -c cf-staging ssp_detector
pip install ssp_detector
Everything worked if the following command do not return any error:
import mne
from ssp_detector import spindles_abs
from ssp_detector import spindles_rel
from tkinter import filedialog as fd
#Load an EDF file using MNE
edf=fd.askopenfilename(title='SELECT EDF FILE',filetypes=(("EDF files","*.edf"),("all files","*.*")))
raw=mne.io.read_raw_edf(edf,preload=True)
sfreq=raw.info['sfreq']
#Return sleep spindles count
spindles_abs(raw,sf=sfreq,thresh={'abs_pow':1.25})
spindles_rel(raw,sf=sfreq,thresh={'rel_pow':0.2})
Absolute Sigma power formula:
Relative Sigma power formula: