MTSleepScoring¶
Interactive MATLAB GUI for manual sleep-stage scoring on multitaper EEG spectrograms, from the Prerau Laboratory. Built on the MTSleepScorer class plus the lab’s EventMarker and multitaper_toolbox.
What it does¶
Loads EDF polysomnography, computes a whole-night multitaper spectrogram plus stage-level high-resolution spectrograms, and provides a keyboard-driven GUI for marking 30 s (or arbitrary-length) stages, flagging artifacts, and exporting scored data.
Key features:
Overview multitaper spectrogram (0.5–35 Hz, 30 s / 15 s window/step) + stage-level high-res spectrogram (6 s / 1 s)
Full keyboard-driven stage entry (3-stage or 5-stage scoring)
Automatic artifact detection (
x) and manual artifact marking (a)Slice power-spectrum overlay (
u), 3-D regional popouts (d)Electrode cycling (
,/.), pan/zoom via arrow keys and scroll wheelJSON-like save/load of scoring sessions keyed by scorer initials
Keyboard shortcuts¶
Key |
Action |
|---|---|
|
Pan one screen-width |
|
Zoom |
|
Set zoom window size |
|
Cycle through electrodes |
|
Mark Wake |
|
Mark REM |
|
Mark NREM N1 / N2 / N3 |
|
Automatic artifact detection |
|
Add manual artifact |
|
Toggle slice power spectrum |
|
3-D popout of selected region |
|
Toggle help window |
|
Quit |
Quick start¶
% 1. Edit the paths at the top of MT_scoring_init_script.m:
% root = '<path to this repo>';
% data_path = fullfile(root, 'data');
% save_path = fullfile(root, 'scoring');
%
% 2. Launch the scorer:
obj = MTSleepScorer();
The included data/Test_Subject.edf provides a one-night example. Scoring sessions are saved under save_path and tagged with the scorer’s initials so multiple scorers can work on the same recording.
Install¶
git clone https://github.com/preraulab/MTSleepScoring.git
Add the repo plus its dependencies to the MATLAB path:
addpath(genpath('/path/to/MTSleepScoring'));
addpath(genpath('/path/to/EventMarker'));
addpath(genpath('/path/to/multitaper_toolbox/matlab'));
Dependencies¶
MATLAB R2020a+
EventMarker— event marking on MATLAB axesmultitaper_toolbox— multitaper spectrogram
Citation¶
See CITATION.cff.
License¶
BSD 3-Clause. See LICENSE.
Contact¶
Michael J. Prerau, Ph.D. — prerau@bwh.harvard.edu — sleepEEG.org