MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
surfaceset.h
Go to the documentation of this file.
1//=============================================================================================================
37#ifndef SURFACESET_H
38#define SURFACESET_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fs_global.h"
45#include "surface.h"
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51#include <QSharedPointer>
52#include <QMap>
53
54//=============================================================================================================
55// DEFINE NAMESPACE FSLIB
56//=============================================================================================================
57
58namespace FSLIB
59{
60
61//=============================================================================================================
62// FORWARD DECLARATIONS
63//=============================================================================================================
64
65//=============================================================================================================
72{
73public:
74 typedef QSharedPointer<SurfaceSet> SPtr;
75 typedef QSharedPointer<const SurfaceSet> ConstSPtr;
77 //=========================================================================================================
81 SurfaceSet();
82
83 //=========================================================================================================
92 explicit SurfaceSet(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir);
93
94 //=========================================================================================================
102 explicit SurfaceSet(const QString &path, qint32 hemi, const QString &surf);
103
104 //=========================================================================================================
111 explicit SurfaceSet(const Surface& p_LHSurface, const Surface& p_RHSurface);
112
113 //=========================================================================================================
120 explicit SurfaceSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
121
122 //=========================================================================================================
126 ~SurfaceSet();
127
128 //=========================================================================================================
132 void clear();
133
134 //=========================================================================================================
140 inline QMap<qint32, Surface>& data();
141
142 //=========================================================================================================
148 inline bool isEmpty() const;
149
150 //=========================================================================================================
156 void insert(const Surface& p_Surface);
157
158 //=========================================================================================================
168 static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, SurfaceSet &p_SurfaceSet);
169
170 //=========================================================================================================
176 inline QString surf() const;
177
178 //=========================================================================================================
186 const Surface& operator[] (qint32 idx) const;
187
188 //=========================================================================================================
196 Surface& operator[] (qint32 idx);
197
198 //=========================================================================================================
206 const Surface& operator[] (QString idt) const;
207
208 //=========================================================================================================
216 Surface& operator[] (QString idt);
217
218 //=========================================================================================================
224 inline qint32 size() const;
225
226private:
227 //=========================================================================================================
231 void calcOffset();
232
233 QMap<qint32, Surface> m_qMapSurfs;
234};
235
236//=============================================================================================================
237// INLINE DEFINITIONS
238//=============================================================================================================
239
240inline QMap<qint32, Surface>& SurfaceSet::data()
241{
242 return m_qMapSurfs;
243}
244
245//=============================================================================================================
246
247inline bool SurfaceSet::isEmpty() const
248{
249 return m_qMapSurfs.isEmpty();
250}
251
252//=============================================================================================================
253
254inline QString SurfaceSet::surf() const
255{
256 if(m_qMapSurfs.size() > 0)
257 return m_qMapSurfs.begin().value().surf();
258 else
259 return QString("");
260}
261
262//=============================================================================================================
263
264inline qint32 SurfaceSet::size() const
265{
266 return m_qMapSurfs.size();
267}
268} // NAMESPACE
269
270#endif // SURFACESET_H
271
Fs library export/import macros.
#define FSSHARED_EXPORT
Definition fs_global.h:56
Surface class declaration.
FreeSurfer surface mesh.
Definition surface.h:76
A hemisphere set of surfaces.
Definition surfaceset.h:72
QMap< qint32, Surface > & data()
Definition surfaceset.h:240
QSharedPointer< SurfaceSet > SPtr
Definition surfaceset.h:74
qint32 size() const
Definition surfaceset.h:264
QString surf() const
Definition surfaceset.h:254
bool isEmpty() const
Definition surfaceset.h:247
QSharedPointer< const SurfaceSet > ConstSPtr
Definition surfaceset.h:75