MNE-CPP  beta 1.0
surfaceset.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef SURFACESET_H
37 #define SURFACESET_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "fs_global.h"
45 #include "surface.h"
46 
47 
48 //*************************************************************************************************************
49 //=============================================================================================================
50 // QT INCLUDES
51 //=============================================================================================================
52 
53 #include <QSharedPointer>
54 #include <QMap>
55 
56 
57 //*************************************************************************************************************
58 //=============================================================================================================
59 // DEFINE NAMESPACE FSLIB
60 //=============================================================================================================
61 
62 namespace FSLIB
63 {
64 
65 //*************************************************************************************************************
66 //=============================================================================================================
67 // USED NAMESPACES
68 //=============================================================================================================
69 
70 
71 //*************************************************************************************************************
72 //=============================================================================================================
73 // FORWARD DECLARATIONS
74 //=============================================================================================================
75 
76 
77 //=============================================================================================================
84 {
85 public:
86  typedef QSharedPointer<SurfaceSet> SPtr;
87  typedef QSharedPointer<const SurfaceSet> ConstSPtr;
89  //=========================================================================================================
93  SurfaceSet();
94 
95  //=========================================================================================================
104  explicit SurfaceSet(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir);
105 
106  //=========================================================================================================
114  explicit SurfaceSet(const QString &path, qint32 hemi, const QString &surf);
115 
116  //=========================================================================================================
123  explicit SurfaceSet(const Surface& p_LHSurface, const Surface& p_RHSurface);
124 
125  //=========================================================================================================
132  explicit SurfaceSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
133 
134  //=========================================================================================================
138  ~SurfaceSet();
139 
140  //=========================================================================================================
144  void clear();
145 
146  //=========================================================================================================
152  inline QMap<qint32, Surface>& data();
153 
154  //=========================================================================================================
160  inline bool isEmpty() const;
161 
162  //=========================================================================================================
168  void insert(const Surface& p_Surface);
169 
170  //=========================================================================================================
180  static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, SurfaceSet &p_SurfaceSet);
181 
182  //=========================================================================================================
188  inline QString surf() const;
189 
190  //=========================================================================================================
198  const Surface& operator[] (qint32 idx) const;
199 
200  //=========================================================================================================
208  Surface& operator[] (qint32 idx);
209 
210  //=========================================================================================================
218  const Surface& operator[] (QString idt) const;
219 
220  //=========================================================================================================
228  Surface& operator[] (QString idt);
229 
230  //=========================================================================================================
236  inline qint32 size() const;
237 
238 private:
239  //=========================================================================================================
243  void calcOffset();
244 
245  QMap<qint32, Surface> m_qMapSurfs;
246 };
247 
248 //*************************************************************************************************************
249 //=============================================================================================================
250 // INLINE DEFINITIONS
251 //=============================================================================================================
252 
253 inline QMap<qint32, Surface>& SurfaceSet::data()
254 {
255  return m_qMapSurfs;
256 }
257 
258 
259 //*************************************************************************************************************
260 
261 inline bool SurfaceSet::isEmpty() const
262 {
263  return m_qMapSurfs.isEmpty();
264 }
265 
266 
267 //*************************************************************************************************************
268 
269 inline QString SurfaceSet::surf() const
270 {
271  if(m_qMapSurfs.size() > 0)
272  return m_qMapSurfs.begin().value().surf();
273  else
274  return QString("");
275 }
276 
277 
278 //*************************************************************************************************************
279 
280 inline qint32 SurfaceSet::size() const
281 {
282  return m_qMapSurfs.size();
283 }
284 
285 } // NAMESPACE
286 
287 #endif // SURFACESET_H
288 
QString surf() const
Definition: surfaceset.h:269
Fs library export/import macros.
qint32 size() const
Definition: surfaceset.h:280
QSharedPointer< const SurfaceSet > ConstSPtr
Definition: surfaceset.h:87
bool isEmpty() const
Definition: surfaceset.h:261
QSharedPointer< SurfaceSet > SPtr
Definition: surfaceset.h:86
QMap< qint32, Surface > & data()
Definition: surfaceset.h:253
FreeSurfer surface mesh.
Definition: surface.h:92
#define FSSHARED_EXPORT
Definition: fs_global.h:58
Surface class declaration.
A hemisphere set of surfaces.
Definition: surfaceset.h:83