73 rmag = Eigen::Matrix<float, Eigen::Dynamic, 3, Eigen::RowMajor>::Zero(
np, 3);
74 cosmag = Eigen::Matrix<float, Eigen::Dynamic, 3, Eigen::RowMajor>::Zero(
np, 3);
75 w = Eigen::VectorXf::Zero(
np);
79 for (
int k = 0; k < 3; k++) {
94 if (!p_FwdCoil.
chname.isEmpty())
96 if (!p_FwdCoil.
desc.isEmpty())
102 this->
np = p_FwdCoil.
np;
109 this->
r0 = p_FwdCoil.
r0;
110 this->
ex = p_FwdCoil.
ex;
111 this->
ey = p_FwdCoil.
ey;
112 this->
ez = p_FwdCoil.
ez;
128 qWarning() << ch.
ch_name <<
"is not an EEG channel. Cannot create an electrode definition.";
132 qWarning(
"Inappropriate coordinate transformation in fwd_create_eeg_el");
138 res = std::make_unique<FwdCoil>(1);
140 res = std::make_unique<FwdCoil>(2);
143 res->desc =
"EEG electrode";
155 res->coord_frame = t.
to;
162 res->rmag.row(0) = res->r0.transpose();
163 res->cosmag.row(0) = res->r0.transpose();
164 res->cosmag.row(0).normalize();
170 res->rmag.row(1) = res->ex.transpose();
171 res->cosmag.row(1) = res->ex.transpose();
172 res->cosmag.row(1).normalize();
FiffChInfo class declaration.
FwdCoil class declaration.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
Forward modelling (BEM, MEG/EEG lead fields).
constexpr int FWD_COIL_ACCURACY_NORMAL
constexpr int FWD_COILC_EEG
constexpr int FWD_COIL_ACCURACY_POINT
constexpr int FWD_COILC_PLANAR_GRAD
constexpr int FWD_COILC_UNKNOWN
constexpr int FWD_COILC_AXIAL_GRAD2
constexpr int FWD_COILC_AXIAL_GRAD
constexpr int FWD_COILC_MAG
Coordinate transformation description.
std::unique_ptr< FwdCoil > UPtr
bool is_eeg_electrode() const
Eigen::Matrix< float, Eigen::Dynamic, 3, Eigen::RowMajor > cosmag
static FwdCoil::UPtr create_eeg_el(const FIFFLIB::FiffChInfo &ch, const FIFFLIB::FiffCoordTrans &t=FIFFLIB::FiffCoordTrans())
bool is_planar_coil() const
bool is_axial_coil() const
Eigen::Matrix< float, Eigen::Dynamic, 3, Eigen::RowMajor > rmag
bool is_magnetometer_coil() const
Eigen::MatrixX3f apply_trans(const Eigen::MatrixX3f &rr, bool do_move=true) const