59,
tri_nn(MatrixX3d::Zero(0,3))
77 id = p_MNEBemSurface.
id;
78 np = p_MNEBemSurface.
np;
82 rr = p_MNEBemSurface.
rr;
83 nn = p_MNEBemSurface.
nn;
108 tri_nn = MatrixX3d::Zero(0,3);
121 printf(
"\tCompleting triangulation info...");
130 for (qint32 i = 0; i < this->
ntri; ++i)
132 for ( qint32 j = 0; j < 3; ++j)
134 k = this->
itris(i, j);
136 r(j,0) = this->
rr(k, 0);
137 r(j,1) = this->
rr(k, 1);
138 r(j,2) = this->
rr(k, 2);
147 a = r.row(1) - r.row(0 );
148 b = r.row(2) - r.row(0);
149 this->
tri_nn(i,0) = a(1)*b(2)-a(2)*b(1);
150 this->
tri_nn(i,1) = a(2)*b(0)-a(0)*b(2);
151 this->
tri_nn(i,2) = a(0)*b(1)-a(1)*b(0);
154 size = this->
tri_nn.row(i)*this->
tri_nn.row(i).transpose();
155 size = std::pow(size, 0.5f );
158 this->
tri_nn.row(i) /= size;
161 std::fstream doc(
"./Output/tri_area.dat", std::ofstream::out | std::ofstream::trunc);
169 printf(
"Adding additional geometry info\n");
186 std::vector<std::vector<int>> temp_ntri(this->
itris.rows());
187 for (p = 0; p < this->
itris.rows(); p++) {
188 for (k = 0; k < 3; k++) {
189 temp_ntri[this->
itris(p,k)].push_back(p);
193 for (k = 0; k < static_cast<int>(temp_ntri.size()); k++) {
194 neighbor_tri[k] = Eigen::Map<Eigen::VectorXi>(temp_ntri[k].data(), temp_ntri[k].size());
200 std::vector<std::vector<int>> temp_nvert(this->
np);
201 for (k = 0; k < this->
np; k++) {
204 for (c = 0; c < 3; c++) {
210 for (q = 0; q < static_cast<int>(temp_nvert[k].size()); q++) {
211 if (temp_nvert[k][q] == vert) {
218 temp_nvert[k].push_back(vert);
225 for (k = 0; k < this->np; k++) {
226 neighbor_vert[k] = Eigen::Map<Eigen::VectorXi>(temp_nvert[k].data(), temp_nvert[k].size());
244 for (qint32 p = 0; p < this->
ntri; ++p)
246 for (qint32 j = 0; j < 3 ; ++j)
249 nodenr = this->
itris(p,j);
250 this->
nn(nodenr,0) += this->
tri_nn(p,0);
251 this->
nn(nodenr,1) += this->
tri_nn(p,1);
252 this->
nn(nodenr,2) += this->
tri_nn(p,2);
257 for (qint32 p = 0; p < this->
np; ++p)
260 size = this->
nn.row(p)*this->
nn.row(p).transpose();
261 size = std::pow(size, 0.5f );
262 this->
nn.row(p) /= size;
295 default:
return "Unknown";
#define FIFF_MNE_COORD_FRAME
#define FIFFV_MNE_SURF_UNKNOWN
#define FIFFV_BEM_SURF_ID_UNKNOWN
#define FIFF_BEM_SURF_NNODE
#define FIFFV_BEM_SURF_ID_SKULL
#define FIFF_BEM_SURF_NODES
#define FIFF_BEM_SURF_TRIANGLES
#define FIFF_BEM_SURF_NTRI
#define FIFFV_BEM_SURF_ID_HEAD
#define FIFF_BEM_SURF_NORMALS
#define FIFFV_BEM_SURF_ID_BRAIN
MNEBemSurface class declaration.
Core MNE data structures (source spaces, source estimates, hemispheres).
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
fiff_long_t write_float_matrix(fiff_int_t kind, const Eigen::MatrixXf &mat)
fiff_long_t write_int_matrix(fiff_int_t kind, const Eigen::MatrixXi &mat)
fiff_long_t write_int(fiff_int_t kind, const fiff_int_t *data, fiff_int_t nel=1, fiff_int_t next=FIFFV_NEXT_SEQ)
fiff_long_t write_float(fiff_int_t kind, const float *data, fiff_int_t nel=1)
void writeToStream(FIFFLIB::FiffStream *p_pStream)
Eigen::MatrixX3d tri_cent
static QString id_name(int id)
std::vector< Eigen::VectorXi > neighbor_tri
std::vector< Eigen::VectorXi > neighbor_vert