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//=============================================================================================================
66{
67public:
68 typedef QSharedPointer<FsSurfaceSet> SPtr;
69 typedef QSharedPointer<const FsSurfaceSet> ConstSPtr;
70
71 //=========================================================================================================
76
77 //=========================================================================================================
86 explicit FsSurfaceSet(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir);
87
88 //=========================================================================================================
96 explicit FsSurfaceSet(const QString &path, qint32 hemi, const QString &surf);
97
98 //=========================================================================================================
105 explicit FsSurfaceSet(const FsSurface& p_LHSurface, const FsSurface& p_RHSurface);
106
107 //=========================================================================================================
114 explicit FsSurfaceSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
115
116 //=========================================================================================================
121
122 //=========================================================================================================
126 void clear();
127
128 //=========================================================================================================
134 inline QMap<qint32, FsSurface>& data();
135
136 //=========================================================================================================
142 inline bool isEmpty() const;
143
144 //=========================================================================================================
150 void insert(const FsSurface& p_Surface);
151
152 //=========================================================================================================
162 static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, FsSurfaceSet &p_SurfaceSet);
163
164 //=========================================================================================================
170 inline QString surf() const;
171
172 //=========================================================================================================
180 const FsSurface& operator[] (qint32 idx) const;
181
182 //=========================================================================================================
190 FsSurface& operator[] (qint32 idx);
191
192 //=========================================================================================================
200 const FsSurface& operator[] (QString idt) const;
201
202 //=========================================================================================================
210 FsSurface& operator[] (QString idt);
211
212 //=========================================================================================================
218 inline qint32 size() const;
219
220private:
221 //=========================================================================================================
225 void calcOffset();
226
227 QMap<qint32, FsSurface> m_qMapSurfs;
228};
229
230//=============================================================================================================
231// INLINE DEFINITIONS
232//=============================================================================================================
233
234inline QMap<qint32, FsSurface>& FsSurfaceSet::data()
235{
236 return m_qMapSurfs;
237}
238
239//=============================================================================================================
240
241inline bool FsSurfaceSet::isEmpty() const
242{
243 return m_qMapSurfs.isEmpty();
244}
245
246//=============================================================================================================
247
248inline QString FsSurfaceSet::surf() const
249{
250 if(m_qMapSurfs.size() > 0)
251 return m_qMapSurfs.begin().value().surf();
252 else
253 return QString("");
254}
255
256//=============================================================================================================
257
258inline qint32 FsSurfaceSet::size() const
259{
260 return m_qMapSurfs.size();
261}
262} // NAMESPACE
263
264#endif // FS_SURFACESET_H
265
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:92
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()