MNE-CPP  0.1.9
A Framework for Electrophysiology
fiff_types.h
Go to the documentation of this file.
1 //=============================================================================================================
37 #ifndef FIFF_TYPES_H
38 #define FIFF_TYPES_H
39 
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "fiff_constants.h"
45 
46 //=============================================================================================================
47 // EIGEN INCLUDES
48 //=============================================================================================================
49 
50 #include <Eigen/Core>
51 
52 //=============================================================================================================
53 // QT INCLUDES
54 //=============================================================================================================
55 
56 #include <QList>
57 #include <QStringList>
58 #include <QPair>
59 #include <QVariant>
60 
61 //=============================================================================================================
62 // DEFINE NAMESPACE FIFFLIB
63 //=============================================================================================================
64 
65 namespace FIFFLIB
66 {
67 
68 const static QStringList defaultQStringList = QStringList();
69 static Eigen::MatrixXd defaultMatrixXd = Eigen::MatrixXd::Constant(1,1,-1);
70 const static Eigen::MatrixXd defaultConstMatrixXd(0,0);
71 const static Eigen::MatrixXi defaultMatrixXi(0,0);
72 const static Eigen::VectorXi defaultVectorXi;
73 const static Eigen::RowVectorXi defaultRowVectorXi;
74 const static QPair<float,float> defaultFloatPair = qMakePair(-1.0f, -1.0f);
75 
76 typedef Eigen::Matrix<qint16, Eigen::Dynamic, Eigen::Dynamic> MatrixDau16;
77 typedef Eigen::Matrix<short, Eigen::Dynamic, Eigen::Dynamic> MatrixShort;
78 
79 //=============================================================================================================
80 // TYPEDEFS Primitive building blocks:
81 //=============================================================================================================
82 
83 typedef unsigned char fiff_byte_t;
84 typedef char fiff_char_t;
85 typedef qint16 fiff_short_t;
86 typedef quint16 fiff_ushort_t;
87 typedef qint32 fiff_int_t;
88 typedef quint32 fiff_uint_t;
89 typedef qint64 fiff_long_t;
90 typedef quint64 fiff_ulong_t;
91 typedef float fiff_float_t;
92 typedef double fiff_double_t;
93 typedef quint16 fiff_dau_pack13_t;
94 typedef quint16 fiff_dau_pack14_t;
95 typedef qint16 fiff_dau_pack16_t;
96 typedef qint32 fiff_julian_t;
97 typedef char fiff_data_t; //unsig char instead of void -> avoid void in C++ cause of its undefined behaviour using delete -> this can happen during lots of casting
98 
99 //=============================================================================================================
100 // TYPEDEFS Structured types:
101 //=============================================================================================================
102 
105 typedef struct _fiffTimeRec {
106  fiff_int_t secs;
107  fiff_int_t usecs;
108 } *fiffTime, fiffTimeRec;
112 //typedef struct _fiffDigStringRec {
113 // fiff_int_t kind; /**< Most commonly FIFF_POINT_EXTRA. */
114 // fiff_int_t ident; /**< Number identifying this string. */
115 // fiff_int_t np; /**< How many points. */
116 // fiff_float_t **rr; /**< Array of point locations. */
117 //} fiffDigStringRec, *fiffDigString;/**< Structure representing digitized strings. */
118 
119 //typedef fiffDigStringRec fiff_dig_string_t;
120 
121 /*
122  * The layered sphere model
123  */
124 
127 //typedef struct _fiffLayerRec {
128 // fiff_int_t id; /**< Id # of this layer (see below). */
129 // fiff_float_t rad; /**< Radius of this layer (m). */
130 //} *fiffLayer, fiffLayerRec; /**< Layer descriptor for a layered sphere model. */
131 
132 //=============================================================================================================
133 // TYPEDEF Following types are used by the fiff library. They are not used within the files.:
134 //=============================================================================================================
135 
138 //typedef struct _fiff_sparse_matrix {
139 // fiff_int_t coding; /**< coding (storage) type of the sparse matrix. */
140 // fiff_int_t m; /**< m rows. */
141 // fiff_int_t n; /**< n columns. */
142 // fiff_int_t nz; /**< nz nonzeros. */
143 // fiff_float_t *data; /**< owns the data. */
144 // fiff_int_t *inds; /**< index list, points into data, no dealloc!. */
145 // fiff_int_t *ptrs; /**< pointer list, points into data, no dealloc!. */
146 //} *fiffSparseMatrix, fiffSparseMatrixRec;
147 
148 //typedef fiffSparseMatrixRec fiff_sparse_matrix_t;
149 
152 //typedef struct _fiff_event_bits {
153 // fiff_int_t from_mask; /**< from mask. */
154 // fiff_int_t from_state; /**< from state. */
155 // fiff_int_t to_mask; /**< to mask. */
156 // fiff_int_t to_state; /**< to state. */
157 //} *fiffEventBits, fiffEventBitsRec;
158 
161 //typedef struct _fiff_hpi_coil {
162 // char *event_channel; /**< event channel. */
163 // fiffEventBitsRec event_bits; /**< event bits. */
164 // char *signal_channel; /**< signal channel. */
165 //} *fiffHpiCoil, fiffHpiCoilRec;
166 
169 //typedef struct _fiff_hpi_subsys {
170 // fiff_int_t ncoils; /**< number of hpi coils. */
171 // fiffHpiCoil coils; /**< hpi coils. */
172 //} *fiffHpiSubsys, fiffHpiSubsysRec;
173 
176 typedef struct _fiff_data_ref {
177  fiff_int_t type;
178  fiff_int_t endian;
179  fiff_long_t size;
180  fiff_long_t offset;
181 } *fiffDataRef,fiffDataRefRec;
182 
183 //=============================================================================================================
185 //=============================================================================================================
186 
188 
194 typedef struct _fiffTagRec {
195  fiff_int_t kind;
197  fiff_int_t type;
199  fiff_int_t size;
202  fiff_int_t next;
206  fiff_data_t *data;
208 } *fiffTag,fiffTagRec;
210 
218 typedef struct _fiffIdRec {
219  fiff_int_t version;
220  fiff_int_t machid[2];
221  fiffTimeRec time;
222 } *fiffId,fiffIdRec;
224 typedef fiffIdRec fiff_id_t;
225 
227 
229 typedef struct _fiffDirEntryRec {
230  fiff_int_t kind;
231  fiff_int_t type;
232  fiff_int_t size;
233  fiff_int_t pos;
236 } fiffDirEntryRec,*fiffDirEntry;
240 typedef fiffDirEntryRec fiff_dir_entry_t;
241 
243 
245 typedef struct _fiffDigPointRec {
246  fiff_int_t kind;
249  fiff_int_t ident;
250  fiff_float_t r[3];
251 } *fiffDigPoint,fiffDigPointRec;
255 //typedef fiffDigPointRec fiff_dig_point_t;
256 //typedef fiffDigStringRec fiff_dig_string_t;
257 
259 
260 /*----------------------------------------------------------------------
261  * Following types are used by the fiff library. They are not used
262  * within the files.
263  *---------------------------------------------------------------------*/
264 
267 //typedef struct _fiffDirNode {
268 // int type; /**< Block type for this directory. */
269 // fiffId id; /**< Id of this block if any. */
270 // fiffDirEntry dir; /**< Directory of tags in this node. */
271 // int nent; /**< Number of entries in this node. */
272 // fiffDirEntry dir_tree; /**< Directory of tags within this node
273 // * subtrees as well as FIFF_BLOCK_START and FIFF_BLOCK_END
274 // * included. NOTE: While dir is allocated separately
275 // * dir_tree is a pointer to the dirtree field
276 // * in the fiffFile structure. The dir_tree and nent_tree
277 // * fields are only used within the library to facilitate
278 // * certain operations. */
279 // int nent_tree; /**< Number of entries in the directory tree node. */
280 // struct _fiffDirNode *parent; /**< Parent node. */
281 // struct _fiffDirNode **children;/**< Child nodes. */
282 // int nchild; /**< Number of child nodes. */
283 //} fiffDirNodeRec,*fiffDirNode; /**< Directory tree structure used by the fiff library routines. */
284 
286 
288 //typedef struct _fiffFileRec {
289 // char *file_name; /**< Name of the file. */
290 // FILE *fd; /**< The normal file descriptor. */
291 // fiffId id; /**< The file identifier. */
292 // fiffDirEntry dir; /**< This is the directory.
293 // * If no directory exists, fiff_open
294 // * automatically scans the file to create one. */
295 // int nent; /**< How many entries?. */
296 // fiffDirNode dirtree; /**< Directory compiled into a tree. */
297 // char *ext_file_name; /**< Name of the file holding the external data. */
298 // FILE *ext_fd; /**< The file descriptor of the above file if open . */
299 //} *fiffFile,fiffFileRec; /**< FIFF file handle. fiff_open() returns this. */
300 
302 
304 //typedef struct _fiffCoordTransRec {
305 // fiff_int_t from; /**< Source coordinate system. */
306 // fiff_int_t to; /**< Destination coordinate system. */
307 // fiff_float_t rot[3][3]; /**< The forward transform (rotation part). */
308 // fiff_float_t move[3]; /**< The forward transform (translation part). */
309 // fiff_float_t invrot[3][3]; /**< The inverse transform (rotation part). */
310 // fiff_float_t invmove[3]; /**< The inverse transform (translation part). */
311 //} *fiffCoordTrans, fiffCoordTransRec; /**< Coordinate transformation descriptor. */
312 
313 //typedef fiffCoordTransRec fiff_coord_trans_t;
314 
316 
319 //typedef struct _fiffChPosRec {
320 // fiff_int_t coil_type; /**< What kind of coil. */
321 // fiff_float_t r0[3]; /**< Coil coordinate system origin. */
322 // fiff_float_t ex[3]; /**< Coil coordinate system x-axis unit vector. */
323 // fiff_float_t ey[3]; /**< Coil coordinate system y-axis unit vector. */
324 // fiff_float_t ez[3]; /**< Coil coordinate system z-axis unit vector. */
325 //} fiffChPosRec,*fiffChPos; /**< Measurement channel position and coil type. */
326 
327 //typedef fiffChPosRec fiff_ch_pos_t;
328 
330 
331 //typedef struct _fiffChInfoRec {
332 // fiff_int_t scanNo; /**< Scanning order number. */
333 // fiff_int_t logNo; /**< Logical channel #. */
334 // fiff_int_t kind; /**< Kind of channel. */
335 // fiff_float_t range; /**< Voltmeter range (-1 = auto ranging). */
336 // fiff_float_t cal; /**< Calibration from volts to units used. */
337 // fiff_ch_pos_t chpos; /**< Channel location. */
338 // fiff_int_t unit; /**< Unit of measurement. */
339 // fiff_int_t unit_mul; /**< Unit multiplier exponent. */
340 // fiff_char_t ch_name[16]; /**< Descriptive name for the channel. */
341 //} fiffChInfoRec,*fiffChInfo; /**< Description of one channel. */
342 
344 //typedef fiffChInfoRec fiff_ch_info_t;
345 
346 #define FIFFM_CHPOS(x) &((x)->chpos)
347 
348 }//NAMESPACE
349 
350 #endif // FIFF_TYPES_H
FIFFLIB::_fiff_data_ref::offset
fiff_long_t offset
Definition: fiff_types_mne-c.h:571
FIFFLIB::_fiff_data_ref::type
fiff_int_t type
Definition: fiff_types_mne-c.h:568
FIFFLIB::_fiffIdRec::time
fiffTimeRec time
Definition: fiff_types_mne-c.h:217
FIFFLIB::_fiffDigPointRec::r
fiff_float_t r[3]
Definition: fiff_types_mne-c.h:409
FIFFLIB::_fiffDirEntryRec::kind
fiff_int_t kind
Definition: fiff_types_mne-c.h:390
FIFFLIB::_fiffTimeRec::usecs
fiff_int_t usecs
Definition: fiff_types_mne-c.h:184
FIFFLIB::_fiffIdRec::machid
fiff_int_t machid[2]
Definition: fiff_types_mne-c.h:216
FIFFLIB::_fiff_data_ref::size
fiff_long_t size
Definition: fiff_types_mne-c.h:570
FIFFLIB::_fiffIdRec::version
fiff_int_t version
Definition: fiff_types_mne-c.h:215
fiff_constants.h
Fiff constants.
FIFFLIB::_fiffTagRec::next
fiff_int_t next
Definition: fiff_types_mne-c.h:165
FIFFLIB::_fiffTagRec::kind
fiff_int_t kind
Definition: fiff_types_mne-c.h:158
FIFFLIB::_fiffDirEntryRec::pos
fiff_int_t pos
Definition: fiff_types_mne-c.h:393
FIFFLIB::_fiffTagRec::size
fiff_int_t size
Definition: fiff_types_mne-c.h:162
FIFFLIB::_fiffTimeRec::secs
fiff_int_t secs
Definition: fiff_types_mne-c.h:183
FIFFLIB::_fiffDigPointRec::ident
fiff_int_t ident
Definition: fiff_types_mne-c.h:408
FIFFLIB::_fiffDirEntryRec::size
fiff_int_t size
Definition: fiff_types_mne-c.h:392
FIFFLIB::_fiffTagRec::type
fiff_int_t type
Definition: fiff_types_mne-c.h:160
FIFFLIB::_fiffTagRec::data
fiff_data_t * data
Definition: fiff_types_mne-c.h:169
FIFFLIB::_fiffDigPointRec::kind
fiff_int_t kind
Definition: fiff_types_mne-c.h:405
FIFFLIB::_fiffDirEntryRec::type
fiff_int_t type
Definition: fiff_types_mne-c.h:391
FIFFLIB::_fiff_data_ref::endian
fiff_int_t endian
Definition: fiff_types_mne-c.h:569