v2.0.0
Loading...
Searching...
No Matches
fiff_tag.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef FIFF_TAG_H
38#define FIFF_TAG_H
39
40//=============================================================================================================
41// DEFINES
42//=============================================================================================================
43
44/* NOTE:
45 The architecture is now deduced from the operating system, which is
46 a bit stupid way, since the same operating system can me run on various
47 architectures. This may need revision later on. */
48
49#if defined(DARWIN)
50
51#if defined(__LITTLE_ENDIAN__)
52#define INTEL_X86_ARCH
53#else
54#define BIG_ENDIAN_ARCH
55#endif
56
57#else
58
59#if defined(__hpux) || defined(__Lynx__) || defined(__sun)
60#define BIG_ENDIAN_ARCH
61#else
62#if defined(__linux) || defined(WIN32) || defined(__APPLE__)
63#define INTEL_X86_ARCH
64#endif
65
66#endif
67#endif
68
69#define NATIVE_ENDIAN FIFFV_LITTLE_ENDIAN
70
71#ifdef INTEL_X86_ARCH
72#define NATIVE_ENDIAN FIFFV_LITTLE_ENDIAN
73#endif
74
75#ifdef BIG_ENDIAN_ARCH
76#define NATIVE_ENDIAN FIFFV_BIG_ENDIAN
77#endif
78
79//=============================================================================================================
80// INCLUDES
81//=============================================================================================================
82
83#include "fiff_global.h"
84#include "fiff_constants.h"
85#include "fiff_file.h"
86#include "fiff_types.h"
87#include "fiff_id.h"
88#include "fiff_coord_trans.h"
89#include "fiff_ch_info.h"
90#include "fiff_ch_pos.h"
91#include "fiff_dir_entry.h"
92#include "fiff_dig_point.h"
93
94//=============================================================================================================
95// EIGEN INCLUDES
96//=============================================================================================================
97
98#include <Eigen/Core>
99#include <Eigen/SparseCore>
100
101//=============================================================================================================
102// QT INCLUDES
103//=============================================================================================================
104
105#include <QDebug>
106#include <QByteArray>
107#include <QList>
108#include <QSharedPointer>
109#include <QVector>
110
111//=============================================================================================================
112// STL INCLUDES
113//=============================================================================================================
114
115#include <iostream>
116
117//=============================================================================================================
118// DEFINE NAMESPACE FIFFLIB
119//=============================================================================================================
120
121namespace FIFFLIB
122{
123
124class FiffStream;
125class FiffDirNode;
126
127//=============================================================================================================
128// FORWARD DECLARATIONS
129//=============================================================================================================
130//
131// The magic hexadecimal values
132//
133#define IS_MATRIX 0xFFFF0000
134#define MATRIX_CODING_DENSE 0x00004000
135#define MATRIX_CODING_CCS 0x00004010
136#define MATRIX_CODING_RCS 0x00004020
137#define DATA_TYPE 0x0000FFFF
138
139//const fiff_int_t IS_MATRIX = 4294901760; /**< Is Matrix encoding. ffff0000. */
140//const fiff_int_t MATRIX_CODING_DENSE = 16384; /**< MATRIX_CODING_DENSE encoding. 4000. */
141//const fiff_int_t MATRIX_CODING_CCS = 16400; /**< MATRIX_CODING_CCS encoding. 4010. */
142//const fiff_int_t MATRIX_CODING_RCS = 16416; /**< MATRIX_CODING_RCS encoding. 4020. */
143//const fiff_int_t DATA_TYPE = 65535; /**< DATA_TYPE encoding. ffff. */
144
145//=============================================================================================================
151class FIFFSHARED_EXPORT FiffTag : public QByteArray
152{
153
154public:
155 typedef QSharedPointer<FiffTag> SPtr;
156 typedef QSharedPointer<const FiffTag> ConstSPtr;
157
158 //=========================================================================================================
162 FiffTag();
163
164 //=========================================================================================================
170 FiffTag(const FiffTag& p_FiffTag) = default;
171
172 //=========================================================================================================
176 FiffTag(FiffTag&& other) = default;
177
178 //=========================================================================================================
182 FiffTag& operator=(const FiffTag& other) = default;
183
184 //=========================================================================================================
188 FiffTag& operator=(FiffTag&& other) = default;
189
190 //=========================================================================================================
194 ~FiffTag() = default;
195
196 //=========================================================================================================
203
204 //=========================================================================================================
210 bool isMatrix() const;
211
212 //=========================================================================================================
222 bool getMatrixDimensions(qint32& p_ndim, QVector<qint32>& p_Dims) const;
223
224 //=========================================================================================================
230 fiff_int_t getType() const;
231
232 //=========================================================================================================
238 QString getInfo() const;
239
240 //
241 // Simple types
242 //
243 //=========================================================================================================
250 inline quint8* toByte() const;
251
252 //=========================================================================================================
259 inline quint16* toUnsignedShort() const;
260
261 //=========================================================================================================
268 inline qint16* toShort() const;
269
270 //=========================================================================================================
277 inline quint32* toUnsignedInt() const;
278
279 //=========================================================================================================
286 inline qint32* toInt() const;
287
288 //=========================================================================================================
295 inline qint32* toJulian() const;
296
297 //=========================================================================================================
304 inline float* toFloat() const;
305
306 //=========================================================================================================
313 inline double* toDouble() const;
314
315 //=========================================================================================================
321 inline QString toString() const;
322
323 //=========================================================================================================
330 inline qint16* toDauPack16() const;
331
332 //
333 // Structures
334 //
335 //=========================================================================================================
341 inline FiffId toFiffID() const;
342
343 //=========================================================================================================
349 inline FiffDigPoint toDigPoint() const;
350
351 //=========================================================================================================
357 inline FiffCoordTrans toCoordTrans() const;
358
359 //=========================================================================================================
365 inline FiffChInfo toChInfo() const;
366
367// //=========================================================================================================
368// /**
369// * to fiff OLD PACK
370// */
371// inline fiff_coord_trans_t toCoordTrans() const;
372
373 //=========================================================================================================
379 inline QList< QSharedPointer<FiffDirEntry> > toDirEntry() const;
380
381 //
382 // MATRIX
383 //
384 //=========================================================================================================
390 inline Eigen::MatrixXi toIntMatrix() const;
391
392 //=========================================================================================================
400 inline Eigen::MatrixXf toFloatMatrix() const;
401
402 //=========================================================================================================
410 inline Eigen::SparseMatrix<double> toSparseFloatMatrix() const;
411
412 //
413 //from fiff_combat.c
414 //
415
416 //=========================================================================================================
422 static void convert_ch_pos(FiffChPos* pos);
423
424 /*
425 * Data type conversions for the little endian systems.
426 */
436
437 //=========================================================================================================
444
445 //
446 // Data type conversions for the little endian systems.
447 //
448 //=========================================================================================================
462 static void convert_tag_data(FiffTag::SPtr tag, int from_endian, int to_endian);
463
464 //
465 // from fiff_type_spec.c
466 //
467 //=========================================================================================================
476
477 //=========================================================================================================
486
487 //=========================================================================================================
496
497 //=========================================================================================================
504 inline static qint32 storageSize();
505
506public:
515};
516
517//=============================================================================================================
518// INLINE DEFINITIONS
519//=============================================================================================================
520
521inline qint32 FiffTag::storageSize()
522{
523 // On-disk layout: kind, type, size, next (4 x fiff_int_t)
524 // Note: 'size' is not a class member (QByteArray::size() is used at runtime),
525 // but it is part of the on-disk wire format.
526 return sizeof(FiffTag::kind) + sizeof(FiffTag::type)
527 + sizeof(fiff_int_t) /* size field on disk */
528 + sizeof(FiffTag::next);
529}
530
531//=============================================================================================================
532// Simple types
533//=============================================================================================================
534
535inline quint8* FiffTag::toByte() const
536{
537 if(this->isMatrix() || this->getType() != FIFFT_BYTE)
538 return nullptr;
539 else
540 return (quint8*)this->data();
541}
542
543//=============================================================================================================
544
545inline quint16* FiffTag::toUnsignedShort() const
546{
547 if(this->isMatrix() || this->getType() != FIFFT_USHORT)
548 return nullptr;
549 else
550 return (quint16*)this->data();
551}
552
553//=============================================================================================================
554
555inline qint16* FiffTag::toShort() const
556{
557 if(this->isMatrix() || this->getType() != FIFFT_SHORT)
558 return nullptr;
559 else
560 return (qint16*)this->data();
561}
562
563//=============================================================================================================
564
565inline quint32* FiffTag::toUnsignedInt() const
566{
567 if(this->isMatrix() || this->getType() != FIFFT_UINT)
568 return nullptr;
569 else
570 return (quint32*)this->data();
571}
572
573//=============================================================================================================
574
575inline qint32* FiffTag::toInt() const
576{
577 if(this->isMatrix() || this->getType() != FIFFT_INT) {
578 printf("Expected an integer tag : %d (found data type %d instead)\n",this->kind,this->getType());
579 return nullptr;
580 }
581 else
582 return (qint32*)this->data();
583}
584
585//=============================================================================================================
586
587inline qint32* FiffTag::toJulian() const
588{
589 if(this->isMatrix() || this->getType() != FIFFT_JULIAN) {
590 printf("Expected a julian tag : %d (found data type %d instead)\n",this->kind,this->getType());
591 return nullptr;
592 }
593 else
594 return (qint32*)this->data();
595}
596
597//=============================================================================================================
598
599inline float* FiffTag::toFloat() const
600{
601 if(this->isMatrix() || this->getType() != FIFFT_FLOAT)
602 return nullptr;
603 else
604 return (float*)this->data();
605}
606
607//=============================================================================================================
608
609inline double* FiffTag::toDouble() const
610{
611 if(this->isMatrix() || this->getType() != FIFFT_DOUBLE)
612 return nullptr;
613 else
614 return (double*)this->data();
615}
616
617//=============================================================================================================
618
619inline QString FiffTag::toString() const
620{
621 if(this->isMatrix() || this->getType() != FIFFT_STRING)
622 return nullptr;
623 else
624 return *this;
625}
626
627//=============================================================================================================
628
629inline qint16* FiffTag::toDauPack16() const
630{
631 if(this->isMatrix() || this->getType() != FIFFT_DAU_PACK16)
632 return nullptr;
633 else
634 return (qint16*)this->data();
635}
636
637//=============================================================================================================
638
639//inline std::complex<float>* FiffTag::toComplexFloat()
640//{
641// if(this->isMatrix() || this->getType() != FIFFT_COMPLEX_FLOAT)
642// return nullptr;
643// else if(this->m_pComplexFloatData == nullptr)
644// {
645// float* t_pFloat = (float*)this->data();
646// qDebug() << "ToDo toComplexFloat";
647// //ToDo check this for arrays which contains more than one value
648// this->m_pComplexFloatData = new std::complex<float>(t_pFloat[0],t_pFloat[1]);
649// }
650// return m_pComplexFloatData;
651//}
652
653//=============================================================================================================
654
655//inline std::complex<double>* FiffTag::toComplexDouble()
656//{
657// if(this->isMatrix() || this->getType() != FIFFT_COMPLEX_DOUBLE)
658// return nullptr;
659// else if(this->m_pComplexDoubleData == nullptr)
660// {
661// double* t_pDouble = (double*)this->data();
662// qDebug() << "ToDo toComplexDouble";
663// //ToDo check this for arrays which contains more than one value
664// this->m_pComplexDoubleData = new std::complex<double>(t_pDouble[0],t_pDouble[1]);
665// }
666// return m_pComplexDoubleData;
667//}
668
669//=============================================================================================================
670// Structures
671//=============================================================================================================
672
674{
675 FiffId p_fiffID;
676 if(this->isMatrix() || this->getType() != FIFFT_ID_STRUCT || this->data() == nullptr)
677 return p_fiffID;
678 else
679 {
680 const qint32* t_pInt32 = (qint32*)this->data();
681
682 p_fiffID.version = t_pInt32[0];
683 p_fiffID.machid[0] = t_pInt32[1];
684 p_fiffID.machid[1] = t_pInt32[2];
685 p_fiffID.time.secs = t_pInt32[3];
686 p_fiffID.time.usecs = t_pInt32[4];
687
688 return p_fiffID;
689 }
690}
691
692//=============================================================================================================
693
695{
696
697 FiffDigPoint t_fiffDigPoint;
698 if(this->isMatrix() || this->getType() != FIFFT_DIG_POINT_STRUCT || this->data() == nullptr)
699 return t_fiffDigPoint;
700 else
701 {
702 qint32* t_pInt32 = (qint32*)this->data();
703// memcpy (&t_fiffDigPoint,this->data,this->size);
704
705 t_fiffDigPoint.kind = t_pInt32[0];
706 t_fiffDigPoint.ident = t_pInt32[1];
707
708 float* t_pFloat = (float*)this->data();
709 t_fiffDigPoint.r[0] = t_pFloat[2];
710 t_fiffDigPoint.r[1] = t_pFloat[3];
711 t_fiffDigPoint.r[2] = t_pFloat[4];
712 t_fiffDigPoint.coord_frame = 0;
713
714 return t_fiffDigPoint;
715 }
716}
717
718//=============================================================================================================
719
721{
722
723 FiffCoordTrans p_FiffCoordTrans;
724 if(this->isMatrix() || this->getType() != FIFFT_COORD_TRANS_STRUCT || this->data() == nullptr)
725 return p_FiffCoordTrans;
726 else
727 {
728 qint32* t_pInt32 = (qint32*)this->data();
729 p_FiffCoordTrans.from = t_pInt32[0];
730 p_FiffCoordTrans.to = t_pInt32[1];
731
732 p_FiffCoordTrans.trans.setIdentity(4,4);
733 float* t_pFloat = (float*)this->data();
734 int count = 0;
735 int r, c;
736 for (r = 0; r < 3; ++r) {
737 p_FiffCoordTrans.trans(r,3) = t_pFloat[11+r];
738 for (c = 0; c < 3; ++c) {
739 p_FiffCoordTrans.trans(r,c) = t_pFloat[2+count];
740 ++count;
741 }
742 }
743
744 p_FiffCoordTrans.invtrans.setIdentity(4,4);
745 count = 0;
746 for (r = 0; r < 3; ++r) {
747 p_FiffCoordTrans.invtrans(r,3) = t_pFloat[23+r];
748 for (c = 0; c < 3; ++c) {
749 p_FiffCoordTrans.invtrans(r,c) = t_pFloat[14+count];
750 ++count;
751 }
752 }
753
754 return p_FiffCoordTrans;
755 }
756}
757
758//=========================================================================================================
763{
764 FiffChInfo p_FiffChInfo;
765
766 if(this->isMatrix() || this->getType() != FIFFT_CH_INFO_STRUCT || this->data() == nullptr)
767 return p_FiffChInfo;
768 else
769 {
770 qint32* t_pInt32 = (qint32*)this->data();
771 p_FiffChInfo.scanNo = t_pInt32[0];
772 p_FiffChInfo.logNo = t_pInt32[1];
773 p_FiffChInfo.kind = t_pInt32[2];
774 float* t_pFloat = (float*)this->data();
775 p_FiffChInfo.range = t_pFloat[3];
776 p_FiffChInfo.cal = t_pFloat[4];
777
778 p_FiffChInfo.chpos.coil_type = t_pInt32[5];
779
780 //
781 // Read the coil coordinate system definition
782 //
783 qint32 r;
784 // r0
785 for (r = 0; r < 3; ++r)
786 p_FiffChInfo.chpos.r0[r] = t_pFloat[6+r];
787 // ex
788 for (r = 0; r < 3; ++r)
789 p_FiffChInfo.chpos.ex[r] = t_pFloat[6+3+r];
790 // ey
791 for (r = 0; r < 3; ++r)
792 p_FiffChInfo.chpos.ey[r] = t_pFloat[6+6+r];
793 // ez
794 for (r = 0; r < 3; ++r)
795 p_FiffChInfo.chpos.ez[r] = t_pFloat[6+9+r];
796
797 p_FiffChInfo.coord_frame = FIFFV_COORD_UNKNOWN;
798
799 //
800 // Convert loc into a more useful format
801 //
802 if (p_FiffChInfo.kind == FIFFV_MEG_CH || p_FiffChInfo.kind == FIFFV_REF_MEG_CH)
803 {
804 p_FiffChInfo.coil_trans.setIdentity(4,4);
805 // r0
806 for (r = 0; r < 3; ++r)
807 p_FiffChInfo.coil_trans(r,3) = p_FiffChInfo.chpos.r0[r];
808 // ex
809 for (r = 0; r < 3; ++r)
810 p_FiffChInfo.coil_trans(r,0) = p_FiffChInfo.chpos.ex[r];
811 // ey
812 for (r = 0; r < 3; ++r)
813 p_FiffChInfo.coil_trans(r,1) = p_FiffChInfo.chpos.ey[r];
814 // ez
815 for (r = 0; r < 3; ++r)
816 p_FiffChInfo.coil_trans(r,2) = p_FiffChInfo.chpos.ez[r];
817
818 p_FiffChInfo.coord_frame = FIFFV_COORD_DEVICE;
819 }
820 else if (p_FiffChInfo.kind == FIFFV_EEG_CH)
821 {
822 if (p_FiffChInfo.chpos.ex.norm() > 0) {
823 p_FiffChInfo.eeg_loc.block(0,0,3,1) = p_FiffChInfo.chpos.r0.block(0,0,3,1);
824 p_FiffChInfo.eeg_loc.block(0,1,3,1) = p_FiffChInfo.chpos.ex.block(0,0,3,1);
825 }
826 else {
827 p_FiffChInfo.eeg_loc.block(0,0,3,1) = p_FiffChInfo.chpos.r0.block(0,0,3,1);
828 }
829 p_FiffChInfo.coord_frame = FIFFV_COORD_HEAD;
830 }
831 //
832 // Unit and exponent
833 //
834 p_FiffChInfo.unit = t_pInt32[18];
835 p_FiffChInfo.unit_mul = t_pInt32[19];
836
837 //
838 // Handle the channel name
839 //
840 char* orig = (char*)this->data();
841 p_FiffChInfo.ch_name = QString::fromUtf8(orig + 80).replace(" ","");
842
843 return p_FiffChInfo;
844 }
845}
846
847// //=========================================================================================================
848// /**
849// * to fiff OLD PACK
850// */
851// inline fiff_coord_trans_t toCoordTrans() const
852// {
853
854// }
855
856//=============================================================================================================
857
858inline QList< QSharedPointer<FiffDirEntry> > FiffTag::toDirEntry() const
859{
860// tag.data = struct('kind',{},'type',{},'size',{},'pos',{});
861 QList< QSharedPointer<FiffDirEntry> > p_ListFiffDir;
862 if(this->isMatrix() || this->getType() != FIFFT_DIR_ENTRY_STRUCT || this->data() == nullptr)
863 return p_ListFiffDir;
864 else
865 {
866 QSharedPointer<FiffDirEntry> t_pFiffDirEntry;
867 qint32* t_pInt32 = (qint32*)this->data();
868 for (int k = 0; k < this->size()/16; ++k)
869 {
870 t_pFiffDirEntry = QSharedPointer<FiffDirEntry>(new FiffDirEntry);
871 t_pFiffDirEntry->kind = t_pInt32[k*4];//fread(fid,1,'int32');
872 t_pFiffDirEntry->type = t_pInt32[k*4+1];//fread(fid,1,'uint32');
873 t_pFiffDirEntry->size = t_pInt32[k*4+2];//fread(fid,1,'int32');
874 t_pFiffDirEntry->pos = t_pInt32[k*4+3];//fread(fid,1,'int32');
875 p_ListFiffDir.append(t_pFiffDirEntry);
876 }
877 }
878 return p_ListFiffDir;
879}
880
881//=============================================================================================================
882// MATRIX
883//=============================================================================================================
884
885//=============================================================================================================
886
887inline Eigen::MatrixXi FiffTag::toIntMatrix() const
888{
889 if(!this->isMatrix() || this->getType() != FIFFT_INT || this->data() == nullptr)
890 return Eigen::MatrixXi();
891
892 qint32 ndim;
893 QVector<qint32> dims;
894 this->getMatrixDimensions(ndim, dims);
895
896 if (ndim != 2)
897 {
898 printf("Only two-dimensional matrices are supported at this time");
899 return Eigen::MatrixXi();
900 }
901
902 //MatrixXd p_Matrix = Map<MatrixXd>( (float*)this->data,p_dims[0], p_dims[1]);
903 // --> Use copy constructor instead --> slower performance but higher memory management reliability
904 Eigen::MatrixXi p_Matrix(Eigen::Map<Eigen::MatrixXi>( (int*)this->data(),dims[0], dims[1]));
905
906 return p_Matrix;
907}
908
909//=============================================================================================================
910
911inline Eigen::MatrixXf FiffTag::toFloatMatrix() const
912{
913 if(!this->isMatrix() || this->getType() != FIFFT_FLOAT || this->data() == nullptr)
914 return Eigen::MatrixXf();//NULL;
915
917 {
918 printf("Error in FiffTag::toFloatMatrix(): Matrix is not dense!\n");
919 return Eigen::MatrixXf();//NULL;
920 }
921
922 qint32 ndim;
923 QVector<qint32> dims;
924 this->getMatrixDimensions(ndim, dims);
925
926 if (ndim != 2)
927 {
928 printf("Only two-dimensional matrices are supported at this time");
929 return Eigen::MatrixXf();//NULL;
930 }
931
932 // --> Use copy constructor instead --> slower performance but higher memory management reliability
933 Eigen::MatrixXf p_Matrix((Eigen::Map<Eigen::MatrixXf>( (float*)this->data(),dims[0], dims[1])));
934
935 return p_Matrix;
936}
937
938//=============================================================================================================
939
940inline Eigen::SparseMatrix<double> FiffTag::toSparseFloatMatrix() const
941{
942 if(!this->isMatrix() || this->getType() != FIFFT_FLOAT || this->data() == nullptr)
943 return Eigen::SparseMatrix<double>();//NULL;
944
946 {
947 printf("Error in FiffTag::toSparseFloatMatrix(): Matrix is not sparse!\n");
948 return Eigen::SparseMatrix<double>();//NULL;
949 }
950
951 qint32 ndim;
952 QVector<qint32> dims;
953 this->getMatrixDimensions(ndim, dims);
954
955 if (ndim != 2)
956 {
957 printf("Only two-dimensional matrices are supported at this time");
958 return Eigen::SparseMatrix<double>();//NULL;
959 }
960
961 qint32 nnz = dims[0];
962 qint32 nrow = dims[1];
963 qint32 ncol = dims[2];
964
965 typedef Eigen::Triplet<double> T;
966 std::vector<T> tripletList;
967 tripletList.reserve(nnz);
968
969 float *t_pFloat = (float*)this->data();
970 int *t_pInt = (int*)this->data();
971 qint32 offset1 = nnz;
972 qint32 offset2 = 2*nnz;
974 {
975 //
976 // CCS
977 //
978 qWarning("Warning in FiffTag::toSparseFloatMatrix(): CCS has to be debugged - never done before.");
979 qint32 p = 0;
980 for(qint32 j = 0; j < ncol; ++j)
981 {
982 while( p < t_pInt[offset2+j+1])
983 {
984// tripletList[p] = T(tripletList[p].row(), j, tripletList[p].value());
985 tripletList.push_back(T(t_pInt[offset1+p], j, (double)(t_pFloat[p])));
986 ++p;
987 }
988 }
989 }
990 else
991 {
992 //
993 // RCS
994 //
995 qint32 p = 0;
996 for(qint32 j = 0; j < nrow; ++j)
997 {
998 while( p < t_pInt[offset2+j+1])
999 {
1000// tripletList[p] = T(j, tripletList[p].col(), tripletList[p].value());
1001 tripletList.push_back(T(j, t_pInt[offset1+p], (double)(t_pFloat[p])));
1002 ++p;
1003 }
1004 }
1005 }
1006
1007// std::cout << "Size: " << tripletList.size() << std::endl;
1008// qint32 offsetTest = tripletList.size() - 10;
1009// for(qint32 i = 0; i < 10; ++i)
1010// std::cout << std::endl << tripletList[offsetTest + i].row() << " " << tripletList[offsetTest + i].col() << " " << tripletList[offsetTest + i].value();
1011
1012 Eigen::SparseMatrix<double> p_Matrix(nrow, ncol);
1013 p_Matrix.setFromTriplets(tripletList.begin(), tripletList.end());
1014
1015 return p_Matrix;
1016}
1017} // NAMESPACE
1018
1019#endif // FIFF_TAG_H
FiffChPos class declaration.
Fiff library export/import macros.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:52
Fiff constants.
#define FIFFV_EEG_CH
#define FIFFV_COORD_DEVICE
#define FIFFV_REF_MEG_CH
#define FIFFV_MEG_CH
#define FIFFV_COORD_HEAD
#define FIFFV_COORD_UNKNOWN
FiffDirEntry class declaration.
fiff_int_t fiff_type_base(fiff_int_t type)
fiff_int_t fiff_type_matrix_coding(fiff_int_t type)
fiff_int_t fiff_type_fundamental(fiff_int_t type)
FiffChInfo class declaration.
FiffId class declaration.
Header file describing the numerical values used in fif files.
#define FIFFT_ID_STRUCT
Definition fiff_file.h:248
#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_INT
Definition fiff_file.h:231
#define FIFFT_SHORT
Definition fiff_file.h:230
#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 FIFFTS_MC_DENSE
Definition fiff_file.h:268
#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
Old fiff_type declarations - replace them.
FiffCoordTrans class declaration.
FiffDigPoint class declaration.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
qint32 fiff_int_t
Definition fiff_types.h:89
Channel info descriptor.
Eigen::Matrix< float, 3, 2, Eigen::DontAlign > eeg_loc
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > coil_trans
Measurement channel position and coil type.
Definition fiff_ch_pos.h:67
Eigen::Vector3f r0
fiff_int_t coil_type
Eigen::Vector3f ey
Eigen::Vector3f ex
Eigen::Vector3f ez
Coordinate transformation description.
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > trans
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > invtrans
Digitization point description.
Directory entry description.
Universally unique identifier.
Definition fiff_id.h:67
fiff_int_t machid[2]
Definition fiff_id.h:167
FiffTime time
Definition fiff_id.h:168
fiff_int_t version
Definition fiff_id.h:166
static fiff_int_t fiff_type_matrix_coding(fiff_int_t type)
Definition fiff_tag.cpp:707
~FiffTag()=default
QString toString() const
Definition fiff_tag.h:619
qint16 * toShort() const
Definition fiff_tag.h:555
Eigen::MatrixXf toFloatMatrix() const
Definition fiff_tag.h:911
quint32 * toUnsignedInt() const
Definition fiff_tag.h:565
fiff_int_t kind
Definition fiff_tag.h:507
FiffTag(FiffTag &&other)=default
FiffCoordTrans toCoordTrans() const
Definition fiff_tag.h:720
qint32 * toJulian() const
Definition fiff_tag.h:587
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
Eigen::MatrixXi toIntMatrix() const
Definition fiff_tag.h:887
quint16 * toUnsignedShort() const
Definition fiff_tag.h:545
FiffChInfo toChInfo() const
Definition fiff_tag.h:762
qint16 * toDauPack16() const
Definition fiff_tag.h:629
FiffDigPoint toDigPoint() const
Definition fiff_tag.h:694
qint32 * toInt() const
Definition fiff_tag.h:575
QSharedPointer< FiffTag > SPtr
Definition fiff_tag.h:155
FiffTag & operator=(FiffTag &&other)=default
QString getInfo() const
Definition fiff_tag.cpp:138
quint8 * toByte() const
Definition fiff_tag.h:535
double * toDouble() const
Definition fiff_tag.h:609
bool isMatrix() const
Definition fiff_tag.cpp:81
fiff_int_t getType() const
Definition fiff_tag.cpp:124
Eigen::SparseMatrix< double > toSparseFloatMatrix() const
Definition fiff_tag.h:940
FiffId toFiffID() const
Definition fiff_tag.h:673
fiff_int_t type
Definition fiff_tag.h:509
QSharedPointer< const FiffTag > ConstSPtr
Definition fiff_tag.h:156
static qint32 storageSize()
Definition fiff_tag.h:521
FiffTag & operator=(const FiffTag &other)=default
float * toFloat() const
Definition fiff_tag.h:599
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
FiffTag(const FiffTag &p_FiffTag)=default
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
QList< QSharedPointer< FiffDirEntry > > toDirEntry() const
Definition fiff_tag.h:858