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