v2.0.0
Loading...
Searching...
No Matches
mne_bem.h
Go to the documentation of this file.
1//=============================================================================================================
24
25#ifndef MNE_BEM_H
26#define MNE_BEM_H
27
28//=============================================================================================================
29// INCLUDES
30//=============================================================================================================
31
32#include "mne_global.h"
33#include "mne_bem_surface.h"
34
35#include <fiff/fiff_types.h>
36#include <fiff/fiff_dir_node.h>
37#include <fiff/fiff.h>
38
39#include <algorithm>
40#include <vector>
41
42//=============================================================================================================
43// QT INCLUDES
44//=============================================================================================================
45
46#include <QList>
47#include <QIODevice>
48#include <QSharedPointer>
49
50//=============================================================================================================
51// FORWARD DECLARATIONS
52//=============================================================================================================
53
54namespace FSLIB
55{
56class FsLabel;
57}
58
59//=============================================================================================================
60// DEFINE NAMESPACE MNELIB
61//=============================================================================================================
62
63namespace MNELIB
64{
65
66//=============================================================================================================
67// MNELIB FORWARD DECLARATIONS
68//=============================================================================================================
69
70//=============================================================================================================
78{
79
80public:
81 typedef QSharedPointer<MNEBem> SPtr;
82 typedef QSharedPointer<const MNEBem> ConstSPtr;
83
84 //=========================================================================================================
88 MNEBem();
89
90 //=========================================================================================================
96 MNEBem(const MNEBem &p_MNEBem);
97
98 //=========================================================================================================
102 MNEBem(QIODevice &p_IODevice);
103
104 //=========================================================================================================
108 ~MNEBem();
109
110 //=========================================================================================================
114 void clear();
115
116 //=========================================================================================================
122 inline bool isEmpty() const;
123
124 //=========================================================================================================
135 static bool readFromStream(FIFFLIB::FiffStream::SPtr& p_pStream, bool add_geom, MNEBem &p_Bem);
136
137 //=========================================================================================================
143 inline qint32 size() const;
144
145 //=========================================================================================================
153 void write(QIODevice &p_IODevice);
154
155 //=========================================================================================================
163 void writeToStream(FIFFLIB::FiffStream *p_pStream);
164
165 //=========================================================================================================
173 const MNEBemSurface& operator[] (qint32 idx) const;
174
175 //=========================================================================================================
183 MNEBemSurface& operator[] (qint32 idx);
184
185 //=========================================================================================================
193 MNEBem& operator<< (const MNEBemSurface& surf);
194
195 //=========================================================================================================
203 MNEBem& operator<< (const MNEBemSurface* surf);
204
205 //=========================================================================================================
212 void warp(const Eigen::MatrixXf &sLm, const Eigen::MatrixXf &dLm);
213
214 //=========================================================================================================
220 void transform(const FIFFLIB::FiffCoordTrans& trans);
221
222 //=========================================================================================================
228 void invtransform(const FIFFLIB::FiffCoordTrans& trans);
229
230protected:
231 //=========================================================================================================
242 static bool readBemSurface(FIFFLIB::FiffStream::SPtr& p_pStream, const FIFFLIB::FiffDirNode::SPtr& p_Tree, MNEBemSurface& p_BemSurface);
243
244private:
245 QList<MNEBemSurface> m_qListBemSurface;
246};
247
248//=============================================================================================================
249// INLINE DEFINITIONS
250//=============================================================================================================
251
252inline bool MNEBem::isEmpty() const
253{
254 return m_qListBemSurface.size() == 0;
255}
256
257//=============================================================================================================
258
259inline qint32 MNEBem::size() const
260{
261 return m_qListBemSurface.size();
262}
263} // NAMESPACE
264
265#ifndef metatype_bem
266#define metatype_bem
268#endif
269
270#ifndef metatype_bem_sptr
271#define metatype_bem_sptr
273#endif
274
275#endif // MNE_BEM_H
Q_DECLARE_METATYPE(MNELIB::MNEBem)
Single closed BEM surface (triangulation, normals, conductivity).
MNELIB shared-library export/import macros and library build metadata.
#define MNESHARED_EXPORT
Definition mne_global.h:40
Recursive node of the parsed FIFF block tree (FIFFB_* hierarchy with directory entries and children).
Static MATLAB-style FIFF facade: thin wrapper functions kept for parity with the historical mne-matla...
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
Core MNE data structures (source spaces, source estimates, hemispheres).
FreeSurfer surface, annotation and parcellation I/O for mne-cpp.
Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse.
QSharedPointer< FiffDirNode > SPtr
FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every...
QSharedPointer< FiffStream > SPtr
A FreeSurfer/MNE surface label: per-vertex indices, Tk-RAS positions and scalar values for one hemisp...
Definition fs_label.h:79
Aggregated boundary element model loaded from a -bem.fif file.
Definition mne_bem.h:78
QSharedPointer< const MNEBem > ConstSPtr
Definition mne_bem.h:82
qint32 size() const
Definition mne_bem.h:259
QSharedPointer< MNEBem > SPtr
Definition mne_bem.h:81
void invtransform(const FIFFLIB::FiffCoordTrans &trans)
Definition mne_bem.cpp:442
void transform(const FIFFLIB::FiffCoordTrans &trans)
Definition mne_bem.cpp:428
static bool readBemSurface(FIFFLIB::FiffStream::SPtr &p_pStream, const FIFFLIB::FiffDirNode::SPtr &p_Tree, MNEBemSurface &p_BemSurface)
Definition mne_bem.cpp:173
void writeToStream(FIFFLIB::FiffStream *p_pStream)
Definition mne_bem.cpp:351
void warp(const Eigen::MatrixXf &sLm, const Eigen::MatrixXf &dLm)
Definition mne_bem.cpp:408
void write(QIODevice &p_IODevice)
Definition mne_bem.cpp:336
static bool readFromStream(FIFFLIB::FiffStream::SPtr &p_pStream, bool add_geom, MNEBem &p_Bem)
Definition mne_bem.cpp:97
bool isEmpty() const
Definition mne_bem.h:252
BEM surface provides geometry information.