Debian Codegraph @

biosig4c++/extern/header.txt

raw
1
2 SPECIFICATION OF HEADERINFORMATION OF EEG-Files
3 -----------------------------------------------
4
5
6 $Id$
7 Copyright (C) Alois Schloegl 2003-2005,2008,2009 <[email protected]>
8 This is part of the BIOSIG-toolbox http://biosig.sf.net/
9
10
11 CONTENT:
12 =========
13 (A) Basic header definition (common for all file formats)
14 (B) Header definition for data acquisition
15 (C) Header definition of EDF/BDF/GDF/SDF-Files
16
17
18
19 (A)========== Basic header definition ================================
20
21 Name_of_field type description
22 -------------------------------------------------------------------------
23 HDR.TYPE string type of data format,
24 HDR.VERSION string [OPTIONAL] depends on data format
25
26 HDR.FileName full filename
27 HDR.FILE # file handling information
28 FILE.Path [optional] path
29 FILE.Name [optional] filename
30 FILE.Ext [optional] extension
31 FILE.OPEN status: 0 (close), 1 (read), 2(write),3(rewrite header when SCLOSE)
32 FILE.POS position of the file handle (units depend on data format)
33 FILE.PERMISSION 'r': read; 'w': write; 'z': on-the-fly (de-)compression
34 FILE.stdout [optional] output stream
35 FILE.stderr [optional] error stream
36 FILE.size [optional]
37
38 HDR.T0 float[1..6] start time, [yyyy mm dd hh MM ss.cc] see HELP CLOCK
39 HDR.NS integer number of channels
40 HDR.SampleRate integer sampling frequency in [Hz]
41 HDR.NRec integer number of records or blocks; 1 for continous data
42 HDR.SPR integer samples per record
43 HDR.Dur float Duration=SPR/SampleRate (in [s]) of data block [depreciated]
44
45 HDR.Calib Matrix for all kind of rereferencing, depends on scaling factors as well as input argument
46 HDR.InChanSelect input channel selection, # read from Raw-data
47
48 HDR.EVENT # two versions are possible. Version 1:
49 EVENT.SampleRate float how many units [sample] give one second
50 EVENT.POS uint32 Position of event [in samples]
51 EVENT.TYP uint16 Type of event/marker/annotation according to table biosig/t200/eventcodes.txt
52 # or Version 3:
53 EVENT.SampleRate float how many units [sample] give one second
54 EVENT.POS uint32 Position of event [in samples]
55 EVENT.TYP uint16 Type of event/marker/annotation according to table biosig/t200/eventcodes.txt
56 EVENT.CHN uint16 associated channel; is zero if event applies to no specific or all channels
57 EVENT.DUR uint32 event duration in samples
58 EVENT.VAL (*) use for sparse (non-equidistant) sample values). The type corresponds to GDFTYP of the respective channel.
59 and must not exceed 32 bits (4 bytes). Currently, only integer types are supported.
60 # [OPTIONAL]
61 EVENT.CodeDesc text description of (user-specified) Eventtypes
62 EVENT.Desc text description of Event [depreciated, will become obsolete]
63 EVENT.CodeIndex int corresponding index [depreciated, will become obsolete]
64
65 HDR.ELEC.
66 ELEC.XYZ float electrode positions
67
68 HDR.Label char-array e.g. '+C3a - C3p '
69 HDR.LeadIdCode uint16 Lead identification label according to SCP or FEF standard
70 HDR.PhysDim string physical dimension e.g. 'uV'
71 HDR.PhysDimCode uint16 Code of physical dimension according to "File Exchange Format for Vital Signs - Annex A "
72 HDR.PhysMax float physical maximum (for calibration)
73 HDR.DigMax integer digital maximum (for calibration)
74 HDR.PhysMin float physical minimum (for calibration)
75 HDR.DigMin integer digital minimum (for calibration)
76 HDR.Bits integer number of bits used
77 HDR.THRESHOLD numeric digital minimum and maximum (for saturation detection);
78 a third column indicates the encoding of missing data;
79 HDR.CHANTYP ascii guess for signal type
80 HDR.Impedance float32 Electrode Impedance for Voltage data channels
81 HDR.fZ float32 Probe frequency of impedance channels
82
83 HDR.FLAG.TRIGGERED int 0=no, 1=yes
84 HDR.FLAG.REFERENCE string COM, CAR: common average reference; LOC,LAR local average ref; LAP Laplacian derivation, WGT weighted average
85 HDR.FLAG.UCAL int 0: data is calibrated (scaled), 1: data is not calibrated (scaled)
86 HDR.FLAG.OVERFLOWDETECTION int 1: automated overflow detection if HDR.THRESHOLD is available; 0: no overflow detection
87 HDR.FLAG.OUTPUT ascii 'double': data is a double; 'single': data is single precision
88
89 HDR.Classlabel int 0: left, 1: right, etc.
90 HDR.ArtifactSelection int [OPTIONAL] 0: ok, 1: artifact
91 HDR.TriggerOffset samples [OPTIONAL] Offset time between TriggerOnset and begin of trial
92
93 HDR.Filter % filter information, usually for each channel separatily
94 Filter.LowPass float [Hz]
95 Filter.HighPass float [Hz]
96 Filter.Notch float [Hz] NaN: unknown, -1(<0): off
97 HDR.PreFilt string [OPTIONAL] filter setting - used by GDF, BDF, EDF
98
99 HDR.Patient # contains patient information [OPTIONAL]
100 Patient.Name Name of Patient: should not be used because of privacy protection
101 Patient.Id Patient identification code as used in hospital
102 Patient.Age Age of Patient
103 Patient.Sex Patient Gender 0: unknown, 1: male, 2: female
104 Patient.Handedness Patient Handedness 0:unknown, 1: right, 2:left, 3: equal
105 Patient.Medication Medication
106 Patient.Classification Classification of Patient
107 Patient.Height height in centimeters [cm]
108 Patient.Weight weight in kilogram [kg]
109 Patient.BMI Body mass index
110 Patient.Headsize 3xfloat32 Distance Nasion-Inion, distance A1-A2, Circumference of head
111 Patient.Birthday [Y M D h m s]: approx. Birthday, to calculate patient's age.
112 Patient.Impairment.Heart 0: unknown 1: NO 2: YES 3: pacemaker
113 Patient.Impairment.Visual 0: unknown 1: NO 2: YES 3: corrected (with visual aid)
114 Patient.Smoking 0: unknown 1: NO 2: YES
115 Patient.AlcoholAbuse 0: unknown 1: NO 2: YES
116 Patient.DrugAbuse 0: unknown 1: NO 2: YES
117
118 HDR.Manufacturer # Manufacturer information
119 Manufacturer.Name name of manufacture
120 Manufacturer.Model device model
121 Manufacturer.Version version of device
122 Manufacturer.SerialNumber Serial number
123
124 HDR.REC.Hospital Identification of hospital
125 HDR.RID Identification of Recording, StudyID, consecutive number
126 HDR.REC.Technician identity of recording technician
127 # HDR.REC.Doctor Identification of refering doctor
128 HDR.REC.Equipment recording equipment
129 HDR.REC.LOC 16 byte Latitude, Longitude and Altitude 3 x INT32 according to RFC1876
130 HDR.REC.IPaddr 4(16)xuint8 IP address of recording system
131 # HDR.REC.Reference reference (monopolar | CAR | LAR | Laplacian | Linked ears | weighted )
132 HDR.REC.Impedance NS*float32 [OBSOLETE] replaced with HDR.Impedance
133 HDR.ELEC.XYZ 3xNSxfloat32 sensor position in cartesion coordinates
134 HDR.ELEC.Orientation 3xNSxfloat32 sensor orientation in cartesion coordinates
135 HDR.ELEC.Area NSxfloat32 area [m^2] of (MEG) sensor
136 HDR.ELEC.REF 3xfloat32 position of reference electrode
137 HDR.ELEC.GND 3xfloat32 position of ground electrode
138
139 HDR.AS # provides some internal information
140 AS.SPR samples per record for each channel
141 AS.bpb bytes per block
142 AS.spb samples per block
143 AS.bi cumulative index
144 AS.SampleRate samplerate of each channel
145 AS.EVENTTABLEPOS position of eventtable
146
147
148 (B)======= FOR DATA ACQUISITION (T100) ONLY =======================
149 [OBSOLETE - MIGHT BE REMOVED IN FUTURE]
150
151 Name_of_field type example
152 -------------------------------------------------------------------------
153 HDR.T100.Version string 'BCI 0.10' testing state of RS's data aquisition module
154 'BCI 1.00' testing state of RS's data aquisition module
155 HDR.T100.AmpSens float Sensitivity of g.Tec-Amplifier
156 HDR.T100.Range float Maximum physical value in DAQ
157 HDR.T100.Bits integer Number of bits in ADC
158
159 HDR.T100.DAQ_ID <any> z.B. "NI 9876"
160 HDR.T100.AmpName string z.B. "g.tec: Ser.No: 01234567"
161 HDR.Filter.LowPass float [Hz]
162 HDR.Filter.HighPass float [Hz]
163 HDR.Filter.Notch int8 0=Off, 1=On
164
165 HDR.T0 float[1..6] [yyyy mm dd hh MM ss.cc] see HELP CLOCK (localtime)
166 HDR.tzmin int16 timezone information, number of minutes east of UTC
167 HDR.NS Integer number of channels
168 HDR.SampleRate Integer sampling frequency in [Hz]
169
170 HDR.Label char-array z.B. '+C3a - C3p '
171 HDR.PhysDim char-array 'uV '
172 -------------------------------------------------------------------------
173
174
175
176
177 (C) ================== Header of EDF-files ========================
178
179 This documents is based on the EDF-header as defined in the "EDF/GDF toolbox for Matlab"
180 It will be used as template to define the header information based on different formats
181
182 =================|=====|===============================|=======================================
183 field name level type and size text
184 =================|=1234|===============================|=======================================
185 EDF.
186 .FILE.
187 .FID * file identifier
188 .OPEN 2 | 1 | 0 set to 1 by EDFOPEN and set to 0 by EDFCLOSE
189 .Ext char(n) file extension, usually 'edf' or 'rec'
190 .Name # char(n) file name
191 .Path char(n) path
192 .POS * int Position in EDF-Blocks
193 .FileName char(n) full file name, including path,filename and extension
194 .VERSION * char(8) EDF field: Version
195 .PID # char(n) Patient ID: ##OBSOLETE## this field will be replaced with HDR.Patient.Id
196 .RID # char(n) Recording ID: ##OBSOLETE## this field will be replaced with HDR.ID.Recording
197 .T0 int(6) [yyyy mm dd hh MM ss] startdatetime of recording
198 .HeadLen * int Header Length
199 .NRec * int number of records
200 .Dur * float Duration of record
201 .NS *# int number of channels
202 .Label # char array [NS,:] Label
203 .Transducer # char array [NS,80] Transducer
204 .PhysDim # char array [NS,:] physical dimension
205 .PhysMin * float array [NS,1] physical minimum
206 .PhysMax * float array [NS,1] physical maximum
207 .DigMin * int array [NS,1] digital minimum
208 .DigMax * int array [NS,1] digital maximum
209 .PreFilt # char array [NS,80] Pre-filtering
210 .SPR * int array [NS,1] Samples per Record
211 .GDFTYP * int [NS] defines datatype of the channel
212 .Cal # float array [NS,1]
213 .Off # float array [NS,1]
214 .Calib float array [1+NS,NS]
215 .SampleRate # float array [NS,1]
216 .Chan_Select bool array [NS,1]
217 .ChanTyp char array [1,EDF.NS] indicates EEG, EOG, ECG, EMG, channel
218 HDR.ID.
219 .Recording Recording Identification
220 HDR.Patient...
221 .Id Patient Identification
222 .Sex Gender: 1: Male 2: Female
223 .Weigth
224 .Heigth
225 .Birth Birth date and time
226 .Name
227 .AS. undocumented
228 .bpb int
229 .spb int
230 .bi int array [1+NS,1]
231 .GDFbi int array [1+NS,1]
232 .INFO char array
233 .Method char array
234 .Date int(6)
235 =================|=====|===============================|=======================================
236 EDF.AS.startrec record number at beginning of last gdfread(...)
237 EDF.AS.numrec number of records loaded with last gdfread(...)
238
239 EDF.SIE ----------- fields for Version 0.50 and higher
240 EDF.SIE.RS switch for Resampling (0 = none)
241 EDF.SIE.RR switch for Calibration and ReReferinzing (0 = none)
242 EDF.SIE.TH Overflow detection (1=yes)
243 EDF.SIE.RAW Raw EDF format (1, each column contains one block)
244 EDF.SIE.AFIR apply AFIR (1=yes)
245
246 EDF.SIE.InChanSelect input channel selection, # read from Raw-EDF input file
247 EDF.SIE.ChanSelect (output) channel selection,
248
249 EDF.SIE.ReRefMx ReReferenzing Matrix
250 EDF.SIE.REG Regression Matrix
251
252
253 EDF.AFIR ----------- fields for Adaptive Filter for ECG minimization
254
255 =================|=====|===============================|=======================================
256
257 # level 4, application exported, always available in all future version (strict definition).
258 * level 3, transport EDF/GDF specific properties, useful for lower level EDF access,
259 level 2, access matlab specific fields, only used within the EDF toolbox, can change ithout further notices.
260 level 1, low level Binary representation as defined in the EDF specification,
261
262 Status of this document: Finished, not proofread yet.
263 (C) 1998 by Alois Schloegl
264 13.Nov.1998
265
266 This document holds at least for Version 3 of the "EDF toolbox for the use with Matlab".
267 All fields are case sensitive.
268
269 "not supported" means, you can not rely on that field.
270 char(n) is a char array, string
271 The types int, float, bool, are always stored in double.
272
273 The definition holds for Version #3.00 - #3.08 (current). Level 1,2 fields might change without further notice.
274 Further changes will be added at the end of this document. There should be none.
275
276
277 AMENDMENTS:
278 =) Changes due to the consideration of GDF:
279 The definition above holds for the "EDF/GDF toolbox for Matlab" Ver 0.40, too.
280 The following changes were performed.
281
282 =================|=====|===============================|=======================================
283 field name level type and size text
284 =================|=1234|===============================|=======================================
285 ~ (modified) 11:09 05.08.99 V0.56
286 .POS * int Position in EDF-Blocks
287
288 + (added) 11:09 12.05.99 V0.46
289 EDF.AS.startrec int
290 EDF.AS.numrec int
291
292 * (changed)
293 EDF.FILE.OPEN 2 | 1 | 0 set to 0,1 and 2 by EDFCLOSE, EDFOPEN(.,'r') and EDFOPEN(.,'w'), respectively
294
295 + (added)
296 EDF.GDFTYP * int [NS] defines datatype of the channel
297 EDF.AS.bpb int bytes per block
298 EDF.AS.GDFbi int bytes per block
299
300 - (removed)
301 .sPhysMin char array [NS,8] EDF field: physical minimum (8*ASCII)
302 .sPhysMax char array [NS,8] EDF field: physical maximum (8*ASCII)
303 =================|=====|===============================|=======================================