EDF Validation - nsrr/edf-editor-translator GitHub Wiki

As defined in EDF Specification (http://www.edfplus.info/specs/edf.html), below is the digital format of the header record (upper block, ascii's only) and of each subsequent data record (lower block, integers only). Note that each one of the ns signals is characterized separately in the header.

Description in EDF EDF Validation Rules
version of this data format (0) (A.1) check for ascii (A.2) is equal to 0 (A.3) cannot be empty field
local patient identification (B.1) check for ascii (B.2) can be empty field
local recording identification (C.1) check for ascii (C.2) can be empty field
startdate of recording (dd.mm.yy) (D.1) check for ascii (D.2) cannot be empty field (D.3) dd:00-31, mm:00-12, yy:00-99 (D.4) separator between digits should be only ‘dot’
starttime of recording (hh.mm.ss) (E.1) check for ascii (E.2) cannot be empty field (E.3) hh:00-23, mm:00-59, ss:00-59 (E.4) separator between digits should be only ‘dot’
number of bytes in header record (F.1) check for ascii (F.2) should not be empty (F.3) is a non-negative integer
reserved (G.1) check for ascii (G.2) can be empty field
number of data records (-1 if unknown) (H.1) check for ascii (H.2) should not be empty (H.3) is a positive integer (-1 if unknown)
duration of a data record, in seconds (I.1) check for ascii (I.2) should not be empty field (I.3) is a positive floating point number (eg. 1, 0.2, 0.001)
number of signals (ns) in data record (J.1) check for ascii (J.2) cannot be empty (J.3) is a positive integer
ns * label (e.g. EEG Fpz-Cz or Body temp) (K.1) check for ascii (K.2) no duplicate signal labels (there cannot be 2 signals with same label EKG; EKG and ekg are considered as duplicates) (K.3) cannot be empty field
ns * transducer type (e.g. AgAgCl electrode) (L.1) check for ascii (L.2) can be empty field
ns * physical dimension (e.g. uV or degreeC) (M.1) check for ascii (M.2) can be empty field - (uncalibrated)
ns * physical minimum (e.g. -500 or 34) (N.1) check for ascii (N.2) is a floating point number (N.3) Postive amplitude gain: physical minimum < physical maximum and digital min < digital max (N.4) Negative amplitude gain: physical min > physical max and digital min < digital max (N.5) cannot be empty field (even if uncalibrated - to avoid divide-by-0)
ns * physical maximum (e.g. 500 or 40) (O.1) check for ascii (O.2) is a floating point number (O.3) physical maximum NOT = physical minimum (O.4) cannot be empty field (even if uncalibrated - to avoid divide-by-0)
ns * digital minimum (e.g. -2048) (P.1) check for ascii (P.2) is an integer (P.3) since each date sample is a 2-byte integer, range check [-32768,32767] (P.4) cannot be empty field
ns * digital maximum (e.g. 2047) (Q.1) check for ascii (Q.2) is an integer (Q.3) since each date sample is a 2-byte integer, range check [-32768,32767] (Q.4) cannot be empty field (Q.5) digital minimum < digital maximum (Q.6) digital minimum NOT = digital maximum (division-by-0 condition)
ns * prefiltering (e.g. HP:0.1Hz LP:75Hz) (R.1) check for ascii (R.2) can be empty field
ns * nr of samples in each data record (S.1) check for ascii (S.2) is an integer (S.3) is greater than 0 (S.4) cannot be empty fieldcd in
ns * 32 ascii : ns * reserved (T.1) check for ascii (T.2) can be empty field

Usage of “EDF Format Validator”

Selecting EDF File(s) via “Starting a new task” inside EDF-Editor.

Upon launching the EDF Editor the user is presented with the Main Window. In order to continue the user must select EDF file(s). This can be done by selecting the menu item File >> New Task or by clicking the Select EDF files icon.

File: Select New Task

Launching “Find EDF Header Errors” inside EDF-Editor.

EDF Validation Tool can be invoked by selecting the menu item Tools >> Find EDF Header Errors icon.

Tools: Select Find EDF Header Errors

Visually examining the found errors.

  • The found error messages are shown in the “Log and Incompliance area” of EDF-Editor. Another copy of the same error messages will be recorded into the error log file.
  • For every error message, the validator gives detailed information including (1) type of examination (EIA or ESA), (2) description of error, (3) path and name of erroneous EDF file, and (4) location (with row and column numbers) of the error in EDF table.
  • User may point to and click on the arrow on every error message, and then corresponding EDF file is opened and erroneous locations is highlighted.
  • A brief explanation to the errors shown in the following figure.

Tools: View Header Incompliances to EDF Specification

Illustration of EDF Header Incompliances

Incorrect DateTime Format

Error Message [Row: 1, Col: 5] EDF Header: Date should follow the format of dd.mm.yy.
Explanations The separator for date and time must be dot (“.”). [Refer to validation rule #D.4]

Empty Signal Label Field

Error Messages [Row: 5, Col: 1] Signal Header: Cannot be empty field
Explanations [Refer to validation rule # K.3]

Duplicate Signal Labels

Error Messages [Row: 6, Col: 1] Signal Header: Duplicated labels at row 6, 7
Explanations Single label must be unique. [Refer to validation rule #K.2]

Invalid Digital Min and Max Data Format

Error Messages [Row: 7, Col: 6] Signal Header: Digital minimum should be an integer [Row: 8, Col: 6] Signal Header: Digital minimum should be an integer
Explanations Digital minimum(maximum) must be an integer. [Refer to validation rule #P.2]

Invalid Physical Min and Max Data Format

Error Messages [Row: 10, Col: 4] Signal Header: Physical minimum should be a floating point number [Row: 10, Col: 5] Signal Header: Physical maximum should be a floating point number
Explanations [Refer to validation rule # N.2 & O.2]

Incorrect non-ascii character in field

Error Messages [Row: 11, Col: 4] Signal Header: Non-Ascii character in signal
Explanations All fields must contain only ASCII characters. [Refer to validation rule #N.1]

Physical Minimum and Maximum cannot be equal

Error Messages [Row: 12, Col: 5] Signal Header: Physical maximum cannot equal to physical minimum
Explanations [Refer to validation rule # O.3]

Field Values not in allowable range

Error Messages [Row: 12, Col: 6] Signal Header: Digital integer should be in the range of [-32768, 32767] [Row: 12, Col: 7] Signal Header: Digital integer should be in the range of [-32768, 32767]
Explanations [Refer to validation rule # P.3 & Q.3]

Digital Minimum and Maximum cannot be equal

Error Messages [Row: 12, Col: 7] Signal Header: Digital maximum cannot equal to digital minimum
Explanations [Refer to validation rule # Q.6]

Edit/Fix EDF Validation Errors

Launching “Fix EDF Header Errors” inside EDF-Editor.

  • It can be invoked by selecting the menu item Tools >> Fix EDF Header Errors icon.

Fix EDF Validation Errors

Parameter Settings for EDF Error Fix Component

  • User specify what kind of errors and which EDF files should be fixed using the Error Fix Component.
  • Having parameters set, user click the button ‘Apply Error-fixes’ to correct errors in the selected EDF files. A complete list of error-fix messages will be recorded into the log file.
  • “Swap Physical Max/min” will swap 'Physical maximum' and 'Physical minimum' for negative amplifier gain scenario. In this case, the physical maximum is smaller than physical minimum. http://www.edfplus.info/specs/edfplus.html [item 5].

Parameter Selection for EDF Error Fix Component