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//=============================================================================================================
80{
81public:
82 typedef QSharedPointer<MNEBem> SPtr;
83 typedef QSharedPointer<const MNEBem> ConstSPtr;
84
85 //=========================================================================================================
89 MNEBem();
90
91 //=========================================================================================================
97 MNEBem(const MNEBem& p_MNEBem);
98
99 //=========================================================================================================
105 MNEBem(QIODevice& p_IODevice);
106
107 //=========================================================================================================
111 ~MNEBem();
112
113 //=========================================================================================================
117 void clear();
118
119 //=========================================================================================================
125 inline bool isEmpty() const;
126
127 //=========================================================================================================
139 static bool readFromStream(FIFFLIB::FiffStream::SPtr& p_pStream, bool add_geom, MNEBem& p_Bem);
140
141 //=========================================================================================================
147 inline qint32 size() const;
148
149 //=========================================================================================================
159 bool write(QIODevice& p_IODevice);
160
161 //=========================================================================================================
169 void writeToStream(FIFFLIB::FiffStream* p_pStream);
170
171 //=========================================================================================================
179 const MNEBemSurface& operator[](qint32 idx) const;
180
181 //=========================================================================================================
189 MNEBemSurface& operator[](qint32 idx);
190
191 //=========================================================================================================
199 MNEBem& operator<<(const MNEBemSurface& surf);
200
201 //=========================================================================================================
209 MNEBem& operator<<(const MNEBemSurface* surf);
210
211 //=========================================================================================================
218 void warp(const Eigen::MatrixXf& sLm, const Eigen::MatrixXf& dLm);
219
220 //=========================================================================================================
226 void transform(const FIFFLIB::FiffCoordTrans& trans);
227
228 //=========================================================================================================
234 void invtransform(const FIFFLIB::FiffCoordTrans& trans);
235
236protected:
237 //=========================================================================================================
248 static bool readBemSurface(FIFFLIB::FiffStream::SPtr& p_pStream, const FIFFLIB::FiffDirNode::SPtr& p_Tree, MNEBemSurface& p_BemSurface);
249
250private:
251 QList<MNEBemSurface> m_qListBemSurface;
252};
253
254//=============================================================================================================
255// INLINE DEFINITIONS
256//=============================================================================================================
257
258inline bool MNEBem::isEmpty() const
259{
260 return m_qListBemSurface.size() == 0;
261}
262
263//=============================================================================================================
264
265inline qint32 MNEBem::size() const
266{
267 return m_qListBemSurface.size();
268}
269} // NAMESPACE
270
271#ifndef metatype_bem
272#define metatype_bem
274#endif
275
276#ifndef metatype_bem_sptr
277#define metatype_bem_sptr
279#endif
280
281#endif // MNE_BEM_H
Static MATLAB-style FIFF facade: thin wrapper functions kept for parity with the historical mne-matla...
Recursive node of the parsed FIFF block tree (FIFFB_* hierarchy with directory entries and children).
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
Single closed BEM surface (triangulation, normals, conductivity).
Q_DECLARE_METATYPE(MNELIB::MNEBem)
MNELIB shared-library export/import macros and library build metadata.
#define MNESHARED_EXPORT
Definition mne_global.h:40
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:81
Aggregated boundary element model loaded from a -bem.fif file.
Definition mne_bem.h:80
QSharedPointer< const MNEBem > ConstSPtr
Definition mne_bem.h:83
bool write(QIODevice &p_IODevice)
Definition mne_bem.cpp:286
qint32 size() const
Definition mne_bem.h:265
QSharedPointer< MNEBem > SPtr
Definition mne_bem.h:82
void invtransform(const FIFFLIB::FiffCoordTrans &trans)
Definition mne_bem.cpp:412
void transform(const FIFFLIB::FiffCoordTrans &trans)
Definition mne_bem.cpp:399
static bool readBemSurface(FIFFLIB::FiffStream::SPtr &p_pStream, const FIFFLIB::FiffDirNode::SPtr &p_Tree, MNEBemSurface &p_BemSurface)
Definition mne_bem.cpp:163
void writeToStream(FIFFLIB::FiffStream *p_pStream)
Definition mne_bem.cpp:300
void warp(const Eigen::MatrixXf &sLm, const Eigen::MatrixXf &dLm)
Definition mne_bem.cpp:381
static bool readFromStream(FIFFLIB::FiffStream::SPtr &p_pStream, bool add_geom, MNEBem &p_Bem)
Definition mne_bem.cpp:96
bool isEmpty() const
Definition mne_bem.h:258
const MNEBemSurface & operator[](qint32 idx) const
Definition mne_bem.cpp:316
MNEBem & operator<<(const MNEBemSurface &surf)
Definition mne_bem.cpp:365
BEM surface provides geometry information.