MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
network.h
Go to the documentation of this file.
1//=============================================================================================================
35#ifndef NETWORK_H
36#define NETWORK_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "../connectivity_global.h"
43
44//=============================================================================================================
45// QT INCLUDES
46//=============================================================================================================
47
48#include <QSharedPointer>
49#include <QList>
50
51//=============================================================================================================
52// EIGEN INCLUDES
53//=============================================================================================================
54
55#include <Eigen/Core>
56
57//=============================================================================================================
58// FORWARD DECLARATIONS
59//=============================================================================================================
60
61//=============================================================================================================
62// DEFINE NAMESPACE CONNECTIVITYLIB
63//=============================================================================================================
64
65namespace CONNECTIVITYLIB {
66
67//=============================================================================================================
68// CONNECTIVITYLIB FORWARD DECLARATIONS
69//=============================================================================================================
70
71class NetworkEdge;
72class NetworkNode;
73
75 QString sMethod = "Map";
76 QString sColormap = "Viridis";
77 Eigen::Vector4i colNodes = Eigen::Vector4i(255, 0, 0, 255);
78 Eigen::Vector4i colEdges = Eigen::Vector4i(255, 0, 0, 255);
79};
80
81//=============================================================================================================
89{
90
91public:
92 typedef QSharedPointer<Network> SPtr;
93 typedef QSharedPointer<const Network> ConstSPtr;
95 //=========================================================================================================
102 explicit Network(const QString& sConnectivityMethod = "Unknown",
103 double dThreshold = 0.0);
104
105 //=========================================================================================================
115 Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion = true) const;
116
117 //=========================================================================================================
127 Eigen::MatrixXd getThresholdedConnectivityMatrix(bool bGetMirroredVersion = true) const;
128
129 //=========================================================================================================
135 const QList<QSharedPointer<NetworkEdge> >& getFullEdges() const;
136
137 //=========================================================================================================
143 const QList<QSharedPointer<NetworkEdge> >& getThresholdedEdges() const;
144
145 //=========================================================================================================
151 const QList<QSharedPointer<NetworkNode> >& getNodes() const;
152
153 //=========================================================================================================
161 QSharedPointer<NetworkEdge> getEdgeAt(int i);
162
163 //=========================================================================================================
171 QSharedPointer<NetworkNode> getNodeAt(int i);
172
173 //=========================================================================================================
179 qint16 getFullDistribution() const;
180
181 //=========================================================================================================
187 qint16 getThresholdedDistribution() const;
188
189 //=========================================================================================================
195 void setConnectivityMethod(const QString& sConnectivityMethod);
196
197 //=========================================================================================================
203 QString getConnectivityMethod() const;
204
205 //=========================================================================================================
211 QPair<double, double> getMinMaxFullWeights() const;
212
213 //=========================================================================================================
219 QPair<double, double> getMinMaxThresholdedWeights() const;
220
221 //=========================================================================================================
227 QPair<int,int> getMinMaxFullDegrees() const;
228
229 //=========================================================================================================
235 QPair<int,int> getMinMaxThresholdedDegrees() const;
236
237 //=========================================================================================================
243 QPair<int,int> getMinMaxFullIndegrees() const;
244
245 //=========================================================================================================
251 QPair<int,int> getMinMaxThresholdedIndegrees() const;
252
253 //=========================================================================================================
259 QPair<int,int> getMinMaxFullOutdegrees() const;
260
261 //=========================================================================================================
267 QPair<int,int> getMinMaxThresholdedOutdegrees() const;
268
269 //=========================================================================================================
275 void setThreshold(double dThreshold = 0.0);
276
277 //=========================================================================================================
283 double getThreshold();
284
285 //=========================================================================================================
292 void setFrequencyRange(float fLowerFreq, float fUpperFreq);
293
294 //=========================================================================================================
300 const QPair<float,float>& getFrequencyRange() const;
301
302 //=========================================================================================================
308 void append(QSharedPointer<NetworkEdge> newEdge);
309
310 //=========================================================================================================
316 void append(QSharedPointer<NetworkNode> newNode);
317
318 //=========================================================================================================
324 bool isEmpty() const;
325
326 //=========================================================================================================
330 void normalize();
331
332 //=========================================================================================================
338 VisualizationInfo getVisualizationInfo() const;
339
340 //=========================================================================================================
346 void setVisualizationInfo(const VisualizationInfo& visualizationInfo);
347
348 //=========================================================================================================
354 float getSamplingFrequency() const;
355
356 //=========================================================================================================
362 void setSamplingFrequency(float fSFreq);
363
364 //=========================================================================================================
370 int getUsedFreqBins() const;
371
372 //=========================================================================================================
378 void setUsedFreqBins(int iNumberFreqBins);
379
380 //=========================================================================================================
386 void setFFTSize(int iFFTSize);
387
388 //=========================================================================================================
394 int getFFTSize();
395
396protected:
397 QList<QSharedPointer<NetworkEdge> > m_lFullEdges;
398 QList<QSharedPointer<NetworkEdge> > m_lThresholdedEdges;
400 QList<QSharedPointer<NetworkNode> > m_lNodes;
402 Eigen::MatrixXd m_matDistMatrix;
406 QPair<double,double> m_minMaxFullWeights;
407 QPair<double,double> m_minMaxThresholdedWeights;
408 QPair<float,float> m_minMaxFrequency;
411 float m_fSFreq;
416};
417
418//=============================================================================================================
419// INLINE DEFINITIONS
420//=============================================================================================================
421} // namespace CONNECTIVITYLIB
422
423#ifndef metatype_networks
424#define metatype_networks
426#endif
427
428#ifndef metatype_networkslist
429#define metatype_networkslist
430Q_DECLARE_METATYPE(QList<CONNECTIVITYLIB::Network>);
431#endif
432
433#ifndef metatype_networkssptr
434#define metatype_networkssptr
436#endif
437
438#ifndef metatype_networkssptrlist
439#define metatype_networkssptrlist
440Q_DECLARE_METATYPE(QList<CONNECTIVITYLIB::Network::SPtr>);
441#endif
442
443#endif // NETWORK_H
#define CONNECTIVITYSHARED_EXPORT
Q_DECLARE_METATYPE(Eigen::MatrixXf)
This class holds information about a network, can compute a distance table and provide network metric...
Definition network.h:89
void append(QSharedPointer< NetworkEdge > newEdge)
QPair< double, double > m_minMaxFullWeights
Definition network.h:406
QSharedPointer< const Network > ConstSPtr
Definition network.h:93
QList< QSharedPointer< NetworkNode > > m_lNodes
Definition network.h:400
QSharedPointer< NetworkEdge > getEdgeAt(int i)
QSharedPointer< Network > SPtr
Definition network.h:92
VisualizationInfo m_visualizationInfo
Definition network.h:415
QPair< double, double > m_minMaxThresholdedWeights
Definition network.h:407
void append(QSharedPointer< NetworkNode > newNode)
QPair< float, float > m_minMaxFrequency
Definition network.h:408
QList< QSharedPointer< NetworkEdge > > m_lThresholdedEdges
Definition network.h:398
Eigen::MatrixXd m_matDistMatrix
Definition network.h:402
QList< QSharedPointer< NetworkEdge > > m_lFullEdges
Definition network.h:397
QString m_sConnectivityMethod
Definition network.h:404