Running SpectralTrainFig - nsrr/SpectralTrainFig GitHub Wiki
Once files are prepared for analysis running SpectralTrainFig is a straightforward process. All steps are automated and include artifact detection, artifact removal, spectral processing and results reporting. A single eight hour PSG will take roughy 15 seconds per analyzed lead to run through full spectral analysis and reporting, with the MATLAB app capable of batch processing thousands of studies back to back if setup properly.
SpectralTrainFig Description Settings
-
Check that all EDF and XML pairs share the same file name and all EDFs and XMLs use the same file extensions. A tutorial for standardizing file extensions using Ant Renamer is available here.
-
Check all EDFs and XMLs for errors that would prevent spectral analysis. This includes conflicting signal labels, bad sleep staging, and improperly formatted XML files among other things. Step by step tutorials for generating dataset summaries using BlockEdfSummarizeFig and troubleshooting EDF and XML errors are available here.
-
Under the APPS tab in MATLAB click the icon for SpectralTrainFig to launch the MATLAB application.
-
Set the Output File Prefix. This prefix will be added to the XML summaries generated during and after analysis. Individual spectral results will be prefixed with name of the EDF file used.
-
Direct Data Folder to the location of your EDF/XML files.
-
Direct Result Folder to where your spectral results will be saved.
-
Enter the XML Suffix used in all XMLs to be analyzed. SpectralTrainFig defaults to –profusion.xml, and Compumedics’ XMLs default to EDF.XML.
SpectralTrainFig Analysis Parameters
The labels used for the exploring electrodes and their reference electrodes must be entered under Analysis Signal and Reference Signal. This varies from study to study, but some common pairings are:
Exploring | Reference | Description |
---|---|---|
{'C3','C4'} | {'M2','M1'} | Most common, current AASM standard. |
{'C3','C4'} | {'A2','A1'} | Older variation with mastoid reference labeled as A2. |
{'EEG'} | {} | Hardwired reference not requiring a separate signal. |
-
Format signal labels with label names between apostrophes, separated by commas, all enclosed by curly brackets with no spaces. Examples: {'C3','C4','F3','F4'}
-
Select the appropriate Reference Method from the following:
-
Single Reference Signal
Used when analyzing only one signal pair or if all analysis signals use a common reference. Enter a single signal label as a cell string (ex. {'M1'}). This Reference Signal is subtracted from each Analysis Signal. Entering a null cell string (i.e. {}) is interpreted as not using a reference signal. -
Reference for each Analysis Signal
This most common option is used when analyzing multiple analysis signals and reference signals. Each set of signals is entered as a cell string. A signal label can be used multiple times but should line up 1:1 with the signal it is being paired with (ex. analysis signals {'C3','C4','F3','F4'} pair with reference signals {'M2','M1','M2','M1'}). -
Average of Reference Signal
Using this setting will cause the average of all reference signals listed in the cell array to be subtracted from each analysis signal. -
Under Spectral Settings select the window function to be used for analysis. The default setting is 10x 4-second sub-epochs using a 50% Tukey Window.
-
Artifact Detection settings can be be left at their default values which is the multiplicative threshold for both bands determined to most approximate the results of previous manual scoring. These settings are:
Delta (0.6-6Hz) at 2.5 and Beta (40-60Hz) at 2.0. -
Monitor ID determines which computer monitor will display during processing, and can typically be left unchanged as it will not affect the outcome of spectral analysis.
-
Start denotes which file pairing (EDF & XML) should be the first for spectral analysis. This can be used to resume analysis after a particular file pair has crashed spectral analysis and you want to resume processing without reanalyzing previous files.
-
Set Bands will allow you to load an Excel file with a list of spectral bands to analyze and report. The default spectral analysis bands include:
Slow Oscillations | Delta | Theta | Alpha | Sigma (All) | Sigma (Slow) | Sigma (Fast) | Beta |
---|---|---|---|---|---|---|---|
0.5-1 Hz | 1-4 | 4-8 | 8-12 | 12-15 | 12-13.5 | 13.5-15 | 15-20 Hz |
Running SpectralTrainFig
-
Close out of Excel and all other programs before running MATLAB. This will help to prevent freezing or crashing during processing.
-
Go (all) will begin running spectral analysis on all studies in your Data Folder and any subfolders. This process is very memory intensive and will effectively lock-up the computer during spectral analysis. Do not attempt to open any of the resulting Excel or PowerPoint files until processing has completed on all studies.
-
Upon successful analysis SpectralTrainFig will output a PowerPoint slideshow of the results and begin analyzing the next study.
-
At the end of processing (whether by success or by error) two new files will be generated in the Result Folder: FileList.xlsx and FileListWithCheck.xlsx. If spectral analysis terminated early due to error these files can be used to help with troubleshooting.
-
At the end of successful processing two new files will be generated containing spectral output for the overall dataset, BandSummary.xlsx and SpectralSummary.xlsx.