MNE-CPP  0.1.9
A Framework for Electrophysiology
fiff_file.h
Go to the documentation of this file.
1 //=============================================================================================================
37 #ifndef FIFF_FILE_H
38 #define FIFF_FILE_H
39 
40 //=============================================================================================================
41 // DEFINE NAMESPACE FIFFLIB
42 //=============================================================================================================
43 
44 namespace FIFFLIB
45 {
46 
47 /*
48  * Tag numbers < 100 are only used during the acquisition
49  * they will never appear in a fif file.
50  */
51 
52 /*
53  * Conventions with FIFF_ C macros (mjk 14.01.2000).
54  *===========================================================================
55  * In order to get some order into the FIFF_ macros,
56  * following macro types are proposed:
57  *
58  * FIFF_ Fiff tag object identification label.
59  * FIFFB_ Fiff block tag value (block type indentification label).
60  * FIFFV_ Enumerated value of data having definite meaning in some context.
61  * Would be nice if the context is also present like:
62  * FIFFV_HPI_ACCEPT_PROGRAM and FIFFV_HPI_ACCEPT_USER.
63  * FIFFC_ Independent constant value like FIFFC_MATRIX_MAX_DIM used in
64  * code (having meaning in 'programming context' but not as data).
65  * FIFFT_ Fiff type descriptor.
66  * FIFFTS_ Fiff type decriptor (FIFFT_) structure definition (see below).
67  *
68  *
69  *
70  * Conventions on type codes: (mjk 14.01.2000)
71  *===========================================================================
72  * Fiff types are saved using 32 bit numeric indentifiers.
73  * The fiff type codes are structured so that they contain two main parts:
74  * the 'fundamental structure' and 'type details'. The fundamental structure
75  * is coded in the MSB of the 4 byte code. Depending on this code the
76  * interpretation of 'type details' may vary.
77  *
78  * Current Fundamental structures:
79  *----------------------------------------------------------------------
80  * Only the MSB is significant. See FIFFTS_FS_MASK
81  *
82  * FIFFFS_SCALAR 0x00000000 Scalar type / basic fixed size FIFF record.
83  * FIFFFS_RECORD 0x10000000 <reserved>
84  * FIFFFS_...... 0x20000000 <reserved>
85  * FIFFFS_...... 0x30000000 <reserved>
86  * FIFFFS_MATRIX 0x40000000 Multidimensional matrix.
87  *
88  * The lower four bits are reserved for future extensions.
89  *
90  * Scalar types (FS==0x00):
91  *----------------------------------------------------------------------
92  * These include the basic scalar types and 'standard' fixed size records
93  * used in fiff files.
94  *
95  * * It is required that the code is less than 0x0FFF (< 4096). !!!
96  * * Fourth byte is currently reserved for future extensions.
97  *
98  * Current types in this class are:
99  *
100  * FIFFT_VOID 0 Nothing
101  * FIFFT_BYTE 1 Unsigned? 8 bits
102  * FIFFT_SHORT 2 Signed 16 bit integer.
103  * FIFFT_INT 3 Signed 32 bit integer.
104  * FIFFT_FLOAT 4 Single precision IEEE float (32 bits)
105  * FIFFT_DOUBLE 5 Double precision IEEE float (64 bits)
106  * FIFFT_JULIAN 6 Julian day. (32 bits)
107  * FIFFT_USHORT 7 Unsigned short (16 bits)
108  * FIFFT_UINT 8 Unsigned int (32 bits)
109  * FIFFT_ULONG 9 Unsigned long (64 bits)
110  * FIFFT_STRING 10 Octet, ASCII coding.
111  * FIFFT_ASCII 10
112  * FIFFT_LONG 11 Long integer (64 bit)
113  * FIFFT_DAU_PACK13 13 13 bit packed format used in HP DAUs.
114  * FIFFT_DAU_PACK14 14 14 bit packed format used in HP DAUs
115  * FIFFT_DAU_PACK16 16 Signed 16 bit integer. (?)
116  * FIFFT_COMPLEX_FLOAT 20 Complex number encoded with floats
117  * FIFFT_COMPLEX_DOUBLE 21 Complex number encoded with doubles
118  * FIFFT_OLD_PACK 23 Neuromag proprietary 16 bit packing.
119  *
120  * Following are structure types defined in fiff_types.h
121  *
122  * FIFFT_CH_INFO_STRUCT 30 Basic info about a measurement chnnel.
123  * FIFFT_ID_STRUCT 31 Unique identifier.
124  * FIFFT_DIR_ENTRY_STRUCT 32 FIFF file directory entry.
125  * FIFFT_DIG_POINT_STRUCT 33 Digitization point.
126  * FIFFT_CH_POS_STRUCT 34 Channel position.
127  * FIFFT_COORD_TRANS_STRUCT 35 Coordinate transformation.
128  * FIFFT_DIG_STRING_STRUCT 36 Digitization string.
129  * FIFFT_STREAM_SEGMENT_STRUCT 37 Data stream segment.
130  * FIFFT_DATA_REF_STRUCT 38 Reference to external data.
131  *
132  * Simple vector of any scalar type can be formed by simply
133  * concatenating into file. The number of of elements is deduced
134  * from the size of the data block which should be a multiple of the
135  * object size.
136  *
137  * Futher more, for each scalar type fiff_types.h defines a corresponding
138  * C language type. Naming convention is fiff_xxx_t which correspons to
139  * type id FIFFT_xxx.
140  *
141  *
142  *
143  * Matrix types (FS=0x40)
144  *----------------------------------------------------------------------
145  *
146  * FIFF Matrix type is in principle an arbitrary dimensional rectangular
147  * collection of fixed size elements. However for practical reasons the
148  * maximum dimension is currenly restricted arbitrarily to 9
149  * (see FIFFC_MATRIX_MAX_DIM) but this restriction may be relaxed in the future.
150  *
151  * Matrix type codes use following structure:
152  *
153  * * Matrix type structure: 0xFFCCyyyy
154  * * Where
155  *
156  * 0xFF...... decribes the 'fundamental structure'.
157  * FF = 40 denotes a multidimensional matrix.
158  * 0x..XX.... describes to basic coding: dense, triangular, sparse etc.
159  * 0x....yyyy describes the element type.
160  *
161  * Current codings available are:
162  *
163  * FIFFTS_MC_DENSE 0x00000000 Dense column oriented matrix
164  * FIFFTS_MC_CCS 0x00100000 Column compressed sparse matrix
165  * FIFFTS_MC_RCS 0x00200000 Row compressed sparse matrix
166  *
167  *
168  * Dense matrix structure
169  * ----------------------
170  *
171  * A(1,1,...),A(2,1...) ... A(1,2,..) ... A(N,M,K...),K,M,N, ...,DIM
172  *
173  * where DIM is the dimensionality.
174  * N,M,K... are the dimensions.
175  * A(i,j,k...) are the elements.
176  *
177  * Note: the 2-dimensional meg_matrix format (routines in fiff_matrix.c)
178  * read and write the matrix in transposed form, i.e, the storing order
179  * in the FIFF-file is
180  * A(1,1),A(1,2) ... A(1,M) ... A(M,M),N,M,DIM
181  *
182  *
183  * Column compressed sparse matrix structure
184  *------------------------------------------
185  *
186  * A(x0,y0,z0...),A(x1,y0,z0),...
187  * ...,x0,x2...,x{NZ-1}, y0,y1,...,y{M-1}, z0,z1...,z{K-1},...,NZ,K,M,N,...,DIM
188  *
189  * where DIM is the dimensionality.
190  * N,M,K... are the dimensions.
191  * NZ is the number of non zero elements.
192  * A(i,j,k...) are the elements.
193  * x0..x(NZ-1) is row index array (concatenated for all vectors)
194  * y0..y(M-1) is column start index array for the second dimension.
195  * z1..z(K-1) is slice start index array for the third dimension.
196  * etc.
197  * Index arrays are 0 based.
198  *
199  * Row compressed sparse matrix structure
200  *---------------------------------------
201  *
202  * Similar to column compresses version except that dimensions 1 and 2 are
203  * interchanged. Structurally exactly same as ccs_matrix of the transpose.
204  *
205  */
206 
207 /* Following definitions are needed only in programs that need to do
208  * some 'intelligent' operations depending on arbitrary types.
209  * They are rarely needed in user level code.
210  *
211  * FIFFTS_FS_MASK 'fundamental structure' bit mask.
212  * FIFFTS_BASE_MASK 'Scalar value' (base value) bit mask.
213  * FIFFTS_MC_MASK 'Basic matrix coding' bit mask.
214  *
215  * Using type code structure constants directly is depreciated. Use
216  * functions to test type properties.
217  */
218 
219 #define FIFFC_MAJOR_VERSION 1L
220 #define FIFFC_MINOR_VERSION 3L
221 
222 #define FIFFC_VERSION (FIFFC_MAJOR_VERSION<<16 | FIFFC_MINOR_VERSION)
223 
224 /*
225  * Constants for types
226  */
227 
228 #define FIFFT_VOID 0
229 #define FIFFT_BYTE 1
230 #define FIFFT_SHORT 2
231 #define FIFFT_INT 3
232 #define FIFFT_FLOAT 4
233 #define FIFFT_DOUBLE 5
234 #define FIFFT_JULIAN 6
235 #define FIFFT_USHORT 7
236 #define FIFFT_UINT 8
237 #define FIFFT_ULONG 9
238 #define FIFFT_STRING 10
239 #define FIFFT_ASCII 10
240 #define FIFFT_LONG 11
241 #define FIFFT_DAU_PACK13 13
242 #define FIFFT_DAU_PACK14 14
243 #define FIFFT_DAU_PACK16 16
244 #define FIFFT_COMPLEX_FLOAT 20
245 #define FIFFT_COMPLEX_DOUBLE 21
246 #define FIFFT_OLD_PACK 23
247 #define FIFFT_CH_INFO_STRUCT 30
248 #define FIFFT_ID_STRUCT 31
249 #define FIFFT_DIR_ENTRY_STRUCT 32
250 #define FIFFT_DIG_POINT_STRUCT 33
251 #define FIFFT_CH_POS_STRUCT 34
252 #define FIFFT_COORD_TRANS_STRUCT 35
253 #define FIFFT_DIG_STRING_STRUCT 36
254 #define FIFFT_STREAM_SEGMENT_STRUCT 37
255 #define FIFFT_DATA_REF_STRUCT 38
256 /*
257  * These are for matrices of any of the above
258  */
259 #define FIFFC_MATRIX_MAX_DIM 9
260 
261 #define FIFFTS_FS_MASK 0xFF000000
262 #define FIFFTS_BASE_MASK 0x00000FFF
263 #define FIFFTS_MC_MASK 0x00FF0000
264 
265 #define FIFFTS_FS_SCALAR 0x00000000
266 #define FIFFTS_FS_MATRIX 0x40000000
267 
268 #define FIFFTS_MC_DENSE 0x00000000
269 #define FIFFTS_MC_CCS 0x00100000
270 #define FIFFTS_MC_RCS 0x00200000
271 
272 #define FIFFT_MATRIX (FIFFTS_FS_MATRIX | FIFFTS_MC_DENSE)
273 #define FIFFT_CCS_MATRIX (FIFFTS_FS_MATRIX | FIFFTS_MC_CCS)
274 #define FIFFT_RCS_MATRIX (FIFFTS_FS_MATRIX | FIFFTS_MC_RCS)
275 
276 #define FIFFT_MATRIX_INT (FIFFT_MATRIX | FIFFT_INT)
277 #define FIFFT_MATRIX_FLOAT (FIFFT_MATRIX | FIFFT_FLOAT)
278 #define FIFFT_MATRIX_DOUBLE (FIFFT_MATRIX | FIFFT_DOUBLE)
279 #define FIFFT_CCS_MATRIX_FLOAT (FIFFT_CCS_MATRIX | FIFFT_FLOAT)
280 #define FIFFT_RCS_MATRIX_FLOAT (FIFFT_RCS_MATRIX | FIFFT_FLOAT)
281 
282 #define FIFFM_MESSAGE_GROUP(x) ((x) / 100 == 0)
283 
284 /*
285  * Real-time shmem
286  */
287 #define FIFF_NEW_FILE 1
288 #define FIFF_CLOSE_FILE 2
289 #define FIFF_DISCARD_FILE 3
290 #define FIFF_ERROR_MESSAGE 4
291 #define FIFF_SUSPEND_READING 5
292 #define FIFF_FATAL_ERROR_MESSAGE 6
293 #define FIFF_CONNECTION_CHECK 7
294 #define FIFF_SUSPEND_FILING 8
295 #define FIFF_RESUME_FILING 9
296 #define FIFF_RAW_PREBASE 10
297 #define FIFF_RAW_PICK_LIST 11
298 #define FIFF_ECHO 12
299 #define FIFF_RESUME_READING 13
300 #define FIFF_DACQ_SYSTEM_TYPE 14
301 #define FIFF_SELECT_RAW_CH 15
302 #define FIFF_PLAYBACK_MODE 16
303 #define FIFF_CONTINUE_FILE 17
304 #define FIFF_JITTER_MAX 18
305 #define FIFF_STREAM_SEGMENT 19
306 /*
307 define FIFF_DECIMATION_FACTOR 19 * Collector; not used anywhere?
308  */
309 
310 #define FIFFV_DACQ_SYSTEM_DAU 0
311 #define FIFFV_DACQ_SYSTEM_VXI 1
312 #define FIFFV_DACQ_SYSTEM_RPU 2
313 #define FIFFV_DACQ_SYSTEM_ORION 3
314 
315 #ifdef _DATA_SERVER
316 #define FIFF_MEM_DATA_BUFFER 10300
317 #endif
318 
319 /*
320  * Standard tags used in all blocks
321  */
322 
323 #define FIFF_FILE_ID 100
324 #define FIFF_DIR_POINTER 101
325 #define FIFF_DIR 102
326 #define FIFF_BLOCK_ID 103
327 #define FIFF_BLOCK_START 104
328 #define FIFF_BLOCK_END 105
329 #define FIFF_FREE_LIST 106
330 #define FIFF_FREE_BLOCK 107
331 #define FIFF_NOP 108
332 #define FIFF_PARENT_FILE_ID 109
333 #define FIFF_PARENT_BLOCK_ID 110
334 #define FIFF_BLOCK_NAME 111
335 #define FIFF_BLOCK_VERSION 112
336 #define FIFF_CREATOR 113
337 #define FIFF_MODIFIER 114
339 #define FIFF_REF_ROLE 115
340 #define FIFF_REF_FILE_ID 116
341 #define FIFF_REF_FILE_NUM 117
342 #define FIFF_REF_FILE_NAME 118
343 /* reserverd 119 */
344 #define FIFF_REF_BLOCK_ID 120
345 
346 /*
347  * Megacq saves the parameters in these tags
348  */
349 
350 #define FIFF_DACQ_PARS 150
351 #define FIFF_DACQ_STIM 151
352 
353 /*
354  * Structured objects (blocks)
355  */
356 
357 /*
358  * MEG/EEG
359  */
360 
361 #define FIFFB_ROOT 999
362 #define FIFFB_MEAS 100
363 #define FIFFB_MEAS_INFO 101
364 #define FIFFB_RAW_DATA 102
365 #define FIFFB_PROCESSED_DATA 103
366 #define FIFFB_EVOKED 104
367 #define FIFFB_MCG_AVE FIFFB_EVOKED
368 #define FIFFB_ASPECT 105
369 #define FIFFB_SUBJECT 106
370 #define FIFFB_ISOTRAK 107
371 #define FIFFB_HPI_MEAS 108
372 #define FIFFB_HPI_RESULT 109
373 #define FIFFB_HPI_COIL 110
374 #define FIFFB_PROJECT 111
375 #define FIFFB_CONTINUOUS_DATA 112
376 #define FIFFB_VOID 114
377 #define FIFFB_EVENTS 115
378 #define FIFFB_INDEX 116
379 #define FIFFB_DACQ_PARS 117
380 #define FIFFB_REF 118
382 #define FIFFB_SMSH_RAW_DATA 119
383 #define FIFFB_SMSH_ASPECT 120
384 #define FIFFB_HPI_SUBSYSTEM 121
386 /*
387  * MRI
388  */
389 
390 #define FIFFB_MRI 200
391 #define FIFFB_MRI_SET 201
392 #define FIFFB_MRI_SLICE 202
393 #define FIFFB_MRI_SCENERY 203
394 #define FIFFB_MRI_SCENE 204
395 #define FIFFB_MRI_SEG 205
396 #define FIFFB_MRI_SEG_REGION 206
398 /*
399  * Forward and inverse modelling
400  */
401 
402 #define FIFFB_SPHERE 300
403 #define FIFFB_BEM 310
404 #define FIFFB_BEM_SURF 311
405 #define FIFFB_CONDUCTOR_MODEL 312
406 #define FIFFB_XFIT_PROJ 313
407 #define FIFFB_XFIT_PROJ_ITEM 314
408 #define FIFFB_XFIT_AUX 315
409 #define FIFFB_PROJ FIFFB_XFIT_PROJ
410 #define FIFFB_PROJ_ITEM FIFFB_XFIT_PROJ_ITEM
411 /* 350...
412  * 370 Reserved for MNE estimates (MHa)
413  */
414 
415 #define FIFFB_BAD_CHANNELS 359
417 /*
418  * Volume info
419  */
420 #define FIFFB_VOL_INFO 400
421 
422 /*
423  * Sparse matrix, cross-talk correction, and SSS blocks
424  */
425 #define FIFFB_DATA_CORRECTION 500
426 #define FIFFB_CHANNEL_DECOUPLER 501
427 #define FIFFB_SSS_INFO 502
428 #define FIFFB_SSS_CAL_ADJUST 503
429 #define FIFFB_SSS_ST_INFO 504
430 #define FIFFB_SSS_BASES 505
432 #define FIFFB_SMARTSHIELD 510
434 /*
435  * Different aspects of data
436  */
437 
438 #define FIFFV_ASPECT_AVERAGE 100
439 #define FIFFV_ASPECT_STD_ERR 101
440 #define FIFFV_ASPECT_SINGLE 102
441 #define FIFFV_ASPECT_SUBAVERAGE 103
442 #define FIFFV_ASPECT_ALTAVERAGE 104
443 #define FIFFV_ASPECT_SAMPLE 105
444 #define FIFFV_ASPECT_POWER_DENSITY 106
445 #define FIFFV_ASPECT_DIPOLE_WAVE 200
447 /*
448  * Tags used in data files
449  */
450 
451 #define FIFF_UTC_OFFSET 159
453 #define FIFF_NCHAN 200
454 #define FIFF_SFREQ 201
455 #define FIFF_DATA_PACK 202
456 #define FIFF_CH_INFO 203
457 #define FIFF_MEAS_DATE 204
458 #define FIFF_SUBJECT 205
459 #define FIFF_COMMENT 206
460 #define FIFF_NAVE 207
461 #define FIFF_FIRST_SAMPLE 208
462 #define FIFF_LAST_SAMPLE 209
463 #define FIFF_ASPECT_KIND 210
464 #define FIFF_REF_EVENT 211
465 #define FIFF_EXPERIMENTER 212
466 #define FIFF_DIG_POINT 213
467 #define FIFF_CH_POS_VEC 214
468 #define FIFF_HPI_SLOPES 215
469 #define FIFF_HPI_NCOIL 216
470 #define FIFF_REQ_EVENT 217
471 #define FIFF_REQ_LIMIT 218
472 #define FIFF_LOWPASS 219
473 #define FIFF_BAD_CHS 220
474 #define FIFF_ARTEF_REMOVAL 221
475 #define FIFF_COORD_TRANS 222
476 #define FIFF_HIGHPASS 223
477 #define FIFF_CH_CALS_VEC 224
478 #define FIFF_HPI_BAD_CHS 225
479 #define FIFF_HPI_CORR_COEFF 226
480 #define FIFF_EVENT_COMMENT 227
481 #define FIFF_NO_SAMPLES 228
482 #define FIFF_FIRST_TIME 229
483 #define FIFF_SUBAVE_SIZE 230
484 #define FIFF_SUBAVE_FIRST 231
485 #define FIFF_NAME 233
486 #define FIFF_DESCRIPTION FIFF_COMMENT
487 #define FIFF_DIG_STRING 234
489 #define FIFF_LINE_FREQ 235
490 #define FIFF_HPI_COIL_FREQ 236
491 #define FIFF_SIGNAL_CHANNEL 237
493 #define FIFFC_HPI_MAX_NCOIL 1000
495 /*
496  *
497  * HPI fitting program tags
498  *
499  */
500 #define FIFF_HPI_COIL_MOMENTS 240
501 #define FIFF_HPI_FIT_GOODNESS 241
502 #define FIFF_HPI_FIT_ACCEPT 242
503 #define FIFF_HPI_FIT_GOOD_LIMIT 243
504 #define FIFF_HPI_FIT_DIST_LIMIT 244
505 #define FIFF_HPI_COIL_NO 245
506 #define FIFF_HPI_COILS_USED 246
508 #define FIFF_HPI_DIGITIZATION_ORDER 247
511 #define FIFFV_HPI_ACCEPT_PROGRAM (1<<0)
512 #define FIFFV_HPI_ACCEPT_USER (1<<1)
513 #define FIFFV_HPI_ACCEPT_NONE 0
517 #define FIFF_CH_SCAN_NO 250
518 #define FIFF_CH_LOGICAL_NO 251
519 #define FIFF_CH_KIND 252
520 #define FIFF_CH_RANGE 253
521 #define FIFF_CH_CAL 254
522 #define FIFF_CH_POS 255
523 #define FIFF_CH_UNIT 256
524 #define FIFF_CH_UNIT_MUL 257
525 #define FIFF_CH_DACQ_NAME 258
527 #define FIFF_SSS_FRAME 263
528 #define FIFF_SSS_JOB 264
529 #define FIFF_SSS_ORIGIN 265
530 #define FIFF_SSS_ORD_IN 266
531 #define FIFF_SSS_ORD_OUT 267
532 #define FIFF_SSS_NMAG 268
533 #define FIFF_SSS_COMPONENTS 269
534 #define FIFF_SSS_CAL_CHANS 270
535 #define FIFF_SSS_CAL_CORRS 271
536 #define FIFF_SSS_ST_CORR 272
538 #define FIFFV_SSS_JOB_NOTHING 0
539 #define FIFFV_SSS_JOB_CTC 1
540 #define FIFFV_SSS_JOB_FILTER 2
541 #define FIFFV_SSS_JOB_VIRT 3
542 #define FIFFV_SSS_JOB_HEAD_POS 4
543 #define FIFFV_SSS_JOB_MOVEC_FIT 5
544 #define FIFFV_SSS_JOB_MOVEC_QUA 6
545 #define FIFFV_SSS_JOB_REC_ALL 7
546 #define FIFFV_SSS_JOB_REC_IN 8
547 #define FIFFV_SSS_JOB_REC_OUT 9
548 #define FIFFV_SSS_JOB_ST 10
550 #define FIFF_SSS_BASE_IN 273
551 #define FIFF_SSS_BASE_OUT 274
552 #define FIFF_SSS_BASE_VIRT 275
553 #define FIFF_SSS_NORM 276
554 #define FIFF_SSS_ITERATE 277
555 #define FIFF_GANTRY_ANGLE 282
556 #define FIFF_DATA_BUFFER 300
557 #define FIFF_DATA_SKIP 301
558 #define FIFF_EPOCH 302
559 #define FIFF_DATA_SKIP_SAMP 303
560 #define FIFF_DATA_BUFFER2 304
561 #define FIFF_TIME_STAMP 305
563 #define FIFF_SUBJ_ID 400
564 #define FIFF_SUBJ_FIRST_NAME 401
565 #define FIFF_SUBJ_MIDDLE_NAME 402
566 #define FIFF_SUBJ_LAST_NAME 403
567 #define FIFF_SUBJ_BIRTH_DAY 404
568 #define FIFF_SUBJ_SEX 405
569 #define FIFF_SUBJ_HAND 406
570 #define FIFF_SUBJ_WEIGHT 407
571 #define FIFF_SUBJ_HEIGHT 408
572 #define FIFF_SUBJ_COMMENT 409
573 #define FIFF_SUBJ_HIS_ID 410
575 #define FIFF_PROJ_ID 500
576 #define FIFF_PROJ_NAME 501
577 #define FIFF_PROJ_AIM 502
578 #define FIFF_PROJ_PERSONS 503
579 #define FIFF_PROJ_COMMENT 504
583 #define FIFFV_SEX_UNKNOWN 0
584 #define FIFFV_SEX_MALE 1
585 #define FIFFV_SEX_FEMALE 2
586 
587 #define FIFFV_HAND_RIGHT 1
588 #define FIFFV_HAND_LEFT 2
589 #define FIFFV_HAND_AMBIDEXTROUS 3
590 
591 /*
592  * Event list saving...
593  */
594 #define FIFF_EVENT_CHANNELS 600
595 #define FIFF_EVENT_LIST 601
597 /*
598  * Event spec tags
599  */
600 #define FIFF_EVENT_CHANNEL 602
601 #define FIFF_EVENT_BITS 603
603 /*
604  * Event bitmask constants
605  */
606 #define FIFFC_EVENT_FROMMASK 0
607 #define FIFFC_EVENT_FROMBITS 1
608 #define FIFFC_EVENT_TOMASK 2
609 #define FIFFC_EVENT_TOBITS 3
610 
611 /*
612  * Tags used in saving SQUID characteristics etc.
613  */
614 #define FIFF_SQUID_BIAS 701
615 #define FIFF_SQUID_OFFSET 702
616 #define FIFF_SQUID_GATE 703
617 
618 /*
619  * Tags for sparse matrices
620  */
621 #define FIFF_DECOUPLER_MATRIX 800
622 #define FIFF_SPARSE_CH_NAME_LIST FIFF_PROJ_ITEM_CH_NAME_LIST
623 
624 /*
625  * Processing history tags
626  */
627 #define FIFFB_PROCESSING_HISTORY 900
628 #define FIFFB_PROCESSING_RECORD 901
633 #define FIFFV_ASPECT_IFII_LOW 1100
634 #define FIFFV_ASPECT_IFII_HIGH 1101
635 #define FIFFV_ASPECT_GATE 1102
636 /*
637  * References
638  */
639 #define FIFF_REF_PATH 1101
640 /*
641  * MRI...
642  */
643 #define FIFF_MRI_SOURCE_PATH FIFF_REF_PATH
644 #define FIFF_MRI_SOURCE_FORMAT 2002
645 #define FIFF_MRI_PIXEL_ENCODING 2003
646 #define FIFF_MRI_PIXEL_DATA_OFFSET 2004
647 #define FIFF_MRI_PIXEL_SCALE 2005
648 #define FIFF_MRI_PIXEL_DATA 2006
649 #define FIFF_MRI_PIXEL_OVERLAY_ENCODING 2007
650 #define FIFF_MRI_PIXEL_OVERLAY_DATA 2008
651 
652 #define FIFF_MRI_BOUNDING_BOX 2009
653 #define FIFF_MRI_WIDTH 2010
654 #define FIFF_MRI_WIDTH_M 2011
655 #define FIFF_MRI_HEIGHT 2012
656 #define FIFF_MRI_HEIGHT_M 2013
657 #define FIFF_MRI_DEPTH 2014
658 #define FIFF_MRI_DEPTH_M 2015
659 #define FIFF_MRI_THICKNESS 2016
660 #define FIFF_MRI_SCENE_AIM 2017
661 
662 #define FIFF_MRI_ORIG_SOURCE_PATH 2020
663 #define FIFF_MRI_ORIG_SOURCE_FORMAT 2021
664 #define FIFF_MRI_ORIG_PIXEL_ENCODING 2022
665 #define FIFF_MRI_ORIG_PIXEL_DATA_OFFSET 2023
666 
667 #define FIFF_MRI_VOXEL_DATA 2030
668 #define FIFF_MRI_VOXEL_ENCODING 2031
669 
670 #define FIFF_MRI_MRILAB_SETUP 2100
671 
672 #define FIFF_MRI_SEG_REGION_ID 2200
673 
674 /*
675  * FIFF_MRI_SOURCE_FORMAT can be one of the following
676  * A missing FIFF_MRI_SOURCE_FORMAT tag
677  * indicates that the data is actually in the
678  * fiff itself (= FIFF_MRI_FORMAT_FIFF)
679  *
680  * If the source format is FIFF_MRI_FORMAT_FIFF
681  * the tags FIFF_MRI_PIXEL_ENCODING and FIFF_MRI_PIXEL_DATA_OFFSET
682  * are missing and should be found by the software loading the data
683  * from the FIFF_MRI_PIXEL_DATA tag.
684  *
685  */
686 #define FIFFV_MRI_FORMAT_UNKNOWN 0
687 #define FIFFV_MRI_FORMAT_MAGNETOM_SHORT 1
688 #define FIFFV_MRI_FORMAT_MAGNETOM_LONG 2
689 #define FIFFV_MRI_FORMAT_MERIT 3
690 #define FIFFV_MRI_FORMAT_SIGNA 4
691 #define FIFFV_MRI_FORMAT_PIXEL_RAW 5
692 #define FIFFV_MRI_FORMAT_PIXEL_RAW_PACKED 6
693 #define FIFFV_MRI_FORMAT_MAGNETOM_NEW 7
694 #define FIFFV_MRI_FORMAT_FIFF 8
695 #define FIFFV_MRI_FORMAT_ACR_NEMA 9
696 #define FIFFV_MRI_FORMAT_DICOM_3 10
697 #define FIFFV_MRI_FORMAT_VISTA 11
698 /*
699  * FIFF_MRI_PIXEL_ENCODING is one of the following
700  */
701 #define FIFFV_MRI_PIXEL_UNKNOWN 0
702 #define FIFFV_MRI_PIXEL_BYTE 1
703 #define FIFFV_MRI_PIXEL_WORD 2
704 #define FIFFV_MRI_PIXEL_SWAP_WORD 3
705 #define FIFFV_MRI_PIXEL_FLOAT 4
706 #define FIFFV_MRI_PIXEL_BYTE_INDEXED_COLOR 5
707 #define FIFFV_MRI_PIXEL_BYTE_RGB_COLOR 6
708 #define FIFFV_MRI_PIXEL_BYTE_RLE_RGB_COLOR 7
709 #define FIFFV_MRI_PIXEL_BIT_RLE 8
710 /*
711  * Forward and inverse modelling...
712  */
713 /*
714  * Sphere model (3000...)
715  */
716 #define FIFF_CONDUCTOR_MODEL_KIND 3000
717 /*
718  * These are the models we support
719  */
720 #define FIFFV_COND_MODEL_UNKNOWN 0
721 #define FIFFV_COND_MODEL_SPHERE 1
722 #define FIFFV_COND_MODEL_BEM_HOMOG 2
723 #define FIFFV_COND_MODEL_BEM 3
725 #define FIFF_SPHERE_ORIGIN 3001
726 #define FIFF_SPHERE_COORD_FRAME 3002
727 #define FIFF_SPHERE_LAYERS 3003
728 /*
729  * Surfaces for BEM (3100...)
730  */
731 #define FIFF_BEM_SURF_ID 3101
732 #define FIFF_BEM_SURF_NAME 3102
733 #define FIFF_BEM_SURF_NNODE 3103
734 #define FIFF_BEM_SURF_NTRI 3104
735 #define FIFF_BEM_SURF_NODES 3105
736 #define FIFF_BEM_SURF_TRIANGLES 3106
737 #define FIFF_BEM_SURF_NORMALS 3107
738 #define FIFF_BEM_SURF_CURVS 3108
739 #define FIFF_BEM_SURF_CURV_VALUES 3109
741 #define FIFF_BEM_POT_SOLUTION 3110
742 #define FIFF_BEM_APPROX 3111
743 #define FIFF_BEM_COORD_FRAME 3112
744 #define FIFF_BEM_SIGMA 3113
745 /*
746  * FIFF_BEM_SURF_ID can be one of the following
747  */
748 #define FIFFV_BEM_SURF_ID_UNKNOWN -1
749 #define FIFFV_BEM_SURF_ID_BRAIN 1
750 #define FIFFV_BEM_SURF_ID_CSF 2
751 #define FIFFV_BEM_SURF_ID_SKULL 3
752 #define FIFFV_BEM_SURF_ID_HEAD 4
753 
754 #define FIFFV_BEM_SURF_ID_BLOOD 11
755 #define FIFFV_BEM_SURF_ID_HEART 12
756 #define FIFFV_BEM_SURF_ID_LUNGS 13
757 #define FIFFV_BEM_SURF_ID_TORSO 14
758 
759 #define FIFFV_BEM_SURF_ID_NM122 21
760 #define FIFFV_BEM_SURF_UNIT_SPHERE 22
761 #define FIFFV_BEM_SURF_ID_VV 23
762 /*
763  * FIFF_MRI_SEG_REGION_ID can be one of the following
764  */
765 #define FIFFV_SEG_REGION_ID_UNKNOWN FIFF_BEM_SURF_ID_UNKNOWN
766 #define FIFFV_SEG_REGION_ID_BRAIN FIFF_BEM_SURF_ID_BRAIN
767 #define FIFFV_SEG_REGION_ID_CSF FIFF_BEM_SURF_ID_CSF
768 #define FIFFV_SEG_REGION_ID_SKULL FIFF_BEM_SURF_ID_SKULL
769 #define FIFFV_SEG_REGION_ID_HEAD FIFF_BEM_SURF_ID_HEAD
770 
771 #define FIFFV_SEG_REGION_ID_BLOOD FIFF_BEM_SURF_ID_BLOOD
772 #define FIFFV_SEG_REGION_ID_HEART FIFF_BEM_SURF_ID_HEART
773 #define FIFFV_SEG_REGION_ID_LUNGS FIFF_BEM_SURF_ID_LUNGS
774 #define FIFFV_SEG_REGION_ID_TORSO FIFF_BEM_SURF_ID_TORSO
775 /*
776  * FIFF_BEM_APPROX
777  */
778 #define FIFFV_BEM_APPROX_CONST 1
779 #define FIFFV_BEM_APPROX_LINEAR 2
780 /*
781  * Source descriptions (3200...)
782  * The dipole is six floats (position and dipole moment)
783  */
784 #define FIFF_SOURCE_DIPOLE 3201
785 /*
786  * These tags are used by xfit
787  */
788 #define FIFF_XFIT_LEAD_PRODUCTS 3401
789 #define FIFF_XFIT_MAP_PRODUCTS 3402
790 #define FIFF_XFIT_GRAD_MAP_PRODUCTS 3403
791 #define FIFF_XFIT_VOL_INTEGRATION 3404
792 #define FIFF_XFIT_INTEGRATION_RADIUS 3405
793 #define FIFF_XFIT_CONDUCTOR_MODEL_NAME 3406
794 #define FIFF_XFIT_CONDUCTOR_MODEL_TRANS_NAME 3407
795 #define FIFF_XFIT_CONT_SURF_TYPE 3408
797 /*
798  * These relate to linear projection
799  */
800 #define FIFF_PROJ_ITEM_KIND 3411
801 #define FIFF_PROJ_ITEM_TIME 3412
802 #define FIFF_PROJ_ITEM_DIPOLE FIFF_SOURCE_DIPOLE
803 #define FIFF_PROJ_ITEM_IGN_CHS 3413
804 #define FIFF_PROJ_ITEM_NVEC 3414
805 #define FIFF_PROJ_ITEM_VECTORS 3415
806 #define FIFF_PROJ_ITEM_COMMENT FIFF_COMMENT
807 #define FIFF_PROJ_ITEM_DESCRIPTION FIFF_DESCRIPTION
808 #define FIFF_PROJ_ITEM_DEFINITION 3416
809 #define FIFF_PROJ_ITEM_CH_NAME_LIST 3417
810 
811 #define FIFF_XFIT_PROJ_ITEM_KIND FIFF_PROJ_ITEM_KIND
812 #define FIFF_XFIT_PROJ_ITEM_TIME FIFF_PROJ_ITEM_TIME
813 #define FIFF_XFIT_PROJ_ITEM_DIPOLE FIFF_PROJ_ITEM_DIPOLE
814 #define FIFF_XFIT_PROJ_ITEM_IGN_CHS FIFF_PROJ_ITEM_IGN_CHS
815 #define FIFF_XFIT_PROJ_ITEM_NVEC FIFF_PROJ_ITEM_NVEC
816 #define FIFF_XFIT_PROJ_ITEM_VECTORS FIFF_PROJ_ITEM_VECTORS
817 #define FIFF_XFIT_PROJ_ITEM_COMMENT FIFF_PROJ_ITEM_COMMENT
818 /*
819  * The FIFF_PROJ_ITEM_KIND is an integer,
820  * one of the following
821  */
822 #define FIFFV_PROJ_ITEM_NONE 0
823 #define FIFFV_PROJ_ITEM_FIELD 1
824 #define FIFFV_PROJ_ITEM_DIP_FIX 2
825 #define FIFFV_PROJ_ITEM_DIP_ROT 3
826 #define FIFFV_PROJ_ITEM_HOMOG_GRAD 4
827 #define FIFFV_PROJ_ITEM_HOMOG_FIELD 5
828 #define FIFFV_PROJ_ITEM_EEG_AVREF 10
829 
830 #define FIFFV_XFIT_PROJ_ITEM_NONE FIFFV_PROJ_ITEM_NONE
831 #define FIFFV_XFIT_PROJ_ITEM_FIELD FIFFV_PROJ_ITEM_FIELD
832 #define FIFFV_XFIT_PROJ_ITEM_DIP_FIX FIFFV_PROJ_ITEM_DIP_FIX
833 #define FIFFV_XFIT_PROJ_ITEM_DIP_ROT FIFFV_PROJ_ITEM_DIP_ROT
834 #define FIFFV_XFIT_PROJ_ITEM_HOMOG_GRAD FIFFV_PROJ_ITEM_HOMOG_GRAD
835 #define FIFFV_XFIT_PROJ_ITEM_HOMOG_FIELD FIFFV_PROJ_ITEM_HOMOG_FIELD
836 
837 #define FIFF_XPLOTTER_LAYOUT 3501
839 /* FIFF_MNE_xxxx 3502
840  * ...
841  * Reserved for MNE data 3799
842  */
843 #define FIFF_CH_NAME_LIST 3507
845 /*
846  * These occur in the volume info files
847  */
848 #define FIFF_VOL_ID 4001
849 #define FIFF_VOL_NAME 4002
850 #define FIFF_VOL_OWNER_ID 4003
851 #define FIFF_VOL_OWNER_NAME 4004
852 #define FIFF_VOL_OWNER_REAL_NAME 4005
853 #define FIFF_VOL_TYPE 4006
854 #define FIFF_VOL_HOST 4007
855 #define FIFF_VOL_REAL_ROOT 4008
856 #define FIFF_VOL_SYMBOLIC_ROOT 4009
857 #define FIFF_VOL_MOUNT_POINT 4010
858 #define FIFF_VOL_BLOCKS 4011
859 #define FIFF_VOL_FREE_BLOCKS 4012
860 #define FIFF_VOL_AVAIL_BLOCKS 4013
861 #define FIFF_VOL_BLOCK_SIZE 4014
862 #define FIFF_VOL_DIRECTORY 4015
863 /*
864  * Index
865  */
866 #define FIFF_INDEX_KIND 5001
867 #define FIFF_INDEX 5002
868 
869 /*======================================================================
870  * Enumerated types used as tag values.
871  *
872  *=====================================================================*/
873 
874 /*
875  * Values for FIFF_REF_ROLE. The role of a reference
876  */
877 #define FIFFV_ROLE_PREV_FILE 1
878 #define FIFFV_ROLE_NEXT_FILE 2
879 
880 /*
881  * Method by which a projection is defined (FIFF_PROJ_ITEM_DEFINITION).
882  * If tag is not present, FIFF_PROJ_BY_COMPLEMENT should be assumed.
883  */
884 #define FIFFV_PROJ_BY_COMPLEMENT 0
885 #define FIFFV_PROJ_BY_SPACE 1
886 
887 /*
888  * Volume types used in FIFF_VOL_TYPE
889  */
890 
891 #define FIFFV_VOL_TYPE_HD 1
892 #define FIFFV_VOL_TYPE_MOD 2
894 /*
895  * Byte order
896  */
897 #define FIFFV_NATIVE_ENDIAN 0
898 #define FIFFV_LITTLE_ENDIAN 1
899 #define FIFFV_BIG_ENDIAN 2
900 } // NAMESPACE
902 #endif // FIFF_FILE_H