41 #include <QtCore/QtDebug>
64 id = FIFFV_BEM_SURF_ID_UNKNOWN;
68 coord_frame = FIFFV_COORD_MRI;
77 QList<FiffDirEntry>fiffDirEntries;
79 if(!fiffStream->open(fiffDirTree, fiffDirEntries))
81 qCritical() <<
"Could not open FIFF stream!";
85 return read(fiffStream,
false, fiffDirTree, surfaces);
91 FiffDirTree& p_Tree, QList<MNESurface::SPtr>& surfaces)
96 qWarning() <<
"add_geom flag is not yet implemented!";
102 qCritical() <<
"No BEM block found!";
107 if(bemsurf.isEmpty())
109 qCritical() <<
"No BEM surfaces found!";
114 fiff_int_t coord_frame;
117 coord_frame = *tag->toInt();
120 qWarning() <<
"No FIFF_BEM_COORD_FRAME found!";
121 coord_frame = FIFFV_COORD_MRI;
124 QList<FiffDirTree>::Iterator itBemsurf;
125 for(itBemsurf = bemsurf.begin(); itBemsurf != bemsurf.end(); ++itBemsurf)
128 if(read(p_pStream.data(), *itBemsurf, coord_frame, surf))
130 surfaces.append(surf);
133 qWarning() <<
"Could not read surface!";
154 surf->id = *tag->toInt();
157 surf->id = FIFFV_BEM_SURF_ID_UNKNOWN;
158 qWarning() <<
"ID not found! Default: " << surf->id;
163 surf->sigma = *tag->toFloat();
167 qWarning() <<
"sigma not found! Default: " << surf->sigma;
172 surf->np = *tag->toInt();
175 qCritical() <<
"np not found!";
181 surf->ntri = *tag->toInt();
184 qCritical() <<
"ntri not found!";
190 surf->coord_frame = *tag->toInt();
194 <<
"FIFF_MNE_COORD_FRAME not found, trying FIFF_BEM_COORD_FRAME.";
197 surf->coord_frame = *tag->toInt();
200 surf->coord_frame = def_coord_frame;
201 qWarning() <<
"FIFF_BEM_COORD_FRAME not found! Default: "
202 << surf->coord_frame;
211 surf->rr.resize(3, surf->np);
212 surf->rr = tag->toFloatMatrix();
215 qCritical() <<
"Vertices not found!";
222 surf->nn.resize(3, surf->np);
223 surf->nn = tag->toFloatMatrix();
226 qWarning() <<
"Vertex normals not found!";
231 surf->tris.resize(3, surf->ntri);
232 surf->tris = tag->toIntMatrix();
235 qCritical() <<
"Triangulation not found!";
#define FIFF_MNE_SOURCE_SPACE_NORMALS
FiffDirEntry class declaration.
bool find_tag(FiffStream *p_pStream, fiff_int_t findkind, QSharedPointer< FiffTag > &p_pTag) const
QList< FiffDirTree > dir_tree_find(fiff_int_t p_kind) const
#define FIFF_BEM_COORD_FRAME
QSharedPointer< FiffTag > SPtr
QSharedPointer< FiffStream > SPtr
#define FIFF_BEM_SURF_NNODE
static bool read(QIODevice &p_IODevice, QList< MNESurface::SPtr > &surfaces)
Directory tree structure.
Contains the declaration of the MNESurface class.
#define FIFF_MNE_COORD_FRAME
#define FIFF_BEM_SURF_TRIANGLES
QSharedPointer< MNESurface > SPtr
FiffTag class declaration, which provides fiff tag I/O and processing methods.
#define FIFF_BEM_SURF_NTRI
#define FIFF_BEM_SURF_NODES