MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
mne_sourcespace.h
Go to the documentation of this file.
1//=============================================================================================================
37#ifndef MNE_SOURCESPACE_H
38#define MNE_SOURCESPACE_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "mne_global.h"
45#include "mne_hemisphere.h"
46
47#include <fiff/fiff_types.h>
48#include <fiff/fiff_dir_node.h>
49#include <fiff/fiff.h>
50
51#include <algorithm>
52#include <vector>
53
54//=============================================================================================================
55// EIGEN INCLUDES
56//=============================================================================================================
57
58#include <Eigen/Core>
59
60//=============================================================================================================
61// QT INCLUDES
62//=============================================================================================================
63
64#include <QList>
65
66//=============================================================================================================
67// FORWARD DECLARATIONS
68//=============================================================================================================
69
70namespace FSLIB
71{
72 class Label;
73}
74
75//=============================================================================================================
76// DEFINE NAMESPACE MNELIB
77//=============================================================================================================
78
79namespace MNELIB
80{
81
82//=============================================================================================================
83// MNELIB FORWARD DECLARATIONS
84//=============================================================================================================
85
86//=============================================================================================================
93{
94public:
95 typedef QSharedPointer<MNESourceSpace> SPtr;
96 typedef QSharedPointer<const MNESourceSpace> ConstSPtr;
98 //=========================================================================================================
103
104 //=========================================================================================================
110 MNESourceSpace(const MNESourceSpace &p_MNESourceSpace);
111
112 //=========================================================================================================
117
118 //=========================================================================================================
122 void clear();
123
124 //=========================================================================================================
130 inline bool isEmpty() const;
131
132 //=========================================================================================================
142 static qint32 find_source_space_hemi(MNEHemisphere& p_Hemisphere);
143
144 //=========================================================================================================
150 QList<Eigen::VectorXi> get_vertno() const;
151
152 //=========================================================================================================
162 QList<Eigen::VectorXi> label_src_vertno_sel(const FSLIB::Label &p_label, Eigen::VectorXi &src_sel) const;
163
164 //=========================================================================================================
175 static bool patch_info(MNEHemisphere &p_Hemisphere);//VectorXi& nearest, QList<VectorXi>& pinfo);@param[in] nearest The nearest vector of the source space.@param[in, out] pinfo The requested patch information.
176
177 //=========================================================================================================
185 MNESourceSpace pick_regions(const QList<FSLIB::Label> &p_qListLabels) const;
186
187 //=========================================================================================================
199 static bool readFromStream(FIFFLIB::FiffStream::SPtr& p_pStream,
200 bool add_geom,
201 MNESourceSpace& p_SourceSpace);
202
203 //=========================================================================================================
209 inline qint32 size() const;
210
211 //=========================================================================================================
226 bool transform_source_space_to(FIFFLIB::fiff_int_t dest,
228
229 //=========================================================================================================
237 void writeToStream(FIFFLIB::FiffStream* p_pStream);
238
239 //=========================================================================================================
247 MNEHemisphere& operator[] (qint32 idx);
248
249 //=========================================================================================================
257 const MNEHemisphere& operator[] (qint32 idx) const;
258
259 //=========================================================================================================
267 MNEHemisphere& operator[] (QString idt);
268
269 //=========================================================================================================
277 const MNEHemisphere& operator[] (QString idt) const;
278
286 friend bool operator== (const MNESourceSpace &a, const MNESourceSpace &b);
287
288private:
289
290 //=========================================================================================================
300 static bool complete_source_space_info(MNEHemisphere& p_Hemisphere);
301
302 //=========================================================================================================
314 static bool read_source_space(FIFFLIB::FiffStream::SPtr& p_pStream,
315 const FIFFLIB::FiffDirNode::SPtr& p_Tree,
316 MNEHemisphere& p_Hemisphere);
317
318private:
319 QList<MNEHemisphere> m_qListHemispheres;
320};
321
322//=============================================================================================================
323// INLINE DEFINITIONS
324//=============================================================================================================
325
326inline bool MNESourceSpace::isEmpty() const
327{
328 return m_qListHemispheres.size() == 0;
329}
330
331//=============================================================================================================
332
333inline qint32 MNESourceSpace::size() const
334{
335 return m_qListHemispheres.size();
336}
337
338//=============================================================================================================
339
340inline bool operator== (const MNESourceSpace &a, const MNESourceSpace &b)
341{
342 return (a.m_qListHemispheres == b.m_qListHemispheres);
343}
344} // NAMESPACE
345
346#endif // MNE_SOURCESPACE_H
FIFF class declaration, which provides static wrapper functions to stay consistent with mne matlab to...
FiffDirNode class declaration, which provides fiff dir tree processing methods.
Definitions for describing the objects in a FIFF file.
mne library export/import macros.
#define MNESHARED_EXPORT
Definition mne_global.h:56
MNEHemisphere class declaration.
Coordinate transformation description.
QSharedPointer< FiffDirNode > SPtr
FIFF File I/O routines.
QSharedPointer< FiffStream > SPtr
Freesurfer/MNE label.
Definition label.h:81
Hemisphere provides geometry information.
Source Space descritpion.
QSharedPointer< const MNESourceSpace > ConstSPtr
QSharedPointer< MNESourceSpace > SPtr