Electroencephalography and Clinical Neurophysiology, 1979, 46:727--730 © Elsevier/North-Holland Scientific Publishers, Ltd. Technical contribution AN OPTICAL SCAN SYSTEM FOR ENCODING AND TABULATION OF VISUALLY SCORED SLEEP DATA 1 G. FEIN and I. FEINBERG Psychiatry Service (116A), San Francisco Veterans Administration Hospital, and University of California at San Francisco, San Francisco, Calif. 94121 (U.S.A.) (Accepted for publication: December 13, 1978) 727 Most systems for visual scoring of all-night sleep records recommend scoring by successive epochs or pages of record. These typically range in duration from 20 sec to 1 min (Feinberg et al. 1967; Recht- schaffen and Kales 1968; Williams et al. 1974). A given epoch may receive more than one score (for example, stage 1 EEG with eye movement or body movement, etc.). Thus, the record of a single night might consist of 1500 20-sec epochs of record (500 rain) which, with multiple scores, could generate 2000--2500 data entries. Since subjects in sleep investigations are typically studied over several nights within a single condition, a massive volume of data rapidly accumulates. A major obstacle to computer analysis of visually scored sleep data has been the time, expense and the possible error involved in introducing this voluminous information into the computer. A number of systems have been developed in an attempt to systematize the tabulation and data analysis of visually scored sleep data (Anders and Zangen 1972; Tassone et al. 1973; Stanley 1974; Walker and Reite 1976). All of these systems require input of the visually scored sleep data as an operation separate from the visual scoring. In addition, these systems do not have the dual capabil- ity of retaining the original data by individual poly- graph sleep data (PSD) page and the indexing of events in real time. This capability permits the inte- gration of visually scored sleep staging with computer analyses of the EEG wave form (Feinberg et al. 1978). We present here a new system -- OPSCAN -- which overcomes these limitations. It consists of two parts. The first part is an input system in which specially designed scoring sheets are optically scanned and data directly entered into the computer. However, these entries must be monitored by the operator since the OPSCAN sheets sometimes contain human error. To 1 This work was supported by research funds from the Veterans Administration. facilitate this monitoring, we have included extensive error and edit-checking as described below. The sec- ond part consists of a data base for the visually scored PSD. The visually scored data base (VSDB) is orga- nized by NREM and REM periods but retains within those units the original coding of each epoch (PSD page) of sleep. Organization of data by REMPs and NREMPs has proved both efficient and informative in previous studies (Feinberg et al. 1967; Feinberg 1974; Feinberg and Floyd 1979). We thought the OPSCAN programs might be use- ful to other investigators. For this reason, those vari- ables which often differ among laboratories (number of seconds per PSD page, length criteria for NREM and REM periods, etc.) were made specifiable pro- gram parameters. From the optically scanned input, with 3 additional cards of key punched data, the OPSCAN system yields scores for virtually all sleep variables. Data are provided both for the entire night and for successive NREM and REM periods. All data are entered directly into the Statistical Package for the Social Sciences (SPSS) (Nie et al. 1975) for anal- ysis. Among the analyses we routinely include are the computation of means and standard deviations, both by cycles across the nights and by nights within and across conditions; the testing for trends within nights and for differences across conditions in both cycle trends and all-night mean values. The program described above could prove useful to any laboratory engaged in the visual scoring of all-night sleep records. In addition, by establishing an intermittent correspondence between real-time and PSD page (e.g., using a time-code generator or wall clock) the VSDB can be indexed by real-time and real-time correlates of specific PSD pages can be sought. For example, we have developed programs that combine the VSDB with our period-amplitude analysis data base (Feinberg et al. 1978) also indexed in real time, enabling us to examine the wave form characteristics of record visually classified as stages 2, 3, 4, NREM or REM. An additional advantage to the use of a highly accurate and uninterrupted time