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) = default;
98
99 //=========================================================================================================
107 MNEBem& operator=(const MNEBem& p_MNEBem) = default;
108
109 //=========================================================================================================
115 MNEBem(QIODevice& p_IODevice);
116
117 //=========================================================================================================
121 ~MNEBem();
122
123 //=========================================================================================================
127 void clear();
128
129 //=========================================================================================================
135 inline bool isEmpty() const;
136
137 //=========================================================================================================
149 static bool readFromStream(FIFFLIB::FiffStream::SPtr& p_pStream, bool add_geom, MNEBem& p_Bem);
150
151 //=========================================================================================================
157 inline qint32 size() const;
158
159 //=========================================================================================================
169 bool write(QIODevice& p_IODevice);
170
171 //=========================================================================================================
179 void writeToStream(FIFFLIB::FiffStream* p_pStream);
180
181 //=========================================================================================================
189 const MNEBemSurface& operator[](qint32 idx) const;
190
191 //=========================================================================================================
199 MNEBemSurface& operator[](qint32 idx);
200
201 //=========================================================================================================
209 MNEBem& operator<<(const MNEBemSurface& surf);
210
211 //=========================================================================================================
219 MNEBem& operator<<(const MNEBemSurface* surf);
220
221 //=========================================================================================================
228 void warp(const Eigen::MatrixXf& sLm, const Eigen::MatrixXf& dLm);
229
230 //=========================================================================================================
236 void transform(const FIFFLIB::FiffCoordTrans& trans);
237
238 //=========================================================================================================
244 void invtransform(const FIFFLIB::FiffCoordTrans& trans);
245
246protected:
247 //=========================================================================================================
258 static bool readBemSurface(FIFFLIB::FiffStream::SPtr& p_pStream, const FIFFLIB::FiffDirNode::SPtr& p_Tree, MNEBemSurface& p_BemSurface);
259
260private:
261 QList<MNEBemSurface> m_qListBemSurface;
262};
263
264//=============================================================================================================
265// INLINE DEFINITIONS
266//=============================================================================================================
267
268inline bool MNEBem::isEmpty() const
269{
270 return m_qListBemSurface.size() == 0;
271}
272
273//=============================================================================================================
274
275inline qint32 MNEBem::size() const
276{
277 return m_qListBemSurface.size();
278}
279} // NAMESPACE
280
281#ifndef metatype_bem
282#define metatype_bem
284#endif
285
286#ifndef metatype_bem_sptr
287#define metatype_bem_sptr
289#endif
290
291#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:283
qint32 size() const
Definition mne_bem.h:275
QSharedPointer< MNEBem > SPtr
Definition mne_bem.h:82
MNEBem(const MNEBem &p_MNEBem)=default
MNEBem & operator=(const MNEBem &p_MNEBem)=default
void invtransform(const FIFFLIB::FiffCoordTrans &trans)
Definition mne_bem.cpp:409
void transform(const FIFFLIB::FiffCoordTrans &trans)
Definition mne_bem.cpp:396
static bool readBemSurface(FIFFLIB::FiffStream::SPtr &p_pStream, const FIFFLIB::FiffDirNode::SPtr &p_Tree, MNEBemSurface &p_BemSurface)
Definition mne_bem.cpp:162
void writeToStream(FIFFLIB::FiffStream *p_pStream)
Definition mne_bem.cpp:297
void warp(const Eigen::MatrixXf &sLm, const Eigen::MatrixXf &dLm)
Definition mne_bem.cpp:378
static bool readFromStream(FIFFLIB::FiffStream::SPtr &p_pStream, bool add_geom, MNEBem &p_Bem)
Definition mne_bem.cpp:89
bool isEmpty() const
Definition mne_bem.h:268
const MNEBemSurface & operator[](qint32 idx) const
Definition mne_bem.cpp:313
MNEBem & operator<<(const MNEBemSurface &surf)
Definition mne_bem.cpp:362
BEM surface provides geometry information.