40 #include <QtCore/QtDebug>
52 using namespace MNELIB;
53 using namespace FIFFLIB;
61 id = FIFFV_BEM_SURF_ID_UNKNOWN;
65 coord_frame = FIFFV_COORD_MRI;
74 if(!fiffStream->open())
76 qCritical() <<
"Could not open FIFF stream!";
80 return read(fiffStream,
false, fiffStream->dirtree(), surfaces);
90 qWarning() <<
"add_geom flag is not yet implemented!";
93 QList<FiffDirNode::SPtr>bem = p_Tree->dir_tree_find(
FIFFB_BEM);
96 qCritical() <<
"No BEM block found!";
100 QList<FiffDirNode::SPtr>bemsurf = p_Tree->dir_tree_find(
FIFFB_BEM_SURF);
101 if(bemsurf.isEmpty())
103 qCritical() <<
"No BEM surfaces found!";
108 fiff_int_t coord_frame;
111 coord_frame = *tag->toInt();
114 qWarning() <<
"No FIFF_BEM_COORD_FRAME found!";
115 coord_frame = FIFFV_COORD_MRI;
118 QList<FiffDirNode::SPtr>::Iterator itBemsurf;
119 for(itBemsurf = bemsurf.begin(); itBemsurf != bemsurf.end(); ++itBemsurf)
122 if(read(p_pStream, *itBemsurf, coord_frame, surf))
124 surfaces.append(surf);
127 qWarning() <<
"Could not read surface!";
148 surf->id = *tag->toInt();
151 surf->id = FIFFV_BEM_SURF_ID_UNKNOWN;
152 qWarning() <<
"ID not found! Default: " << surf->id;
157 surf->sigma = *tag->toFloat();
161 qWarning() <<
"sigma not found! Default: " << surf->sigma;
166 surf->np = *tag->toInt();
169 qCritical() <<
"np not found!";
175 surf->ntri = *tag->toInt();
178 qCritical() <<
"ntri not found!";
184 surf->coord_frame = *tag->toInt();
188 <<
"FIFF_MNE_COORD_FRAME not found, trying FIFF_BEM_COORD_FRAME.";
191 surf->coord_frame = *tag->toInt();
194 surf->coord_frame = def_coord_frame;
195 qWarning() <<
"FIFF_BEM_COORD_FRAME not found! Default: "
196 << surf->coord_frame;
206 surf->rr.resize(3, surf->np);
207 surf->rr = tag->toFloatMatrix();
210 qCritical() <<
"Vertices not found!";
218 surf->nn.resize(3, surf->np);
219 surf->nn = tag->toFloatMatrix();
222 qWarning() <<
"Vertex normals not found!";
228 surf->tris.resize(3, surf->ntri);
229 surf->tris = tag->toIntMatrix();
232 qCritical() <<
"Triangulation not found!";