v2.0.0
Loading...
Searching...
No Matches
fiff_ch_info.cpp
Go to the documentation of this file.
1//=============================================================================================================
36
37//=============================================================================================================
38// INCLUDES
39//=============================================================================================================
40
41#include "fiff_ch_info.h"
42#include "fiff_constants.h"
43
44//=============================================================================================================
45// USED NAMESPACES
46//=============================================================================================================
47
48using namespace FIFFLIB;
49
50//=============================================================================================================
51// DEFINE MEMBER METHODS
52//=============================================================================================================
53
55: scanNo(0)
56, logNo(0)
57, kind(0)
58, range(1.0f)
59, cal(1.0f)
60, unit(0)
61, unit_mul(0)
62, ch_name(QString(""))
63, coil_trans()
64, eeg_loc()
66{
67 coil_trans.setIdentity();
68 eeg_loc.setZero();
69}
70
71//=============================================================================================================
72
74: scanNo(p_FiffChInfo.scanNo)
75, logNo(p_FiffChInfo.logNo)
76, kind(p_FiffChInfo.kind)
77, range(p_FiffChInfo.range)
78, cal(p_FiffChInfo.cal)
79, chpos(p_FiffChInfo.chpos)
80, unit(p_FiffChInfo.unit)
81, unit_mul(p_FiffChInfo.unit_mul)
82, ch_name(p_FiffChInfo.ch_name)
83, coil_trans(p_FiffChInfo.coil_trans)
84, eeg_loc(p_FiffChInfo.eeg_loc)
85, coord_frame(p_FiffChInfo.coord_frame)
86{
87}
88
89//=============================================================================================================
90
94
95//=============================================================================================================
96
97bool FiffChInfo::checkEegLocations(const QList<FiffChInfo>& chs, int nch)
98{
99 const float close = 0.02f;
100 for (int k = 0; k < nch; k++) {
101 if (chs.at(k).kind == FIFFV_EEG_CH) {
102 if (chs.at(k).chpos.r0.norm() < close) {
103 qCritical("Some EEG channels do not have locations assigned.");
104 return false;
105 }
106 }
107 }
108 return true;
109}
110
111//=============================================================================================================
112
114{
115 constexpr float TOO_CLOSE = 1e-4f;
116 return kind == FIFFV_EEG_CH
117 && chpos.r0.norm() >= TOO_CLOSE
118 && chpos.coil_type != FIFFV_COIL_NONE;
119}
Fiff constants.
#define FIFFV_EEG_CH
#define FIFFV_COORD_UNKNOWN
#define FIFFV_COIL_NONE
FiffChInfo class declaration.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
bool isValidEeg() const
static bool checkEegLocations(const QList< FiffChInfo > &chs, int nch)
Eigen::Matrix< float, 3, 2, Eigen::DontAlign > eeg_loc
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > coil_trans