v2.0.0
Loading...
Searching...
No Matches
network.h
Go to the documentation of this file.
1//=============================================================================================================
33
34#ifndef NETWORK_H
35#define NETWORK_H
36
37//=============================================================================================================
38// INCLUDES
39//=============================================================================================================
40
42
43//=============================================================================================================
44// QT INCLUDES
45//=============================================================================================================
46
47#include <QSharedPointer>
48#include <QList>
49
50//=============================================================================================================
51// EIGEN INCLUDES
52//=============================================================================================================
53
54#include <Eigen/Core>
55
56//=============================================================================================================
57// FORWARD DECLARATIONS
58//=============================================================================================================
59
60//=============================================================================================================
61// DEFINE NAMESPACE CONNECTIVITYLIB
62//=============================================================================================================
63
64namespace CONNECTIVITYLIB {
65
66//=============================================================================================================
67// CONNECTIVITYLIB FORWARD DECLARATIONS
68//=============================================================================================================
69
70class NetworkEdge;
71class NetworkNode;
72
77 QString sMethod = "Map";
78 QString sColormap = "Viridis";
79 Eigen::Vector4i colNodes = Eigen::Vector4i(255, 0, 0, 255);
80 Eigen::Vector4i colEdges = Eigen::Vector4i(255, 0, 0, 255);
81};
82
83//=============================================================================================================
96
98{
99
100public:
101 typedef QSharedPointer<Network> SPtr;
102 typedef QSharedPointer<const Network> ConstSPtr;
103
104 //=========================================================================================================
111 explicit Network(const QString& sConnectivityMethod = "Unknown",
112 double dThreshold = 0.0);
113
114 //=========================================================================================================
124 Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion = true) const;
125
126 //=========================================================================================================
136 Eigen::MatrixXd getThresholdedConnectivityMatrix(bool bGetMirroredVersion = true) const;
137
138 //=========================================================================================================
144 const QList<QSharedPointer<NetworkEdge> >& getFullEdges() const;
145
146 //=========================================================================================================
152 const QList<QSharedPointer<NetworkEdge> >& getThresholdedEdges() const;
153
154 //=========================================================================================================
160 const QList<QSharedPointer<NetworkNode> >& getNodes() const;
161
162 //=========================================================================================================
170 QSharedPointer<NetworkEdge> getEdgeAt(int i);
171
172 //=========================================================================================================
180 QSharedPointer<NetworkNode> getNodeAt(int i);
181
182 //=========================================================================================================
188 qint16 getFullDistribution() const;
189
190 //=========================================================================================================
196 qint16 getThresholdedDistribution() const;
197
198 //=========================================================================================================
204 void setConnectivityMethod(const QString& sConnectivityMethod);
205
206 //=========================================================================================================
212 QString getConnectivityMethod() const;
213
214 //=========================================================================================================
220 QPair<double, double> getMinMaxFullWeights() const;
221
222 //=========================================================================================================
228 QPair<double, double> getMinMaxThresholdedWeights() const;
229
230 //=========================================================================================================
236 QPair<int,int> getMinMaxFullDegrees() const;
237
238 //=========================================================================================================
244 QPair<int,int> getMinMaxThresholdedDegrees() const;
245
246 //=========================================================================================================
252 QPair<int,int> getMinMaxFullIndegrees() const;
253
254 //=========================================================================================================
260 QPair<int,int> getMinMaxThresholdedIndegrees() const;
261
262 //=========================================================================================================
268 QPair<int,int> getMinMaxFullOutdegrees() const;
269
270 //=========================================================================================================
276 QPair<int,int> getMinMaxThresholdedOutdegrees() const;
277
278 //=========================================================================================================
284 void setThreshold(double dThreshold = 0.0);
285
286 //=========================================================================================================
292 double getThreshold();
293
294 //=========================================================================================================
301 void setFrequencyRange(float fLowerFreq, float fUpperFreq);
302
303 //=========================================================================================================
309 const QPair<float,float>& getFrequencyRange() const;
310
311 //=========================================================================================================
317 void append(QSharedPointer<NetworkEdge> newEdge);
318
319 //=========================================================================================================
325 void append(QSharedPointer<NetworkNode> newNode);
326
327 //=========================================================================================================
333 bool isEmpty() const;
334
335 //=========================================================================================================
339 void normalize();
340
341 //=========================================================================================================
348
349 //=========================================================================================================
355 void setVisualizationInfo(const VisualizationInfo& visualizationInfo);
356
357 //=========================================================================================================
363 float getSamplingFrequency() const;
364
365 //=========================================================================================================
371 void setSamplingFrequency(float fSFreq);
372
373 //=========================================================================================================
379 int getUsedFreqBins() const;
380
381 //=========================================================================================================
387 void setUsedFreqBins(int iNumberFreqBins);
388
389 //=========================================================================================================
395 void setFFTSize(int iFFTSize);
396
397 //=========================================================================================================
403 int getFFTSize();
404
405protected:
406 QList<QSharedPointer<NetworkEdge> > m_lFullEdges;
407 QList<QSharedPointer<NetworkEdge> > m_lThresholdedEdges;
408
409 QList<QSharedPointer<NetworkNode> > m_lNodes;
410
411 Eigen::MatrixXd m_matDistMatrix;
412
414
415 QPair<double,double> m_minMaxFullWeights;
416 QPair<double,double> m_minMaxThresholdedWeights;
417 QPair<float,float> m_minMaxFrequency;
418
420 float m_fSFreq;
423
425};
426
427//=============================================================================================================
428// INLINE DEFINITIONS
429//=============================================================================================================
430} // namespace CONNECTIVITYLIB
431
432#ifndef metatype_networks
433#define metatype_networks
435#endif
436
437#ifndef metatype_networkslist
438#define metatype_networkslist
439Q_DECLARE_METATYPE(QList<CONNECTIVITYLIB::Network>);
440#endif
441
442#ifndef metatype_networkssptr
443#define metatype_networkssptr
445#endif
446
447#ifndef metatype_networkssptrlist
448#define metatype_networkssptrlist
449Q_DECLARE_METATYPE(QList<CONNECTIVITYLIB::Network::SPtr>);
450#endif
451
452#endif // NETWORK_H
Export/import macros for the CONNECTIVITYLIB functional-connectivity library.
#define CONNECTIVITYSHARED_EXPORT
Q_DECLARE_METATYPE(CONNECTIVITYLIB::Network)
Functional connectivity metrics (coherence, PLV, cross-correlation, etc.).
Per-network rendering hints: colour-map name or fixed RGBA for nodes and edges.
Definition network.h:76
Graph container for one connectivity metric; nodes + weighted edges + threshold/visualisation state.
Definition network.h:98
VisualizationInfo getVisualizationInfo() const
Definition network.cpp:458
void setVisualizationInfo(const VisualizationInfo &visualizationInfo)
Definition network.cpp:465
int getUsedFreqBins() const
Definition network.cpp:486
qint16 getThresholdedDistribution() const
Definition network.cpp:170
void setUsedFreqBins(int iNumberFreqBins)
Definition network.cpp:493
void setConnectivityMethod(const QString &sConnectivityMethod)
Definition network.cpp:183
QSharedPointer< NetworkEdge > getEdgeAt(int i)
Definition network.cpp:150
void append(QSharedPointer< NetworkEdge > newEdge)
QPair< double, double > m_minMaxFullWeights
Definition network.h:415
QPair< int, int > getMinMaxFullDegrees() const
Definition network.cpp:211
Eigen::MatrixXd getThresholdedConnectivityMatrix(bool bGetMirroredVersion=true) const
Definition network.cpp:98
QPair< double, double > getMinMaxThresholdedWeights() const
Definition network.cpp:204
void setFFTSize(int iFFTSize)
Definition network.cpp:500
QPair< double, double > getMinMaxFullWeights() const
Definition network.cpp:197
QSharedPointer< const Network > ConstSPtr
Definition network.h:102
QList< QSharedPointer< NetworkNode > > m_lNodes
Definition network.h:409
QPair< int, int > getMinMaxFullIndegrees() const
Definition network.cpp:247
Network(const QString &sConnectivityMethod="Unknown", double dThreshold=0.0)
Definition network.cpp:56
void setSamplingFrequency(float fSFreq)
Definition network.cpp:479
const QPair< float, float > & getFrequencyRange() const
Definition network.cpp:392
void setThreshold(double dThreshold=0.0)
Definition network.cpp:319
QSharedPointer< Network > SPtr
Definition network.h:101
QString getConnectivityMethod() const
Definition network.cpp:190
Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion=true) const
Definition network.cpp:74
VisualizationInfo m_visualizationInfo
Definition network.h:424
QPair< int, int > getMinMaxThresholdedDegrees() const
Definition network.cpp:229
QSharedPointer< NetworkNode > getNodeAt(int i)
Definition network.cpp:143
QPair< double, double > m_minMaxThresholdedWeights
Definition network.h:416
const QList< QSharedPointer< NetworkNode > > & getNodes() const
Definition network.cpp:136
QPair< int, int > getMinMaxThresholdedIndegrees() const
Definition network.cpp:265
float getSamplingFrequency() const
Definition network.cpp:472
void setFrequencyRange(float fLowerFreq, float fUpperFreq)
Definition network.cpp:346
QPair< int, int > getMinMaxFullOutdegrees() const
Definition network.cpp:283
void append(QSharedPointer< NetworkNode > newNode)
const QList< QSharedPointer< NetworkEdge > > & getThresholdedEdges() const
Definition network.cpp:129
QPair< float, float > m_minMaxFrequency
Definition network.h:417
QList< QSharedPointer< NetworkEdge > > m_lThresholdedEdges
Definition network.h:407
const QList< QSharedPointer< NetworkEdge > > & getFullEdges() const
Definition network.cpp:122
QPair< int, int > getMinMaxThresholdedOutdegrees() const
Definition network.cpp:301
Eigen::MatrixXd m_matDistMatrix
Definition network.h:411
QList< QSharedPointer< NetworkEdge > > m_lFullEdges
Definition network.h:406
qint16 getFullDistribution() const
Definition network.cpp:157
QString m_sConnectivityMethod
Definition network.h:413
Weighted, directional edge in a Network; carries per-frequency weights plus a band-averaged scalar.
Definition networkedge.h:82
Graph node carrying a 3D position and its incident in/out, full/thresholded edge lists.
Definition networknode.h:80