v2.0.0
Loading...
Searching...
No Matches
fs_surfaceset.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef FS_SURFACESET_H
38#define FS_SURFACESET_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fs_global.h"
45#include "fs_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<FsSurfaceSet> SPtr;
75 typedef QSharedPointer<const FsSurfaceSet> ConstSPtr;
76
77 //=========================================================================================================
82
83 //=========================================================================================================
92 explicit FsSurfaceSet(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir);
93
94 //=========================================================================================================
102 explicit FsSurfaceSet(const QString &path, qint32 hemi, const QString &surf);
103
104 //=========================================================================================================
111 explicit FsSurfaceSet(const FsSurface& p_LHSurface, const FsSurface& p_RHSurface);
112
113 //=========================================================================================================
120 explicit FsSurfaceSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
121
122 //=========================================================================================================
127
128 //=========================================================================================================
132 void clear();
133
134 //=========================================================================================================
140 inline QMap<qint32, FsSurface>& data();
141
142 //=========================================================================================================
148 inline bool isEmpty() const;
149
150 //=========================================================================================================
156 void insert(const FsSurface& p_Surface);
157
158 //=========================================================================================================
168 static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, FsSurfaceSet &p_SurfaceSet);
169
170 //=========================================================================================================
176 inline QString surf() const;
177
178 //=========================================================================================================
186 const FsSurface& operator[] (qint32 idx) const;
187
188 //=========================================================================================================
196 FsSurface& operator[] (qint32 idx);
197
198 //=========================================================================================================
206 const FsSurface& operator[] (QString idt) const;
207
208 //=========================================================================================================
216 FsSurface& operator[] (QString idt);
217
218 //=========================================================================================================
224 inline qint32 size() const;
225
226private:
227 //=========================================================================================================
231 void calcOffset();
232
233 QMap<qint32, FsSurface> m_qMapSurfs;
234};
235
236//=============================================================================================================
237// INLINE DEFINITIONS
238//=============================================================================================================
239
240inline QMap<qint32, FsSurface>& FsSurfaceSet::data()
241{
242 return m_qMapSurfs;
243}
244
245//=============================================================================================================
246
247inline bool FsSurfaceSet::isEmpty() const
248{
249 return m_qMapSurfs.isEmpty();
250}
251
252//=============================================================================================================
253
254inline QString FsSurfaceSet::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 FsSurfaceSet::size() const
265{
266 return m_qMapSurfs.size();
267}
268} // NAMESPACE
269
270#endif // FS_SURFACESET_H
271
Fs library export/import macros.
#define FSSHARED_EXPORT
Definition fs_global.h:52
FsSurface class declaration.
FreeSurfer surface and annotation I/O.
FreeSurfer surface mesh.
Definition fs_surface.h:83
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()