v2.0.0
Loading...
Searching...
No Matches
fiff_tag.h
Go to the documentation of this file.
1//=============================================================================================================
35
36#ifndef FIFF_TAG_H
37#define FIFF_TAG_H
38
39//=============================================================================================================
40// DEFINES
41//=============================================================================================================
42
43/* NOTE:
44 The architecture is now deduced from the operating system, which is
45 a bit stupid way, since the same operating system can me run on various
46 architectures. This may need revision later on. */
47
48#if defined(DARWIN)
49
50#if defined(__LITTLE_ENDIAN__)
51#define INTEL_X86_ARCH
52#else
53#define BIG_ENDIAN_ARCH
54#endif
55
56#else
57
58#if defined(__hpux) || defined(__Lynx__) || defined(__sun)
59#define BIG_ENDIAN_ARCH
60#else
61#if defined(__linux) || defined(WIN32) || defined(__APPLE__)
62#define INTEL_X86_ARCH
63#endif
64
65#endif
66#endif
67
68#define NATIVE_ENDIAN FIFFV_LITTLE_ENDIAN
69
70#ifdef INTEL_X86_ARCH
71#define NATIVE_ENDIAN FIFFV_LITTLE_ENDIAN
72#endif
73
74#ifdef BIG_ENDIAN_ARCH
75#define NATIVE_ENDIAN FIFFV_BIG_ENDIAN
76#endif
77
78//=============================================================================================================
79// INCLUDES
80//=============================================================================================================
81
82#include "fiff_global.h"
83#include "fiff_constants.h"
84#include "fiff_file.h"
85#include "fiff_types.h"
86#include "fiff_id.h"
87#include "fiff_coord_trans.h"
88#include "fiff_ch_info.h"
89#include "fiff_ch_pos.h"
90#include "fiff_dir_entry.h"
91#include "fiff_dig_point.h"
92
93//=============================================================================================================
94// EIGEN INCLUDES
95//=============================================================================================================
96
97#include <Eigen/Core>
98#include <Eigen/SparseCore>
99
100//=============================================================================================================
101// QT INCLUDES
102//=============================================================================================================
103
104#include <QDebug>
105#include <QByteArray>
106#include <QList>
107#include <QSharedPointer>
108#include <QVector>
109
110//=============================================================================================================
111// STL INCLUDES
112//=============================================================================================================
113
114#include <iostream>
115#include <memory>
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//
133inline constexpr auto IS_MATRIX = 0xFFFF0000;
134inline constexpr auto MATRIX_CODING_DENSE = 0x00004000;
135inline constexpr auto MATRIX_CODING_CCS = 0x00004010;
136inline constexpr auto MATRIX_CODING_RCS = 0x00004020;
137inline constexpr auto 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//=============================================================================================================
160class FIFFSHARED_EXPORT FiffTag : public QByteArray
161{
162public:
163 using SPtr = QSharedPointer<FiffTag>;
164 using ConstSPtr = QSharedPointer<const FiffTag>;
165 using UPtr = std::unique_ptr<FiffTag>;
166 using ConstUPtr = std::unique_ptr<const FiffTag>;
167
168 //=========================================================================================================
172 FiffTag();
173
174 //=========================================================================================================
180 FiffTag(const FiffTag& p_FiffTag) = default;
181
182 //=========================================================================================================
188 FiffTag(FiffTag&& other) = default;
189
190 //=========================================================================================================
198 FiffTag& operator=(const FiffTag& other) = default;
199
200 //=========================================================================================================
208 FiffTag& operator=(FiffTag&& other) = default;
209
210 //=========================================================================================================
214 ~FiffTag() = default;
215
216 //=========================================================================================================
223
224 //=========================================================================================================
230 bool isMatrix() const;
231
232 //=========================================================================================================
242 bool getMatrixDimensions(qint32& p_ndim, QVector<qint32>& p_Dims) const;
243
244 //=========================================================================================================
250 fiff_int_t getType() const;
251
252 //=========================================================================================================
258 QString getInfo() const;
259
260 //
261 // Simple types
262 //
263 //=========================================================================================================
270 inline const quint8* toByte() const;
271
272 //=========================================================================================================
279 inline const quint16* toUnsignedShort() const;
280
281 //=========================================================================================================
288 inline const qint16* toShort() const;
289
290 //=========================================================================================================
297 inline const quint32* toUnsignedInt() const;
298
299 //=========================================================================================================
306 inline const qint32* toInt() const;
307
308 //=========================================================================================================
315 inline const qint32* toJulian() const;
316
317 //=========================================================================================================
324 inline const float* toFloat() const;
325
326 //=========================================================================================================
333 inline const double* toDouble() const;
334
335 //=========================================================================================================
341 inline QString toString() const;
342
343 //=========================================================================================================
350 inline const qint16* toDauPack16() const;
351
352 //
353 // Structures
354 //
355 //=========================================================================================================
361 inline FiffId toFiffID() const;
362
363 //=========================================================================================================
369 inline FiffDigPoint toDigPoint() const;
370
371 //=========================================================================================================
377 inline FiffCoordTrans toCoordTrans() const;
378
379 //=========================================================================================================
385 inline FiffChInfo toChInfo() const;
386
387 // //=========================================================================================================
388 // /**
389 // * to fiff OLD PACK
390 // */
391 // inline fiff_coord_trans_t toCoordTrans() const;
392
393 //=========================================================================================================
399 inline QList<QSharedPointer<FiffDirEntry>> toDirEntry() const;
400
401 //
402 // MATRIX
403 //
404 //=========================================================================================================
410 inline Eigen::MatrixXi toIntMatrix() const;
411
412 //=========================================================================================================
420 inline Eigen::MatrixXf toFloatMatrix() const;
421
422 //=========================================================================================================
431 Eigen::SparseMatrix<double> toSparseFloatMatrix() const;
432
433 //
434 //from fiff_combat.c
435 //
436
437 //=========================================================================================================
443 static void convert_ch_pos(FiffChPos* pos);
444
445 /*
446 * Data type conversions for the little endian systems.
447 */
458 static void convert_matrix_from_file_data(const FiffTag::UPtr& tag);
459
460 //=========================================================================================================
466 static void convert_matrix_to_file_data(const FiffTag::UPtr& tag);
467
468 //
469 // Data type conversions for the little endian systems.
470 //
471 //=========================================================================================================
485 static void convert_tag_data(const FiffTag::UPtr& tag, int from_endian, int to_endian);
486
487 //
488 // from fiff_type_spec.c
489 //
490 //=========================================================================================================
499
500 //=========================================================================================================
509
510 //=========================================================================================================
519
520 //=========================================================================================================
527 inline static qint32 storageSize();
528
529public:
538};
539
540//=============================================================================================================
541// INLINE DEFINITIONS
542//=============================================================================================================
543
544inline qint32 FiffTag::storageSize()
545{
546 // On-disk layout: kind, type, size, next (4 x fiff_int_t)
547 // Note: 'size' is not a class member (QByteArray::size() is used at runtime),
548 // but it is part of the on-disk wire format.
549 return sizeof(FiffTag::kind) + sizeof(FiffTag::type) + sizeof(fiff_int_t) /* size field on disk */
550 + sizeof(FiffTag::next);
551}
552
553//=============================================================================================================
554// Simple types
555//=============================================================================================================
556
557inline const quint8* FiffTag::toByte() const
558{
559 if (this->isMatrix() || this->getType() != FIFFT_BYTE)
560 return nullptr;
561 else
562 return reinterpret_cast<const quint8*>(this->data());
563}
564
565//=============================================================================================================
566
567inline const quint16* FiffTag::toUnsignedShort() const
568{
569 if (this->isMatrix() || this->getType() != FIFFT_USHORT)
570 return nullptr;
571 else
572 return reinterpret_cast<const quint16*>(this->data());
573}
574
575//=============================================================================================================
576
577inline const qint16* FiffTag::toShort() const
578{
579 if (this->isMatrix() || this->getType() != FIFFT_SHORT)
580 return nullptr;
581 else
582 return reinterpret_cast<const qint16*>(this->data());
583}
584
585//=============================================================================================================
586
587inline const quint32* FiffTag::toUnsignedInt() const
588{
589 if (this->isMatrix() || this->getType() != FIFFT_UINT)
590 return nullptr;
591 else
592 return reinterpret_cast<const quint32*>(this->data());
593}
594
595//=============================================================================================================
596
597inline const qint32* FiffTag::toInt() const
598{
599 if (this->isMatrix() || this->getType() != FIFFT_INT) {
600 qWarning("Expected an integer tag : %d (found data type %d instead)\n", this->kind, this->getType());
601 return nullptr;
602 } else
603 return reinterpret_cast<const qint32*>(this->data());
604}
605
606//=============================================================================================================
607
608inline const qint32* FiffTag::toJulian() const
609{
610 if (this->isMatrix() || this->getType() != FIFFT_JULIAN) {
611 qWarning("Expected a julian tag : %d (found data type %d instead)\n", this->kind, this->getType());
612 return nullptr;
613 } else
614 return reinterpret_cast<const qint32*>(this->data());
615}
616
617//=============================================================================================================
618
619inline const float* FiffTag::toFloat() const
620{
621 if (this->isMatrix() || this->getType() != FIFFT_FLOAT)
622 return nullptr;
623 else
624 return reinterpret_cast<const float*>(this->data());
625}
626
627//=============================================================================================================
628
629inline const double* FiffTag::toDouble() const
630{
631 if (this->isMatrix() || this->getType() != FIFFT_DOUBLE)
632 return nullptr;
633 else
634 return reinterpret_cast<const double*>(this->data());
635}
636
637//=============================================================================================================
638
639inline QString FiffTag::toString() const
640{
641 if (this->isMatrix() || this->getType() != FIFFT_STRING)
642 return nullptr;
643 else
644 return *this;
645}
646
647//=============================================================================================================
648
649inline const qint16* FiffTag::toDauPack16() const
650{
651 if (this->isMatrix() || this->getType() != FIFFT_DAU_PACK16)
652 return nullptr;
653 else
654 return reinterpret_cast<const qint16*>(this->data());
655}
656
657//=============================================================================================================
658// Structures
659//=============================================================================================================
660
662{
663 FiffId p_fiffID;
664 if (this->isMatrix() || this->getType() != FIFFT_ID_STRUCT || this->isNull() || this->size() < FiffId::storageSize())
665 return p_fiffID;
666 else {
667 const auto* t_pInt32 = reinterpret_cast<const qint32*>(this->data());
668
669 p_fiffID.version = t_pInt32[0];
670 p_fiffID.machid[0] = t_pInt32[1];
671 p_fiffID.machid[1] = t_pInt32[2];
672 p_fiffID.time.secs = t_pInt32[3];
673 p_fiffID.time.usecs = t_pInt32[4];
674
675 return p_fiffID;
676 }
677}
678
679//=============================================================================================================
680
682{
683 FiffDigPoint t_fiffDigPoint;
684 if (this->isMatrix() || this->getType() != FIFFT_DIG_POINT_STRUCT || this->isNull() || this->size() < FiffDigPoint::storageSize())
685 return t_fiffDigPoint;
686 else {
687 auto* t_pInt32 = reinterpret_cast<const qint32*>(this->data());
688
689 t_fiffDigPoint.kind = t_pInt32[0];
690 t_fiffDigPoint.ident = t_pInt32[1];
691
692 auto* t_pFloat = reinterpret_cast<const float*>(this->data());
693 t_fiffDigPoint.r[0] = t_pFloat[2];
694 t_fiffDigPoint.r[1] = t_pFloat[3];
695 t_fiffDigPoint.r[2] = t_pFloat[4];
696 t_fiffDigPoint.coord_frame = 0;
697
698 return t_fiffDigPoint;
699 }
700}
701
702//=============================================================================================================
703
705{
706 FiffCoordTrans p_FiffCoordTrans;
707 if (this->isMatrix() || this->getType() != FIFFT_COORD_TRANS_STRUCT || this->isNull() || this->size() < FiffCoordTrans::storageSize())
708 return p_FiffCoordTrans;
709 else {
710 auto* t_pInt32 = reinterpret_cast<const qint32*>(this->data());
711 p_FiffCoordTrans.from = t_pInt32[0];
712 p_FiffCoordTrans.to = t_pInt32[1];
713
714 p_FiffCoordTrans.trans.setIdentity(4, 4);
715 auto* t_pFloat = reinterpret_cast<const float*>(this->data());
716 int count = 0;
717 int r, c;
718 for (r = 0; r < 3; ++r) {
719 p_FiffCoordTrans.trans(r, 3) = t_pFloat[11 + r];
720 for (c = 0; c < 3; ++c) {
721 p_FiffCoordTrans.trans(r, c) = t_pFloat[2 + count];
722 ++count;
723 }
724 }
725
726 p_FiffCoordTrans.invtrans.setIdentity(4, 4);
727 count = 0;
728 for (r = 0; r < 3; ++r) {
729 p_FiffCoordTrans.invtrans(r, 3) = t_pFloat[23 + r];
730 for (c = 0; c < 3; ++c) {
731 p_FiffCoordTrans.invtrans(r, c) = t_pFloat[14 + count];
732 ++count;
733 }
734 }
735
736 return p_FiffCoordTrans;
737 }
738}
739
740//=========================================================================================================
745{
746 FiffChInfo p_FiffChInfo;
747
748 if (this->isMatrix() || this->getType() != FIFFT_CH_INFO_STRUCT || this->isNull() || this->size() < FiffChInfo::storageSize())
749 return p_FiffChInfo;
750 else {
751 auto* t_pInt32 = reinterpret_cast<const qint32*>(this->data());
752 p_FiffChInfo.scanNo = t_pInt32[0];
753 p_FiffChInfo.logNo = t_pInt32[1];
754 p_FiffChInfo.kind = t_pInt32[2];
755 auto* t_pFloat = reinterpret_cast<const float*>(this->data());
756 p_FiffChInfo.range = t_pFloat[3];
757 p_FiffChInfo.cal = t_pFloat[4];
758
759 p_FiffChInfo.chpos.coil_type = t_pInt32[5];
760
761 //
762 // Read the coil coordinate system definition
763 //
764 qint32 r;
765 // r0
766 for (r = 0; r < 3; ++r)
767 p_FiffChInfo.chpos.r0[r] = t_pFloat[6 + r];
768 // ex
769 for (r = 0; r < 3; ++r)
770 p_FiffChInfo.chpos.ex[r] = t_pFloat[6 + 3 + r];
771 // ey
772 for (r = 0; r < 3; ++r)
773 p_FiffChInfo.chpos.ey[r] = t_pFloat[6 + 6 + r];
774 // ez
775 for (r = 0; r < 3; ++r)
776 p_FiffChInfo.chpos.ez[r] = t_pFloat[6 + 9 + r];
777
778 p_FiffChInfo.coord_frame = FIFFV_COORD_UNKNOWN;
779
780 //
781 // Convert loc into a more useful format
782 //
783 if (p_FiffChInfo.kind == FIFFV_MEG_CH || p_FiffChInfo.kind == FIFFV_REF_MEG_CH) {
784 p_FiffChInfo.coil_trans.setIdentity(4, 4);
785 // r0
786 for (r = 0; r < 3; ++r)
787 p_FiffChInfo.coil_trans(r, 3) = p_FiffChInfo.chpos.r0[r];
788 // ex
789 for (r = 0; r < 3; ++r)
790 p_FiffChInfo.coil_trans(r, 0) = p_FiffChInfo.chpos.ex[r];
791 // ey
792 for (r = 0; r < 3; ++r)
793 p_FiffChInfo.coil_trans(r, 1) = p_FiffChInfo.chpos.ey[r];
794 // ez
795 for (r = 0; r < 3; ++r)
796 p_FiffChInfo.coil_trans(r, 2) = p_FiffChInfo.chpos.ez[r];
797
798 p_FiffChInfo.coord_frame = FIFFV_COORD_DEVICE;
799 } else if (p_FiffChInfo.kind == FIFFV_EEG_CH) {
800 if (p_FiffChInfo.chpos.ex.norm() > 0) {
801 p_FiffChInfo.eeg_loc.block(0, 0, 3, 1) = p_FiffChInfo.chpos.r0.block(0, 0, 3, 1);
802 p_FiffChInfo.eeg_loc.block(0, 1, 3, 1) = p_FiffChInfo.chpos.ex.block(0, 0, 3, 1);
803 } else {
804 p_FiffChInfo.eeg_loc.block(0, 0, 3, 1) = p_FiffChInfo.chpos.r0.block(0, 0, 3, 1);
805 }
806 p_FiffChInfo.coord_frame = FIFFV_COORD_HEAD;
807 }
808 //
809 // Unit and exponent
810 //
811 p_FiffChInfo.unit = t_pInt32[18];
812 p_FiffChInfo.unit_mul = t_pInt32[19];
813
814 //
815 // Handle the channel name
816 //
817 const char* orig = static_cast<const char*>(this->data());
818 p_FiffChInfo.ch_name = QString::fromUtf8(orig + 80, static_cast<qsizetype>(qstrnlen(orig + 80, 16))).replace(" ", "");
819
820 return p_FiffChInfo;
821 }
822}
823
824// //=========================================================================================================
825// /**
826// * to fiff OLD PACK
827// */
828// inline fiff_coord_trans_t toCoordTrans() const
829// {
830
831// }
832
833//=============================================================================================================
834
835inline QList<QSharedPointer<FiffDirEntry>> FiffTag::toDirEntry() const
836{
837 // tag.data = struct('kind',{},'type',{},'size',{},'pos',{});
838 QList<QSharedPointer<FiffDirEntry>> p_ListFiffDir;
839 if (this->isMatrix() || this->getType() != FIFFT_DIR_ENTRY_STRUCT || this->data() == nullptr)
840 return p_ListFiffDir;
841 else {
842 QSharedPointer<FiffDirEntry> t_pFiffDirEntry;
843 const auto* t_pInt32 = reinterpret_cast<const qint32*>(this->data());
844 for (int k = 0; k < this->size() / 16; ++k) {
845 t_pFiffDirEntry = QSharedPointer<FiffDirEntry>(new FiffDirEntry);
846 t_pFiffDirEntry->kind = t_pInt32[k * 4]; //fread(fid,1,'int32');
847 t_pFiffDirEntry->type = t_pInt32[k * 4 + 1]; //fread(fid,1,'uint32');
848 t_pFiffDirEntry->size = t_pInt32[k * 4 + 2]; //fread(fid,1,'int32');
849 t_pFiffDirEntry->pos = t_pInt32[k * 4 + 3]; //fread(fid,1,'int32');
850 p_ListFiffDir.append(t_pFiffDirEntry);
851 }
852 }
853 return p_ListFiffDir;
854}
855
856//=============================================================================================================
857// MATRIX
858//=============================================================================================================
859
860//=============================================================================================================
861
862inline Eigen::MatrixXi FiffTag::toIntMatrix() const
863{
864 if (!this->isMatrix() || this->getType() != FIFFT_INT || this->data() == nullptr)
865 return Eigen::MatrixXi();
866
867 qint32 ndim;
868 QVector<qint32> dims;
869 this->getMatrixDimensions(ndim, dims);
870
871 if (ndim != 2) {
872 qWarning("Only two-dimensional matrices are supported at this time");
873 return Eigen::MatrixXi();
874 }
875
876 // Use copy constructor instead --> slower performance but higher memory management reliability
877 Eigen::MatrixXi p_Matrix(Eigen::Map<const Eigen::MatrixXi>(reinterpret_cast<const int*>(this->data()), dims[0], dims[1]));
878
879 return p_Matrix;
880}
881
882//=============================================================================================================
883
884inline Eigen::MatrixXf FiffTag::toFloatMatrix() const
885{
886 if (!this->isMatrix() || this->getType() != FIFFT_FLOAT || this->data() == nullptr)
887 return Eigen::MatrixXf(); //NULL;
888
890 qWarning("Error in FiffTag::toFloatMatrix(): Matrix is not dense!");
891 return Eigen::MatrixXf();
892 }
893
894 qint32 ndim;
895 QVector<qint32> dims;
896 this->getMatrixDimensions(ndim, dims);
897
898 if (ndim != 2) {
899 qWarning("Only two-dimensional matrices are supported at this time");
900 return Eigen::MatrixXf();
901 }
902
903 // Use copy constructor instead --> slower performance but higher memory management reliability
904 Eigen::MatrixXf p_Matrix(Eigen::Map<const Eigen::MatrixXf>(reinterpret_cast<const float*>(this->data()), dims[0], dims[1]));
905
906 return p_Matrix;
907}
908
909} // NAMESPACE
910
911#endif // FIFF_TAG_H
FIFF channel descriptor record (FIFF_CH_INFO): per-channel logical/scanner numbers,...
Symbolic FIFF tag, block, value, unit and channel-type constants shared across FIFFLIB.
constexpr auto FIFFV_COORD_HEAD
#define FIFFV_EEG_CH
constexpr auto FIFFV_COORD_DEVICE
#define FIFFV_MEG_CH
constexpr auto FIFFV_COORD_UNKNOWN
constexpr auto FIFFV_REF_MEG_CH
4x4 affine FIFF coordinate transform (FIFF_COORD_TRANS) annotated with source/destination coordinate-...
FIFF tag-kind, block-kind and type-code numerical definitions, authoritative for FIFFLIB.
constexpr auto FIFFTS_MC_DENSE
Definition fiff_file.h:259
constexpr auto FIFFT_JULIAN
Definition fiff_file.h:225
constexpr auto FIFFT_CH_INFO_STRUCT
Definition fiff_file.h:238
constexpr auto FIFFT_DIG_POINT_STRUCT
Definition fiff_file.h:241
constexpr auto FIFFT_BYTE
Definition fiff_file.h:220
constexpr auto FIFFT_UINT
Definition fiff_file.h:227
constexpr auto FIFFT_ID_STRUCT
Definition fiff_file.h:239
constexpr auto FIFFT_COORD_TRANS_STRUCT
Definition fiff_file.h:243
constexpr auto FIFFT_DOUBLE
Definition fiff_file.h:224
constexpr auto FIFFT_STRING
Definition fiff_file.h:229
constexpr auto FIFFT_DAU_PACK16
Definition fiff_file.h:234
constexpr auto FIFFT_USHORT
Definition fiff_file.h:226
constexpr auto FIFFT_SHORT
Definition fiff_file.h:221
constexpr auto FIFFT_FLOAT
Definition fiff_file.h:223
constexpr auto FIFFT_DIR_ENTRY_STRUCT
Definition fiff_file.h:240
constexpr auto FIFFT_INT
Definition fiff_file.h:222
Export/import macros and build-info accessors for the FIFFLIB shared library.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:44
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)
Coil-frame position record embedded inside FIFF_CH_INFO: coil location and 3x3 EX/EY/EZ orientation t...
Single entry of the FIFF tag directory: kind, type, byte size and absolute file position.
Single digitization point (FIFF_DIG_POINT) with kind (cardinal/HPI/EEG/extra), identifier and 3D coor...
128-bit FIFF identifier record (machine ID + creation time) used to stamp files, blocks and parent re...
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
FIFF file I/O, in-memory data structures and high-level readers/writers.
qint32 fiff_int_t
Definition fiff_types.h:86
constexpr auto DATA_TYPE
Definition fiff_tag.h:137
constexpr auto MATRIX_CODING_CCS
Definition fiff_tag.h:135
constexpr auto IS_MATRIX
Definition fiff_tag.h:133
constexpr auto MATRIX_CODING_DENSE
Definition fiff_tag.h:134
constexpr auto MATRIX_CODING_RCS
Definition fiff_tag.h:136
Per-channel FIFF descriptor: identifiers, kind, calibration, coil type, channel-frame coil position a...
Eigen::Matrix< float, 3, 2, Eigen::DontAlign > eeg_loc
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > coil_trans
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
Eigen::Vector3f ey
Eigen::Vector3f ex
Eigen::Vector3f ez
Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse.
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > invtrans
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > trans
One digitizer point: kind (cardinal/HPI/EEG/extra), ident, 3D position in FIFFV_COORD_HEAD.
static qint32 storageSize()
Directory entry: tag kind + on-disk type + byte size + absolute file offset (16-byte record).
128-bit FIFF identifier: hardware machine ID plus creation time, stamped on every file and block.
Definition fiff_id.h:69
fiff_int_t machid[2]
Definition fiff_id.h:193
FiffTime time
Definition fiff_id.h:194
static qint32 storageSize()
Definition fiff_id.h:208
fiff_int_t version
Definition fiff_id.h:192
static fiff_int_t fiff_type_matrix_coding(fiff_int_t type)
Definition fiff_tag.cpp:712
~FiffTag()=default
QString toString() const
Definition fiff_tag.h:639
QSharedPointer< FiffTag > SPtr
Definition fiff_tag.h:163
Eigen::MatrixXf toFloatMatrix() const
Definition fiff_tag.h:884
fiff_int_t kind
Definition fiff_tag.h:530
const qint32 * toJulian() const
Definition fiff_tag.h:608
FiffTag(FiffTag &&other)=default
std::unique_ptr< FiffTag > UPtr
Definition fiff_tag.h:165
FiffCoordTrans toCoordTrans() const
Definition fiff_tag.h:704
std::unique_ptr< const FiffTag > ConstUPtr
Definition fiff_tag.h:166
const quint8 * toByte() const
Definition fiff_tag.h:557
fiff_int_t getMatrixCoding() const
Definition fiff_tag.cpp:60
Eigen::SparseMatrix< double > toSparseFloatMatrix() const
Definition fiff_tag.cpp:134
Eigen::MatrixXi toIntMatrix() const
Definition fiff_tag.h:862
const quint16 * toUnsignedShort() const
Definition fiff_tag.h:567
FiffChInfo toChInfo() const
Definition fiff_tag.h:744
FiffDigPoint toDigPoint() const
Definition fiff_tag.h:681
const double * toDouble() const
Definition fiff_tag.h:629
const qint16 * toDauPack16() const
Definition fiff_tag.h:649
const float * toFloat() const
Definition fiff_tag.h:619
const qint16 * toShort() const
Definition fiff_tag.h:577
static void convert_tag_data(const FiffTag::UPtr &tag, int from_endian, int to_endian)
Definition fiff_tag.cpp:443
static void convert_matrix_to_file_data(const FiffTag::UPtr &tag)
Definition fiff_tag.cpp:368
FiffTag & operator=(FiffTag &&other)=default
QString getInfo() const
Definition fiff_tag.cpp:143
bool isMatrix() const
Definition fiff_tag.cpp:67
fiff_int_t getType() const
Definition fiff_tag.cpp:123
FiffId toFiffID() const
Definition fiff_tag.h:661
fiff_int_t type
Definition fiff_tag.h:532
static qint32 storageSize()
Definition fiff_tag.h:544
const quint32 * toUnsignedInt() const
Definition fiff_tag.h:587
FiffTag & operator=(const FiffTag &other)=default
static void convert_matrix_from_file_data(const FiffTag::UPtr &tag)
Definition fiff_tag.cpp:291
fiff_int_t next
Definition fiff_tag.h:534
const qint32 * toInt() const
Definition fiff_tag.h:597
static void convert_ch_pos(FiffChPos *pos)
Definition fiff_tag.cpp:276
FiffTag(const FiffTag &p_FiffTag)=default
QSharedPointer< const FiffTag > ConstSPtr
Definition fiff_tag.h:164
bool getMatrixDimensions(qint32 &p_ndim, QVector< qint32 > &p_Dims) const
Definition fiff_tag.cpp:77
QList< QSharedPointer< FiffDirEntry > > toDirEntry() const
Definition fiff_tag.h:835