v2.0.0
Loading...
Searching...
No Matches
fs_surfaceset.h
Go to the documentation of this file.
1//=============================================================================================================
26
27#ifndef FS_SURFACESET_H
28#define FS_SURFACESET_H
29
30//=============================================================================================================
31// INCLUDES
32//=============================================================================================================
33
34#include "fs_global.h"
35#include "fs_surface.h"
36
37//=============================================================================================================
38// QT INCLUDES
39//=============================================================================================================
40
41#include <QSharedPointer>
42#include <QMap>
43
44//=============================================================================================================
45// DEFINE NAMESPACE FSLIB
46//=============================================================================================================
47
48namespace FSLIB
49{
50
51//=============================================================================================================
52// FORWARD DECLARATIONS
53//=============================================================================================================
54
55//=============================================================================================================
68{
69public:
70 typedef QSharedPointer<FsSurfaceSet> SPtr;
71 typedef QSharedPointer<const FsSurfaceSet> ConstSPtr;
72
73 //=========================================================================================================
78
79 //=========================================================================================================
88 explicit FsSurfaceSet(const QString& subject_id, qint32 hemi, const QString& surf, const QString& subjects_dir);
89
90 //=========================================================================================================
98 explicit FsSurfaceSet(const QString& path, qint32 hemi, const QString& surf);
99
100 //=========================================================================================================
107 explicit FsSurfaceSet(const FsSurface& p_LHSurface, const FsSurface& p_RHSurface);
108
109 //=========================================================================================================
116 explicit FsSurfaceSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
117
118 //=========================================================================================================
123
124 //=========================================================================================================
128 void clear();
129
130 //=========================================================================================================
136 inline QMap<qint32, FsSurface>& data();
137
138 //=========================================================================================================
144 inline bool isEmpty() const;
145
146 //=========================================================================================================
152 void insert(const FsSurface& p_Surface);
153
154 //=========================================================================================================
164 static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, FsSurfaceSet& p_SurfaceSet);
165
166 //=========================================================================================================
172 inline QString surf() const;
173
174 //=========================================================================================================
182 const FsSurface& operator[](qint32 idx) const;
183
184 //=========================================================================================================
192 FsSurface& operator[](qint32 idx);
193
194 //=========================================================================================================
202 const FsSurface& operator[](QString idt) const;
203
204 //=========================================================================================================
212 FsSurface& operator[](QString idt);
213
214 //=========================================================================================================
220 inline qint32 size() const;
221
222private:
223 //=========================================================================================================
227 void calcOffset();
228
229 QMap<qint32, FsSurface> m_qMapSurfs;
230};
231
232//=============================================================================================================
233// INLINE DEFINITIONS
234//=============================================================================================================
235
236inline QMap<qint32, FsSurface>& FsSurfaceSet::data()
237{
238 return m_qMapSurfs;
239}
240
241//=============================================================================================================
242
243inline bool FsSurfaceSet::isEmpty() const
244{
245 return m_qMapSurfs.isEmpty();
246}
247
248//=============================================================================================================
249
250inline QString FsSurfaceSet::surf() const
251{
252 if (m_qMapSurfs.size() > 0)
253 return m_qMapSurfs.begin().value().surf();
254 else
255 return QString("");
256}
257
258//=============================================================================================================
259
260inline qint32 FsSurfaceSet::size() const
261{
262 return m_qMapSurfs.size();
263}
264} // NAMESPACE
265
266#endif // FS_SURFACESET_H
Reader and in-memory representation of a single FreeSurfer triangular surface (e.g....
Export/import macros and build-info accessors for the FSLIB FreeSurfer I/O library.
#define FSSHARED_EXPORT
Definition fs_global.h:38
FreeSurfer surface, annotation and parcellation I/O for mne-cpp.
In-memory FreeSurfer triangular cortical surface for one hemisphere.
Definition fs_surface.h:94
const FsSurface & operator[](qint32 idx) const
QString surf() const
QSharedPointer< FsSurfaceSet > SPtr
qint32 size() const
QSharedPointer< const FsSurfaceSet > ConstSPtr
static bool read(const QString &p_sLHFileName, const QString &p_sRHFileName, FsSurfaceSet &p_SurfaceSet)
void insert(const FsSurface &p_Surface)
QMap< qint32, FsSurface > & data()