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//=============================================================================================================
68// CONNECTIVITYLIB FORWARD DECLARATIONS
69//=============================================================================================================
70
71class NetworkEdge;
72class NetworkNode;
73
80{
81 QString sMethod = "Map";
82 QString sColormap = "Viridis";
83 Eigen::Vector4i colNodes = Eigen::Vector4i(255, 0, 0, 255);
84 Eigen::Vector4i colEdges = Eigen::Vector4i(255, 0, 0, 255);
85};
86
87//=============================================================================================================
104
106{
107public:
108 typedef QSharedPointer<Network> SPtr;
109 typedef QSharedPointer<const Network> ConstSPtr;
110
111 //=========================================================================================================
118 explicit Network(const QString& sConnectivityMethod = "Unknown",
119 double dThreshold = 0.0);
120
121 //=========================================================================================================
131 Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion = true) const;
132
133 //=========================================================================================================
143 Eigen::MatrixXd getThresholdedConnectivityMatrix(bool bGetMirroredVersion = true) const;
144
145 //=========================================================================================================
151 const QList<QSharedPointer<NetworkEdge>>& getFullEdges() const;
152
153 //=========================================================================================================
159 const QList<QSharedPointer<NetworkEdge>>& getThresholdedEdges() const;
160
161 //=========================================================================================================
167 const QList<QSharedPointer<NetworkNode>>& getNodes() const;
168
169 //=========================================================================================================
177 QSharedPointer<NetworkEdge> getEdgeAt(int i);
178
179 //=========================================================================================================
187 QSharedPointer<NetworkNode> getNodeAt(int i);
188
189 //=========================================================================================================
195 qint16 getFullDistribution() const;
196
197 //=========================================================================================================
203 qint16 getThresholdedDistribution() const;
204
205 //=========================================================================================================
211 void setConnectivityMethod(const QString& sConnectivityMethod);
212
213 //=========================================================================================================
219 QString getConnectivityMethod() const;
220
221 //=========================================================================================================
227 QPair<double, double> getMinMaxFullWeights() const;
228
229 //=========================================================================================================
235 QPair<double, double> getMinMaxThresholdedWeights() const;
236
237 //=========================================================================================================
243 QPair<int, int> getMinMaxFullDegrees() const;
244
245 //=========================================================================================================
251 QPair<int, int> getMinMaxThresholdedDegrees() const;
252
253 //=========================================================================================================
259 QPair<int, int> getMinMaxFullIndegrees() const;
260
261 //=========================================================================================================
267 QPair<int, int> getMinMaxThresholdedIndegrees() const;
268
269 //=========================================================================================================
275 QPair<int, int> getMinMaxFullOutdegrees() const;
276
277 //=========================================================================================================
283 QPair<int, int> getMinMaxThresholdedOutdegrees() const;
284
285 //=========================================================================================================
291 void setThreshold(double dThreshold = 0.0);
292
293 //=========================================================================================================
299 double getThreshold();
300
301 //=========================================================================================================
308 void setFrequencyRange(float fLowerFreq, float fUpperFreq);
309
310 //=========================================================================================================
316 const QPair<float, float>& getFrequencyRange() const;
317
318 //=========================================================================================================
324 void append(QSharedPointer<NetworkEdge> newEdge);
325
326 //=========================================================================================================
332 void append(QSharedPointer<NetworkNode> newNode);
333
334 //=========================================================================================================
340 bool isEmpty() const;
341
342 //=========================================================================================================
346 void normalize();
347
348 //=========================================================================================================
355
356 //=========================================================================================================
362 void setVisualizationInfo(const VisualizationInfo& visualizationInfo);
363
364 //=========================================================================================================
370 float getSamplingFrequency() const;
371
372 //=========================================================================================================
378 void setSamplingFrequency(float fSFreq);
379
380 //=========================================================================================================
386 int getUsedFreqBins() const;
387
388 //=========================================================================================================
394 void setUsedFreqBins(int iNumberFreqBins);
395
396 //=========================================================================================================
402 void setFFTSize(int iFFTSize);
403
404 //=========================================================================================================
410 int getFFTSize();
411
412protected:
413 QList<QSharedPointer<NetworkEdge>> m_lFullEdges;
414 QList<QSharedPointer<NetworkEdge>> m_lThresholdedEdges;
415
416 QList<QSharedPointer<NetworkNode>> m_lNodes;
417
418 Eigen::MatrixXd m_matDistMatrix;
419
421
422 QPair<double, double> m_minMaxFullWeights;
423 QPair<double, double> m_minMaxThresholdedWeights;
424 QPair<float, float> m_minMaxFrequency;
425
427 float m_fSFreq;
430
432};
433
434//=============================================================================================================
435// INLINE DEFINITIONS
436//=============================================================================================================
437} // namespace CONNECTIVITYLIB
438
439#ifndef metatype_networks
440#define metatype_networks
442#endif
443
444#ifndef metatype_networkslist
445#define metatype_networkslist
446Q_DECLARE_METATYPE(QList<CONNECTIVITYLIB::Network>);
447#endif
448
449#ifndef metatype_networkssptr
450#define metatype_networkssptr
452#endif
453
454#ifndef metatype_networkssptrlist
455#define metatype_networkssptrlist
456Q_DECLARE_METATYPE(QList<CONNECTIVITYLIB::Network::SPtr>);
457#endif
458
459#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:80
Graph container for one connectivity metric; nodes + weighted edges + threshold/visualisation state.
Definition network.h:106
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< 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
QPair< double, double > m_minMaxThresholdedWeights
Definition network.h:423
void setFFTSize(int iFFTSize)
Definition network.cpp:500
QPair< double, double > getMinMaxFullWeights() const
Definition network.cpp:197
QPair< float, float > m_minMaxFrequency
Definition network.h:424
QSharedPointer< const Network > ConstSPtr
Definition network.h:109
QPair< double, double > m_minMaxFullWeights
Definition network.h:422
QList< QSharedPointer< NetworkNode > > m_lNodes
Definition network.h:416
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:108
QString getConnectivityMethod() const
Definition network.cpp:190
Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion=true) const
Definition network.cpp:74
VisualizationInfo m_visualizationInfo
Definition network.h:431
QPair< int, int > getMinMaxThresholdedDegrees() const
Definition network.cpp:229
QSharedPointer< NetworkNode > getNodeAt(int i)
Definition network.cpp:143
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
QList< QSharedPointer< NetworkEdge > > m_lThresholdedEdges
Definition network.h:414
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:418
QList< QSharedPointer< NetworkEdge > > m_lFullEdges
Definition network.h:413
qint16 getFullDistribution() const
Definition network.cpp:157
QString m_sConnectivityMethod
Definition network.h:420
Weighted, directional edge in a Network; carries per-frequency weights plus a band-averaged scalar.
Definition networkedge.h:85
Graph node carrying a 3D position and its incident in/out, full/thresholded edge lists.
Definition networknode.h:83