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