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