v2.0.0
Loading...
Searching...
No Matches
fiff_ch_info.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef FIFF_CH_INFO_H
38#define FIFF_CH_INFO_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fiff_global.h"
45#include "fiff_types.h"
46#include "fiff_ch_pos.h"
47
48//=============================================================================================================
49// QT INCLUDES
50//=============================================================================================================
51
52#include <QSharedPointer>
53#include <QString>
54
55//=============================================================================================================
56// EIGEN INCLUDES
57//=============================================================================================================
58
59#include <Eigen/Core>
60#include <memory>
61
62//=============================================================================================================
63// DEFINE NAMESPACE FIFFLIB
64//=============================================================================================================
65
66namespace FIFFLIB
67{
68
69//=============================================================================================================
76{
77public:
78 using SPtr = QSharedPointer<FiffChInfo>;
79 using ConstSPtr = QSharedPointer<const FiffChInfo>;
80 using UPtr = std::unique_ptr<FiffChInfo>;
81 using ConstUPtr = std::unique_ptr<const FiffChInfo>;
82
83 //=========================================================================================================
87 FiffChInfo();
88
89 //=========================================================================================================
95 FiffChInfo(const FiffChInfo &p_FiffChInfo);
96
97 //=========================================================================================================
101 ~FiffChInfo();
102
103 //=========================================================================================================
109 inline static qint32 storageSize();
110
111 //=========================================================================================================
120 static bool checkEegLocations(const QList<FiffChInfo>& chs, int nch);
121
122 //=========================================================================================================
131 bool isValidEeg() const;
132
133 //=========================================================================================================
141 friend bool operator== (const FiffChInfo &a, const FiffChInfo &b);
142
143public:
152 QString ch_name;
153
154 //Convenience members - MATLAB -
155 Eigen::Matrix<float,4,4, Eigen::DontAlign> coil_trans;
156 Eigen::Matrix<float,3,2, Eigen::DontAlign> eeg_loc;
158
159};
160
161//=============================================================================================================
162// INLINE DEFINITIONS
163//=============================================================================================================
164
166{
167 // On-disk layout: scanNo, logNo, kind, range, cal, chpos, unit, unit_mul, ch_name[16]
168 // (C++ class uses QString but on-disk stores fixed 16-char name)
169 return 3 * sizeof(fiff_int_t) + 2 * sizeof(fiff_float_t)
170 + FiffChPos::storageSize() + 2 * sizeof(fiff_int_t) + 16;
171}
172
173//=============================================================================================================
174
175inline bool operator== (const FiffChInfo &a, const FiffChInfo &b)
176{
177 return (a.scanNo == b.scanNo &&
178 a.logNo == b.logNo &&
179 a.kind == b.kind &&
180 a.range == b.range &&
181 a.cal == b.cal &&
182 a.chpos == b.chpos &&
183 a.unit == b.unit &&
184 a.unit_mul == b.unit_mul &&
185 a.coil_trans.isApprox(b.coil_trans, 0.0001f) &&
186 a.eeg_loc.isApprox(b.eeg_loc, 0.0001f) &&
187 a.coord_frame == b.coord_frame);
188}
189} // NAMESPACE
190
191#endif // FIFF_CH_INFO_H
FiffChPos class declaration.
Fiff library export/import macros.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:52
Old fiff_type declarations - replace them.
bool operator==(const BIDSPath &a, const BIDSPath &b)
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
qint32 fiff_int_t
Definition fiff_types.h:89
float fiff_float_t
Definition fiff_types.h:93
bool operator==(const FiffChInfo &a, const FiffChInfo &b)
std::unique_ptr< FiffChInfo > UPtr
bool isValidEeg() const
static bool checkEegLocations(const QList< FiffChInfo > &chs, int nch)
static qint32 storageSize()
std::unique_ptr< const FiffChInfo > ConstUPtr
QSharedPointer< const FiffChInfo > ConstSPtr
Eigen::Matrix< float, 3, 2, Eigen::DontAlign > eeg_loc
QSharedPointer< FiffChInfo > SPtr
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > coil_trans
Measurement channel position and coil type.
Definition fiff_ch_pos.h:68
static qint32 storageSize()