v2.0.0
Loading...
Searching...
No Matches
fiff_ch_info.h
Go to the documentation of this file.
1//=============================================================================================================
32
33#ifndef FIFF_CH_INFO_H
34#define FIFF_CH_INFO_H
35
36//=============================================================================================================
37// INCLUDES
38//=============================================================================================================
39
40#include "fiff_global.h"
41#include "fiff_types.h"
42#include "fiff_ch_pos.h"
43
44//=============================================================================================================
45// QT INCLUDES
46//=============================================================================================================
47
48#include <QSharedPointer>
49#include <QString>
50
51//=============================================================================================================
52// EIGEN INCLUDES
53//=============================================================================================================
54
55#include <Eigen/Core>
56#include <memory>
57
58//=============================================================================================================
59// DEFINE NAMESPACE FIFFLIB
60//=============================================================================================================
61
62namespace FIFFLIB
63{
64
65//=============================================================================================================
78{
79public:
80 using SPtr = QSharedPointer<FiffChInfo>;
81 using ConstSPtr = QSharedPointer<const FiffChInfo>;
82 using UPtr = std::unique_ptr<FiffChInfo>;
83 using ConstUPtr = std::unique_ptr<const FiffChInfo>;
84
85 //=========================================================================================================
89 FiffChInfo();
90
91 //=========================================================================================================
97 FiffChInfo(const FiffChInfo& p_FiffChInfo);
98
99 //=========================================================================================================
110 FiffChInfo& operator=(const FiffChInfo& other) = default;
111
112 //=========================================================================================================
116 ~FiffChInfo();
117
118 //=========================================================================================================
124 inline static qint32 storageSize();
125
126 //=========================================================================================================
135 static bool checkEegLocations(const QList<FiffChInfo>& chs, int nch);
136
137 //=========================================================================================================
146 bool isValidEeg() const;
147
148 //=========================================================================================================
157 friend bool operator==(const FiffChInfo& a, const FiffChInfo& b);
158
159public:
168 QString ch_name;
169
170 //Convenience members - MATLAB -
171 Eigen::Matrix<float, 4, 4, Eigen::DontAlign> coil_trans;
172 Eigen::Matrix<float, 3, 2, Eigen::DontAlign> eeg_loc;
174};
175
176//=============================================================================================================
177// INLINE DEFINITIONS
178//=============================================================================================================
179
181{
182 // On-disk layout: scanNo, logNo, kind, range, cal, chpos, unit, unit_mul, ch_name[16]
183 // (C++ class uses QString but on-disk stores fixed 16-char name)
184 return 3 * sizeof(fiff_int_t) + 2 * sizeof(fiff_float_t) + FiffChPos::storageSize() + 2 * sizeof(fiff_int_t) + 16;
185}
186
187//=============================================================================================================
188
189inline bool operator==(const FiffChInfo& a, const FiffChInfo& b)
190{
191 return (a.scanNo == b.scanNo &&
192 a.logNo == b.logNo &&
193 a.kind == b.kind &&
194 a.cal == b.cal &&
195 a.chpos == b.chpos &&
196 a.unit == b.unit &&
197 a.unit_mul == b.unit_mul &&
198 a.coil_trans.isApprox(b.coil_trans, 0.0001f) &&
199 a.eeg_loc.isApprox(b.eeg_loc, 0.0001f) &&
200 a.coord_frame == b.coord_frame);
201}
202} // NAMESPACE
203
204#endif // FIFF_CH_INFO_H
Export/import macros and build-info accessors for the FIFFLIB shared library.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:44
Coil-frame position record embedded inside FIFF_CH_INFO: coil location and 3x3 EX/EY/EZ orientation t...
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
float fiff_float_t
Definition fiff_types.h:90
bool operator==(const FiffChInfo &a, const FiffChInfo &b)
std::unique_ptr< FiffChInfo > UPtr
Eigen::Matrix< float, 3, 2, Eigen::DontAlign > eeg_loc
bool isValidEeg() const
FiffChInfo & operator=(const FiffChInfo &other)=default
friend bool operator==(const FiffChInfo &a, const FiffChInfo &b)
static bool checkEegLocations(const QList< FiffChInfo > &chs, int nch)
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > coil_trans
static qint32 storageSize()
std::unique_ptr< const FiffChInfo > ConstUPtr
QSharedPointer< const FiffChInfo > ConstSPtr
QSharedPointer< FiffChInfo > SPtr
Channel coil-frame placement: origin r0 (m) and orthonormal axes ex / ey / ez in FIFFV_COORD_DEVICE.
Definition fiff_ch_pos.h:65
static qint32 storageSize()