v2.0.0
Loading...
Searching...
No Matches
fiff_tag.cpp
Go to the documentation of this file.
1//=============================================================================================================
20
21//=============================================================================================================
22// INCLUDES
23//=============================================================================================================
24
25#include "fiff_tag.h"
26#include "fiff_byte_swap.h"
27
28#include <complex>
29
30//=============================================================================================================
31// QT INCLUDES
32//=============================================================================================================
33
34#include <QTcpSocket>
35#include <QDebug>
36
37//=============================================================================================================
38// USED NAMESPACES
39//=============================================================================================================
40
41using namespace FIFFLIB;
42
43//=============================================================================================================
44// DEFINE MEMBER METHODS
45//=============================================================================================================
46
48: kind(0)
49, type(0)
50, next(0)
51//, m_pComplexFloatData(NULL)
52//, m_pComplexDoubleData(NULL)
53{
54}
55
56//=============================================================================================================
57
59{
60 return IS_MATRIX & this->type;
61}
62
63//=============================================================================================================
64
66{
67 if (this->getMatrixCoding() != 0)
68 return true;
69 else
70 return false;
71}
72
73//=============================================================================================================
74
75bool FiffTag::getMatrixDimensions(qint32& p_ndim, QVector<qint32>& p_Dims) const
76{
77 p_Dims.clear();
78 if (!this->isMatrix() || this->data() == nullptr) {
79 p_ndim = 0;
80 return false;
81 }
82
83 //
84 // Find dimensions and return to the beginning of tag data
85 //
86 qint32* t_pInt32 = (qint32*)this->data();
87
88 p_ndim = t_pInt32[(this->size() - 4) / 4];
89
91 for (int i = p_ndim + 1; i > 1; --i)
92 p_Dims.append(t_pInt32[(this->size() - (i * 4)) / 4]);
94 for (int i = p_ndim + 2; i > 1; --i)
95 p_Dims.append(t_pInt32[(this->size() - (i * 4)) / 4]);
96 else {
97 qWarning("Cannot handle other than dense or sparse matrices yet.");
98 return false;
99 }
100
101 return true;
102}
103
104//=============================================================================================================
105
107{
108 if (this->isMatrix()) {
109 return DATA_TYPE & this->type;
110 } else {
111 return this->type;
112 }
113}
114
115//=============================================================================================================
116
117QString FiffTag::getInfo() const
118{
119 QString t_qStringInfo;
120
121 if (this->isMatrix()) {
122 switch (this->getType()) {
123 case FIFFT_INT:
124 t_qStringInfo = "Matrix of type FIFFT_INT";
125 break;
126 case FIFFT_JULIAN:
127 t_qStringInfo = "Matrix of type FIFFT_JULIAN";
128 break;
129 case FIFFT_FLOAT:
130 t_qStringInfo = "Matrix of type FIFFT_FLOAT";
131 break;
132 case FIFFT_DOUBLE:
133 t_qStringInfo = "Matrix of type FIFFT_DOUBLE";
134 break;
136 t_qStringInfo = "Matrix of type FIFFT_COMPLEX_FLOAT";
137 break;
139 t_qStringInfo = "Matrix of type FIFFT_COMPLEX_DOUBLE";
140 break;
141 default:
142 t_qStringInfo = "Matrix of unknown type";
143 }
144 } else {
145 switch (this->getType()) {
146 //
147 // Simple types
148 //
149 case FIFFT_BYTE:
150 t_qStringInfo = "Simple type FIFFT_BYTE";
151 break;
152 case FIFFT_SHORT:
153 t_qStringInfo = "Simple type FIFFT_SHORT";
154 break;
155 case FIFFT_INT:
156 t_qStringInfo = "Simple type FIFFT_INT";
157 break;
158 case FIFFT_USHORT:
159 t_qStringInfo = "Simple type FIFFT_USHORT";
160 break;
161 case FIFFT_UINT:
162 t_qStringInfo = "Simple type FIFFT_UINT";
163 break;
164 case FIFFT_JULIAN:
165 t_qStringInfo = "Simple type FIFFT_JULIAN";
166 break;
167 case FIFFT_FLOAT:
168 t_qStringInfo = "Simple type FIFFT_FLOAT";
169 break;
170 case FIFFT_DOUBLE:
171 t_qStringInfo = "Simple type FIFFT_DOUBLE";
172 break;
173 case FIFFT_STRING:
174 t_qStringInfo = "Simple type FIFFT_STRING";
175 break;
176 case FIFFT_DAU_PACK16:
177 t_qStringInfo = "Simple type FIFFT_DAU_PACK16";
178 break;
180 t_qStringInfo = "Simple type FIFFT_COMPLEX_FLOAT";
181 break;
183 t_qStringInfo = "Simple type FIFFT_COMPLEX_DOUBLE";
184 break;
185 //
186 // Structures
187 //
188 case FIFFT_ID_STRUCT:
189 t_qStringInfo = "Structure FIFFT_ID_STRUCT";
190 break;
192 t_qStringInfo = "Structure FIFFT_DIG_POINT_STRUCT";
193 break;
195 t_qStringInfo = "Structure FIFFT_COORD_TRANS_STRUCT";
196 break;
198 t_qStringInfo = "Structure FIFFT_CH_INFO_STRUCT";
199 break;
200 case FIFFT_OLD_PACK:
201 t_qStringInfo = "Structure FIFFT_OLD_PACK";
202 break;
204 t_qStringInfo = "Structure FIFFT_DIR_ENTRY_STRUCT";
205 break;
206 default:
207 t_qStringInfo = "Structure unknown";
208 }
209 }
210 return t_qStringInfo;
211}
212
213//=============================================================================================================
214
215/*---------------------------------------------------------------------------
216 *
217 * Motorola like Architectures
218 *
219 * Fif file bit and byte orderings are defined to be as in HP-UX.
220 *
221 *--------------------------------------------------------------------------*/
222
223//#ifdef BIG_ENDIAN_ARCH
224
225//void FiffTag::fiff_convert_tag_info(FiffTag*& tag)
226//{
227// return;
228//}
229
230//#endif
231
232//#ifdef INTEL_X86_ARCH
234// */
235
236//void FiffTag::fiff_convert_tag_info(FiffTag*& tag)
237
238//{
239// tag->kind = swap_int(tag->kind);
240// tag->type = swap_int(tag->type);
241// tag->size = swap_int(tag->size);
242// tag->next = swap_int(tag->next);
243// return;
244//}
245
246//#endif /* INTEL_X86_ARCH */
247
248//=============================================================================================================
249
251{
252 int k;
253 pos->coil_type = swap_int(pos->coil_type);
254 for (k = 0; k < 3; k++) {
255 swap_floatp(&pos->r0[k]);
256 swap_floatp(&pos->ex[k]);
257 swap_floatp(&pos->ey[k]);
258 swap_floatp(&pos->ez[k]);
259 }
260 return;
261}
262
263//=============================================================================================================
264
266/*
267 * Assumes that the input is in the non-native byte order and needs to be swapped to the other one
268 */
269{
270 int ndim;
271 int k;
272 int *dimp, *data, kind, np, nz;
273 float* fdata;
274 double* ddata;
275 unsigned int tsize = tag->size();
276
277 if (fiff_type_fundamental(tag->type) != FIFFTS_FS_MATRIX)
278 return;
279 if (tag->data() == nullptr)
280 return;
281 if (tsize < sizeof(fiff_int_t))
282 return;
283
284 dimp = ((fiff_int_t*)((tag->data()) + tag->size() - sizeof(fiff_int_t)));
285 swap_intp(dimp);
286 ndim = *dimp;
287 if (fiff_type_matrix_coding(tag->type) == FIFFTS_MC_DENSE) {
288 if (tsize < (ndim + 1) * sizeof(fiff_int_t))
289 return;
290 dimp = dimp - ndim;
291 for (k = 0, np = 1; k < ndim; k++) {
292 swap_intp(dimp + k);
293 np = np * dimp[k];
294 }
295 } else {
296 if (tsize < (ndim + 2) * sizeof(fiff_int_t))
297 return;
298 if (ndim > 2) /* Not quite sure what to do */
299 return;
300 dimp = dimp - ndim - 1;
301 for (k = 0; k < ndim + 1; k++)
302 swap_intp(dimp + k);
303 nz = dimp[0];
304 if (fiff_type_matrix_coding(tag->type) == FIFFTS_MC_CCS)
305 np = nz + dimp[2] + 1; /* nz + n + 1 */
306 else if (fiff_type_matrix_coding(tag->type) == FIFFTS_MC_RCS)
307 np = nz + dimp[1] + 1; /* nz + m + 1 */
308 else
309 return; /* Don't know what to do */
310 /*
311 * Take care of the indices
312 */
313 for (data = (int*)(tag->data()) + nz, k = 0; k < np; k++)
314 swap_intp(data + k);
315 np = nz;
316 }
317 /*
318 * Now convert data...
319 */
320 kind = fiff_type_base(tag->type);
321 if (kind == FIFFT_INT) {
322 for (data = (int*)(tag->data()), k = 0; k < np; k++)
323 swap_intp(data + k);
324 } else if (kind == FIFFT_FLOAT) {
325 for (fdata = (float*)(tag->data()), k = 0; k < np; k++)
326 swap_floatp(fdata + k);
327 } else if (kind == FIFFT_DOUBLE) {
328 for (ddata = (double*)(tag->data()), k = 0; k < np; k++)
329 swap_doublep(ddata + k);
330 } else if (kind == FIFFT_COMPLEX_FLOAT) {
331 for (fdata = (float*)(tag->data()), k = 0; k < 2 * np; k++)
332 swap_floatp(fdata + k);
333 } else if (kind == FIFFT_COMPLEX_DOUBLE) {
334 for (ddata = (double*)(tag->data()), k = 0; k < 2 * np; k++)
335 swap_doublep(ddata + k);
336 }
337 return;
338}
339
340//=============================================================================================================
341
343/*
344 * Assumes that the input is in the NATIVE_ENDIAN byte order and needs to be swapped to the other one
345 */
346{
347 int ndim;
348 int k;
349 int *dimp, *data, kind, np;
350 float* fdata;
351 double* ddata;
352 unsigned int tsize = tag->size();
353
354 if (fiff_type_fundamental(tag->type) != FIFFTS_FS_MATRIX)
355 return;
356 if (tag->data() == nullptr)
357 return;
358 if (tsize < sizeof(fiff_int_t))
359 return;
360
361 dimp = ((fiff_int_t*)(((char*)tag->data()) + tag->size() - sizeof(fiff_int_t)));
362 ndim = *dimp;
363 swap_intp(dimp);
364
365 if (fiff_type_matrix_coding(tag->type) == FIFFTS_MC_DENSE) {
366 if (tsize < (ndim + 1) * sizeof(fiff_int_t))
367 return;
368 dimp = dimp - ndim;
369 for (k = 0, np = 1; k < ndim; k++) {
370 np = np * dimp[k];
371 swap_intp(dimp + k);
372 }
373 } else {
374 if (tsize < (ndim + 2) * sizeof(fiff_int_t))
375 return;
376 if (ndim > 2) /* Not quite sure what to do */
377 return;
378 dimp = dimp - ndim - 1;
379 const int nz = dimp[0];
380 if (fiff_type_matrix_coding(tag->type) == FIFFTS_MC_CCS)
381 np = nz + dimp[2] + 1; /* nz + n + 1 */
382 else if (fiff_type_matrix_coding(tag->type) == FIFFTS_MC_RCS)
383 np = nz + dimp[1] + 1; /* nz + m + 1 */
384 else
385 return; /* Don't know what to do */
386 for (k = 0; k < ndim + 1; k++)
387 swap_intp(dimp + k);
388 for (data = (int*)(tag->data()) + nz, k = 0; k < np; k++)
389 swap_intp(data + k);
390 np = nz;
391 }
392 /*
393 * Now convert data...
394 */
395 kind = fiff_type_base(tag->type);
396 if (kind == FIFFT_INT) {
397 for (data = (int*)(tag->data()), k = 0; k < np; k++)
398 swap_intp(data + k);
399 } else if (kind == FIFFT_FLOAT) {
400 for (fdata = (float*)(tag->data()), k = 0; k < np; k++)
401 swap_floatp(fdata + k);
402 } else if (kind == FIFFT_DOUBLE) {
403 for (ddata = (double*)(tag->data()), k = 0; k < np; k++)
404 swap_doublep(ddata + k);
405 } else if (kind == FIFFT_COMPLEX_FLOAT) {
406 for (fdata = (float*)(tag->data()), k = 0; k < 2 * np; k++)
407 swap_floatp(fdata + k);
408 } else if (kind == FIFFT_COMPLEX_DOUBLE) {
409 for (ddata = (double*)(tag->data()), k = 0; k < 2 * np; k++)
410 swap_doublep(ddata + k);
411 }
412 return;
413}
414
415//=============================================================================================================
416//ToDo remove this function by swapping -> define little endian big endian, QByteArray
417void FiffTag::convert_tag_data(const FiffTag::UPtr& tag, int from_endian, int to_endian)
418{
419 // Element counts derived from tag->size(), which is a size type. A FIFF tag
420 // never holds more than INT_MAX elements, so narrowing is safe, but it has
421 // to be explicit: on Win64 size_t is 64-bit while int stays 32-bit.
422 int np;
423 int k, r; //,c;
424 char* offset;
425 fiff_int_t* ithis;
426 fiff_short_t* sthis;
427 fiff_long_t* lthis;
428 float* fthis;
429 double* dthis;
430 // fiffDirEntry dethis;
431 // fiffId idthis;
432 // fiffChInfoRec* chthis;//FiffChInfo* chthis;//ToDo adapt parsing to the new class
433 // fiffChPos cpthis;
434 // fiffCoordTrans ctthis;
435 // fiffDigPoint dpthis;
436 fiffDataRef drthis;
437
438 if (tag->data() == nullptr || tag->size() == 0)
439 return;
440
441 if (from_endian == FIFFV_NATIVE_ENDIAN)
442 from_endian = NATIVE_ENDIAN;
443 if (to_endian == FIFFV_NATIVE_ENDIAN)
444 to_endian = NATIVE_ENDIAN;
445
446 if (from_endian == to_endian)
447 return;
448
449 if (fiff_type_fundamental(tag->type) == FIFFTS_FS_MATRIX) {
450 if (from_endian == NATIVE_ENDIAN)
452 else
454 return;
455 }
456
457 switch (tag->type) {
458 case FIFFT_INT:
459 case FIFFT_UINT:
460 case FIFFT_JULIAN:
461 np = static_cast<int>(tag->size() / sizeof(fiff_int_t));
462 for (ithis = (fiff_int_t*)tag->data(), k = 0; k < np; k++, ithis++)
463 swap_intp(ithis);
464 break;
465
466 case FIFFT_LONG:
467 case FIFFT_ULONG:
468 np = static_cast<int>(tag->size() / sizeof(fiff_long_t));
469 for (lthis = (fiff_long_t*)tag->data(), k = 0; k < np; k++, lthis++)
470 swap_longp(lthis);
471 break;
472
473 case FIFFT_SHORT:
474 case FIFFT_DAU_PACK16:
475 case FIFFT_USHORT:
476 np = static_cast<int>(tag->size() / sizeof(fiff_short_t));
477 for (sthis = (fiff_short_t*)tag->data(), k = 0; k < np; k++, sthis++)
478 *sthis = swap_short(*sthis);
479 break;
480
481 case FIFFT_FLOAT:
483 np = static_cast<int>(tag->size() / sizeof(fiff_float_t));
484 for (fthis = (fiff_float_t*)tag->data(), k = 0; k < np; k++, fthis++)
485 swap_floatp(fthis);
486 break;
487
488 case FIFFT_DOUBLE:
490 np = static_cast<int>(tag->size() / sizeof(fiff_double_t));
491 for (dthis = (fiff_double_t*)tag->data(), k = 0; k < np; k++, dthis++)
492 swap_doublep(dthis);
493 break;
494
495 case FIFFT_OLD_PACK:
496 fthis = (float*)tag->data();
497 /*
498 * Offset and scale...
499 */
500 swap_floatp(fthis + 0);
501 swap_floatp(fthis + 1);
502 sthis = (short*)(fthis + 2);
503 np = (tag->size() - 2 * sizeof(float)) / sizeof(short);
504 for (k = 0; k < np; k++, sthis++)
505 *sthis = swap_short(*sthis);
506 break;
507
509 // np = tag->size/sizeof(fiffDirEntryRec);
510 // for (dethis = (fiffDirEntry)tag->data->data(), k = 0; k < np; k++, dethis++) {
511 // dethis->kind = swap_int(dethis->kind);
512 // dethis->type = swap_int(dethis->type);
513 // dethis->size = swap_int(dethis->size);
514 // dethis->pos = swap_int(dethis->pos);
515 // }
516 np = tag->size() / FiffDirEntry::storageSize();
517 for (k = 0; k < np; k++) {
518 offset = static_cast<char*>(tag->data()) + k * FiffDirEntry::storageSize();
519 ithis = (fiff_int_t*)offset;
520 ithis[0] = swap_int(ithis[0]); //kind
521 ithis[1] = swap_int(ithis[1]); //type
522 ithis[2] = swap_int(ithis[2]); //size
523 ithis[3] = swap_int(ithis[3]); //pos
524 }
525 break;
526
527 case FIFFT_ID_STRUCT:
528 // np = tag->size/sizeof(fiffIdRec);
529 // for (idthis = (fiffId)tag->data->data(), k = 0; k < np; k++, idthis++) {
530 // idthis->version = swap_int(idthis->version);
531 // idthis->machid[0] = swap_int(idthis->machid[0]);
532 // idthis->machid[1] = swap_int(idthis->machid[1]);
533 // idthis->time.secs = swap_int(idthis->time.secs);
534 // idthis->time.usecs = swap_int(idthis->time.usecs);
535 // }
536 np = tag->size() / FiffId::storageSize();
537 for (k = 0; k < np; k++) {
538 offset = static_cast<char*>(tag->data()) + k * FiffId::storageSize();
539 ithis = (fiff_int_t*)offset;
540 ithis[0] = swap_int(ithis[0]); //version
541 ithis[1] = swap_int(ithis[1]); //machid[0]
542 ithis[2] = swap_int(ithis[2]); //machid[1]
543 ithis[3] = swap_int(ithis[3]); //time.secs
544 ithis[4] = swap_int(ithis[4]); //time.usecs
545 }
546 break;
547
549 // np = tag->size/sizeof(fiffChInfoRec);
550 // for (chthis = (fiffChInfoRec*)tag->data->data(), k = 0; k < np; k++, chthis++) {
551 // chthis->scanNo = swap_int(chthis->scanNo);
552 // chthis->logNo = swap_int(chthis->logNo);
553 // chthis->kind = swap_int(chthis->kind);
554 // swap_floatp(&chthis->range);
555 // swap_floatp(&chthis->cal);
556 // chthis->unit = swap_int(chthis->unit);
557 // chthis->unit_mul = swap_int(chthis->unit_mul);
558 // convert_ch_pos(&(chthis->chpos));
559 // }
560
561 np = tag->size() / FiffChInfo::storageSize();
562 for (k = 0; k < np; k++) {
563 offset = static_cast<char*>(tag->data()) + k * FiffChInfo::storageSize();
564 ithis = (fiff_int_t*)offset;
565 fthis = (float*)offset;
566
567 ithis[0] = swap_int(ithis[0]); //scanno
568 ithis[1] = swap_int(ithis[1]); //logno
569 ithis[2] = swap_int(ithis[2]); //kind
570 swap_floatp(&fthis[3]); //range
571 swap_floatp(&fthis[4]); //cal
572 ithis[5] = swap_int(ithis[5]); //coil_type
573 for (r = 0; r < 12; ++r)
574 swap_floatp(&fthis[6 + r]); //loc
575 ithis[18] = swap_int(ithis[18]); //unit
576 ithis[19] = swap_int(ithis[19]); //unit_mul
577 }
578
579 break;
580
582 // np = tag->size/sizeof(fiffChPosRec);
583 // for (cpthis = (fiffChPos)tag->data->data(), k = 0; k < np; k++, cpthis++)
584 // convert_ch_pos(cpthis);
585
586 np = tag->size() / FiffChPos::storageSize();
587 for (k = 0; k < np; ++k) {
588 offset = static_cast<char*>(tag->data()) + k * FiffChPos::storageSize();
589 ithis = (fiff_int_t*)offset;
590 fthis = (float*)offset;
591
592 ithis[0] = swap_int(ithis[0]); //coil_type
593 for (r = 0; r < 12; r++)
594 swap_floatp(&fthis[1 + r]); //r0, ex, ey, ez
595 }
596
597 break;
598
600 // np = tag->size/sizeof(fiffDigPointRec);
601 // for (dpthis = (fiffDigPoint)tag->data->data(), k = 0; k < np; k++, dpthis++) {
602 // dpthis->kind = swap_int(dpthis->kind);
603 // dpthis->ident = swap_int(dpthis->ident);
604 // for (r = 0; r < 3; r++)
605 // swap_floatp(&dpthis->r[r]);
606 // }
607
608 np = tag->size() / FiffDigPoint::storageSize();
609
610 for (k = 0; k < np; k++) {
611 offset = tag->data() + k * FiffDigPoint::storageSize();
612 ithis = (fiff_int_t*)offset;
613 fthis = (float*)offset;
614
615 ithis[0] = swap_int(ithis[0]); //kind
616 ithis[1] = swap_int(ithis[1]); //ident
617
618 for (r = 0; r < 3; ++r)
619 swap_floatp(&fthis[2 + r]); //r
620 }
621 break;
622
624 // np = tag->size/sizeof(fiffCoordTransRec);
625 // for (ctthis = (fiffCoordTrans)tag->data->data(), k = 0; k < np; k++, ctthis++) {
626 // ctthis->from = swap_int(ctthis->from);
627 // ctthis->to = swap_int(ctthis->to);
628 // for (r = 0; r < 3; r++) {
629 // swap_floatp(&ctthis->move[r]);
630 // swap_floatp(&ctthis->invmove[r]);
631 // for (c = 0; c < 3; c++) {
632 // swap_floatp(&ctthis->rot[r][c]);
633 // swap_floatp(&ctthis->invrot[r][c]);
634 // }
635 // }
636 // }
637
638 np = tag->size() / FiffCoordTrans::storageSize();
639
640 for (k = 0; k < np; ++k) {
641 offset = tag->data() + k * FiffCoordTrans::storageSize();
642 ithis = (fiff_int_t*)offset;
643 fthis = (float*)offset;
644
645 ithis[0] = swap_int(ithis[0]);
646 ithis[1] = swap_int(ithis[1]);
647
648 for (r = 0; r < 24; ++r)
649 swap_floatp(&fthis[2 + r]);
650 }
651 break;
652
654 np = tag->size() / FiffDataRef::storageSize();
655 for (drthis = (fiffDataRef)tag->data(), k = 0; k < np; k++, drthis++) {
656 drthis->type = swap_int(drthis->type);
657 drthis->endian = swap_int(drthis->endian);
658 drthis->size = swap_long(drthis->size);
659 drthis->offset = swap_long(drthis->offset);
660 }
661 break;
662
663 default:
664 break;
665 }
666 return;
667}
668
669//=============================================================================================================
670//fiff_type_spec
671
676
677//=============================================================================================================
678
683
684//=============================================================================================================
685
Endianness swap helpers for the FIFF binary tag I/O layer (FIFF is always written big-endian on disk)...
FIFF tag: the 16-byte tag header (kind, type, size, next) plus its decoded payload.
#define IS_MATRIX
Definition fiff_tag.h:133
#define DATA_TYPE
Definition fiff_tag.h:137
#define NATIVE_ENDIAN
Definition fiff_tag.h:68
#define FIFFT_COMPLEX_DOUBLE
Definition fiff_file.h:238
#define FIFFTS_FS_MATRIX
Definition fiff_file.h:259
#define FIFFT_ID_STRUCT
Definition fiff_file.h:241
#define FIFFT_LONG
Definition fiff_file.h:233
#define FIFFTS_MC_RCS
Definition fiff_file.h:263
#define FIFFT_CH_INFO_STRUCT
Definition fiff_file.h:240
#define FIFFT_UINT
Definition fiff_file.h:229
#define FIFFT_ULONG
Definition fiff_file.h:230
#define FIFFTS_MC_MASK
Definition fiff_file.h:256
#define FIFFT_INT
Definition fiff_file.h:224
#define FIFFT_SHORT
Definition fiff_file.h:223
#define FIFFT_OLD_PACK
Definition fiff_file.h:239
#define FIFFT_CH_POS_STRUCT
Definition fiff_file.h:244
#define FIFFT_COMPLEX_FLOAT
Definition fiff_file.h:237
#define FIFFTS_FS_MASK
Definition fiff_file.h:254
#define FIFFT_BYTE
Definition fiff_file.h:222
#define FIFFT_DAU_PACK16
Definition fiff_file.h:236
#define FIFFTS_MC_CCS
Definition fiff_file.h:262
#define FIFFT_DOUBLE
Definition fiff_file.h:226
#define FIFFT_USHORT
Definition fiff_file.h:228
#define FIFFT_JULIAN
Definition fiff_file.h:227
#define FIFFT_FLOAT
Definition fiff_file.h:225
#define FIFFT_STRING
Definition fiff_file.h:231
#define FIFFV_NATIVE_ENDIAN
Definition fiff_file.h:890
#define FIFFTS_MC_DENSE
Definition fiff_file.h:261
#define FIFFTS_BASE_MASK
Definition fiff_file.h:255
#define FIFFT_DIR_ENTRY_STRUCT
Definition fiff_file.h:242
#define FIFFT_COORD_TRANS_STRUCT
Definition fiff_file.h:245
#define FIFFT_DIG_POINT_STRUCT
Definition fiff_file.h:243
#define FIFFT_DATA_REF_STRUCT
Definition fiff_file.h:248
FIFF file I/O, in-memory data structures and high-level readers/writers.
FiffDataRef * fiffDataRef
Backward-compatible pointer typedef for the old fiffDataRef pointer.
void swap_doublep(double *source)
double fiff_double_t
Definition fiff_types.h:91
qint32 swap_int(qint32 source)
qint32 fiff_int_t
Definition fiff_types.h:86
void swap_longp(qint64 *source)
float fiff_float_t
Definition fiff_types.h:90
qint64 fiff_long_t
Definition fiff_types.h:88
qint64 swap_long(qint64 source)
void swap_floatp(float *source)
void swap_intp(qint32 *source)
qint16 swap_short(qint16 source)
qint16 fiff_short_t
Definition fiff_types.h:84
static qint32 storageSize()
Channel coil-frame placement: origin r0 (m) and orthonormal axes ex / ey / ez in FIFFV_COORD_DEVICE.
Definition fiff_ch_pos.h:65
Eigen::Vector3f r0
fiff_int_t coil_type
static qint32 storageSize()
Eigen::Vector3f ey
Eigen::Vector3f ex
Eigen::Vector3f ez
static qint32 storageSize()
static qint32 storageSize()
static qint32 storageSize()
static qint32 storageSize()
Definition fiff_id.h:208
static fiff_int_t fiff_type_matrix_coding(fiff_int_t type)
Definition fiff_tag.cpp:686
fiff_int_t kind
Definition fiff_tag.h:529
std::unique_ptr< FiffTag > UPtr
Definition fiff_tag.h:165
fiff_int_t getMatrixCoding() const
Definition fiff_tag.cpp:58
static fiff_int_t fiff_type_fundamental(fiff_int_t type)
Definition fiff_tag.cpp:672
static void convert_tag_data(const FiffTag::UPtr &tag, int from_endian, int to_endian)
Definition fiff_tag.cpp:417
static void convert_matrix_to_file_data(const FiffTag::UPtr &tag)
Definition fiff_tag.cpp:342
QString getInfo() const
Definition fiff_tag.cpp:117
bool isMatrix() const
Definition fiff_tag.cpp:65
fiff_int_t getType() const
Definition fiff_tag.cpp:106
static fiff_int_t fiff_type_base(fiff_int_t type)
Definition fiff_tag.cpp:679
fiff_int_t type
Definition fiff_tag.h:531
static void convert_matrix_from_file_data(const FiffTag::UPtr &tag)
Definition fiff_tag.cpp:265
fiff_int_t next
Definition fiff_tag.h:533
static void convert_ch_pos(FiffChPos *pos)
Definition fiff_tag.cpp:250
bool getMatrixDimensions(qint32 &p_ndim, QVector< qint32 > &p_Dims) const
Definition fiff_tag.cpp:75