v2.0.0
Loading...
Searching...
No Matches
network.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef NETWORK_H
36#define NETWORK_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
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
78 QString sMethod = "Map";
79 QString sColormap = "Viridis";
80 Eigen::Vector4i colNodes = Eigen::Vector4i(255, 0, 0, 255);
81 Eigen::Vector4i colEdges = Eigen::Vector4i(255, 0, 0, 255);
82};
83
84//=============================================================================================================
90
92{
93
94public:
95 typedef QSharedPointer<Network> SPtr;
96 typedef QSharedPointer<const Network> ConstSPtr;
97
98 //=========================================================================================================
105 explicit Network(const QString& sConnectivityMethod = "Unknown",
106 double dThreshold = 0.0);
107
108 //=========================================================================================================
118 Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion = true) const;
119
120 //=========================================================================================================
130 Eigen::MatrixXd getThresholdedConnectivityMatrix(bool bGetMirroredVersion = true) const;
131
132 //=========================================================================================================
138 const QList<QSharedPointer<NetworkEdge> >& getFullEdges() const;
139
140 //=========================================================================================================
146 const QList<QSharedPointer<NetworkEdge> >& getThresholdedEdges() const;
147
148 //=========================================================================================================
154 const QList<QSharedPointer<NetworkNode> >& getNodes() const;
155
156 //=========================================================================================================
164 QSharedPointer<NetworkEdge> getEdgeAt(int i);
165
166 //=========================================================================================================
174 QSharedPointer<NetworkNode> getNodeAt(int i);
175
176 //=========================================================================================================
182 qint16 getFullDistribution() const;
183
184 //=========================================================================================================
190 qint16 getThresholdedDistribution() const;
191
192 //=========================================================================================================
198 void setConnectivityMethod(const QString& sConnectivityMethod);
199
200 //=========================================================================================================
206 QString getConnectivityMethod() const;
207
208 //=========================================================================================================
214 QPair<double, double> getMinMaxFullWeights() const;
215
216 //=========================================================================================================
222 QPair<double, double> getMinMaxThresholdedWeights() const;
223
224 //=========================================================================================================
230 QPair<int,int> getMinMaxFullDegrees() const;
231
232 //=========================================================================================================
238 QPair<int,int> getMinMaxThresholdedDegrees() const;
239
240 //=========================================================================================================
246 QPair<int,int> getMinMaxFullIndegrees() const;
247
248 //=========================================================================================================
254 QPair<int,int> getMinMaxThresholdedIndegrees() const;
255
256 //=========================================================================================================
262 QPair<int,int> getMinMaxFullOutdegrees() const;
263
264 //=========================================================================================================
270 QPair<int,int> getMinMaxThresholdedOutdegrees() const;
271
272 //=========================================================================================================
278 void setThreshold(double dThreshold = 0.0);
279
280 //=========================================================================================================
286 double getThreshold();
287
288 //=========================================================================================================
295 void setFrequencyRange(float fLowerFreq, float fUpperFreq);
296
297 //=========================================================================================================
303 const QPair<float,float>& getFrequencyRange() const;
304
305 //=========================================================================================================
311 void append(QSharedPointer<NetworkEdge> newEdge);
312
313 //=========================================================================================================
319 void append(QSharedPointer<NetworkNode> newNode);
320
321 //=========================================================================================================
327 bool isEmpty() const;
328
329 //=========================================================================================================
333 void normalize();
334
335 //=========================================================================================================
342
343 //=========================================================================================================
349 void setVisualizationInfo(const VisualizationInfo& visualizationInfo);
350
351 //=========================================================================================================
357 float getSamplingFrequency() const;
358
359 //=========================================================================================================
365 void setSamplingFrequency(float fSFreq);
366
367 //=========================================================================================================
373 int getUsedFreqBins() const;
374
375 //=========================================================================================================
381 void setUsedFreqBins(int iNumberFreqBins);
382
383 //=========================================================================================================
389 void setFFTSize(int iFFTSize);
390
391 //=========================================================================================================
397 int getFFTSize();
398
399protected:
400 QList<QSharedPointer<NetworkEdge> > m_lFullEdges;
401 QList<QSharedPointer<NetworkEdge> > m_lThresholdedEdges;
402
403 QList<QSharedPointer<NetworkNode> > m_lNodes;
404
405 Eigen::MatrixXd m_matDistMatrix;
406
408
409 QPair<double,double> m_minMaxFullWeights;
410 QPair<double,double> m_minMaxThresholdedWeights;
411 QPair<float,float> m_minMaxFrequency;
412
414 float m_fSFreq;
417
419};
420
421//=============================================================================================================
422// INLINE DEFINITIONS
423//=============================================================================================================
424} // namespace CONNECTIVITYLIB
425
426#ifndef metatype_networks
427#define metatype_networks
429#endif
430
431#ifndef metatype_networkslist
432#define metatype_networkslist
433Q_DECLARE_METATYPE(QList<CONNECTIVITYLIB::Network>);
434#endif
435
436#ifndef metatype_networkssptr
437#define metatype_networkssptr
439#endif
440
441#ifndef metatype_networkssptrlist
442#define metatype_networkssptrlist
443Q_DECLARE_METATYPE(QList<CONNECTIVITYLIB::Network::SPtr>);
444#endif
445
446#endif // NETWORK_H
connectivity library export/import macros.
#define CONNECTIVITYSHARED_EXPORT
Q_DECLARE_METATYPE(CONNECTIVITYLIB::Network)
Functional connectivity metrics (coherence, PLV, cross-correlation, etc.).
Holds threshold and color settings for network edge visualization.
Definition network.h:77
This class holds information about a network, can compute a distance table and provide network metric...
Definition network.h:92
VisualizationInfo getVisualizationInfo() const
Definition network.cpp:471
void setVisualizationInfo(const VisualizationInfo &visualizationInfo)
Definition network.cpp:478
int getUsedFreqBins() const
Definition network.cpp:499
qint16 getThresholdedDistribution() const
Definition network.cpp:183
void setUsedFreqBins(int iNumberFreqBins)
Definition network.cpp:506
void setConnectivityMethod(const QString &sConnectivityMethod)
Definition network.cpp:196
void append(QSharedPointer< NetworkEdge > newEdge)
QPair< double, double > m_minMaxFullWeights
Definition network.h:409
QPair< int, int > getMinMaxFullDegrees() const
Definition network.cpp:224
Eigen::MatrixXd getThresholdedConnectivityMatrix(bool bGetMirroredVersion=true) const
Definition network.cpp:118
QPair< double, double > getMinMaxThresholdedWeights() const
Definition network.cpp:217
void setFFTSize(int iFFTSize)
Definition network.cpp:513
QPair< double, double > getMinMaxFullWeights() const
Definition network.cpp:210
QSharedPointer< const Network > ConstSPtr
Definition network.h:96
QList< QSharedPointer< NetworkNode > > m_lNodes
Definition network.h:403
QPair< int, int > getMinMaxFullIndegrees() const
Definition network.cpp:260
Network(const QString &sConnectivityMethod="Unknown", double dThreshold=0.0)
Definition network.cpp:76
void setSamplingFrequency(float fSFreq)
Definition network.cpp:492
const QPair< float, float > & getFrequencyRange() const
Definition network.cpp:405
void setThreshold(double dThreshold=0.0)
Definition network.cpp:332
QSharedPointer< NetworkEdge > getEdgeAt(int i)
QSharedPointer< Network > SPtr
Definition network.h:95
QString getConnectivityMethod() const
Definition network.cpp:203
Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion=true) const
Definition network.cpp:94
VisualizationInfo m_visualizationInfo
Definition network.h:418
QPair< int, int > getMinMaxThresholdedDegrees() const
Definition network.cpp:242
QSharedPointer< NetworkNode > getNodeAt(int i)
Definition network.cpp:163
QPair< double, double > m_minMaxThresholdedWeights
Definition network.h:410
const QList< QSharedPointer< NetworkNode > > & getNodes() const
Definition network.cpp:156
QPair< int, int > getMinMaxThresholdedIndegrees() const
Definition network.cpp:278
float getSamplingFrequency() const
Definition network.cpp:485
void setFrequencyRange(float fLowerFreq, float fUpperFreq)
Definition network.cpp:359
QPair< int, int > getMinMaxFullOutdegrees() const
Definition network.cpp:296
void append(QSharedPointer< NetworkNode > newNode)
const QList< QSharedPointer< NetworkEdge > > & getThresholdedEdges() const
Definition network.cpp:149
QPair< float, float > m_minMaxFrequency
Definition network.h:411
QList< QSharedPointer< NetworkEdge > > m_lThresholdedEdges
Definition network.h:401
const QList< QSharedPointer< NetworkEdge > > & getFullEdges() const
Definition network.cpp:142
QPair< int, int > getMinMaxThresholdedOutdegrees() const
Definition network.cpp:314
Eigen::MatrixXd m_matDistMatrix
Definition network.h:405
QList< QSharedPointer< NetworkEdge > > m_lFullEdges
Definition network.h:400
qint16 getFullDistribution() const
Definition network.cpp:170
QString m_sConnectivityMethod
Definition network.h:407
This class holds an object to describe the edge of a network.
Definition networkedge.h:80
This class holds an object to describe the node of a network.
Definition networknode.h:82