v2.0.0
Loading...
Searching...
No Matches
networknode.cpp
Go to the documentation of this file.
1//=============================================================================================================
14
15//=============================================================================================================
16// INCLUDES
17//=============================================================================================================
18
19#include "networknode.h"
20
21#include "networkedge.h"
22
23//=============================================================================================================
24// QT INCLUDES
25//=============================================================================================================
26
27//=============================================================================================================
28// EIGEN INCLUDES
29//=============================================================================================================
30
31//=============================================================================================================
32// USED NAMESPACES
33//=============================================================================================================
34
35using namespace CONNECTIVITYLIB;
36using namespace Eigen;
37
38//=============================================================================================================
39// DEFINE GLOBAL METHODS
40//=============================================================================================================
41
42//=============================================================================================================
43// DEFINE MEMBER METHODS
44//=============================================================================================================
45
46NetworkNode::NetworkNode(qint16 iId, const RowVectorXf& vecVert)
47: m_bIsHub(false)
48, m_iId(iId)
49, m_vecVert(vecVert)
50{
51}
52
53//=============================================================================================================
54
55const QList<QSharedPointer<NetworkEdge> >& NetworkNode::getFullEdges() const
56{
57 return m_lEdges;
58}
59
60//=============================================================================================================
61
62QList<QSharedPointer<NetworkEdge> > NetworkNode::getThresholdedEdges() const
63{
64 QList<QSharedPointer<NetworkEdge> > edgeList;
65
66 for(int i = 0; i< m_lEdges.size(); i++) {
67 if(m_lEdges.at(i)->isActive()) {
68 edgeList << m_lEdges.at(i);
69 }
70 }
71
72 return edgeList;
73}
74
75//=============================================================================================================
76
77QList<QSharedPointer<NetworkEdge> > NetworkNode::getFullEdgesIn() const
78{
79 QList<QSharedPointer<NetworkEdge> > edgeList;
80
81 for(int i = 0; i< m_lEdges.size(); i++) {
82 if(m_lEdges.at(i)->getEndNodeID() == this->getId()) {
83 edgeList << m_lEdges.at(i);
84 }
85 }
86
87 return edgeList;
88}
89
90//=============================================================================================================
91
92QList<QSharedPointer<NetworkEdge> > NetworkNode::getThresholdedEdgesIn() const
93{
94 QList<QSharedPointer<NetworkEdge> > edgeList;
95
96 for(int i = 0; i< m_lEdges.size(); i++) {
97 if(m_lEdges.at(i)->isActive() && m_lEdges.at(i)->getEndNodeID() == this->getId()) {
98 edgeList << m_lEdges.at(i);
99 }
100 }
101
102 return edgeList;
103}
104
105//=============================================================================================================
106
107QList<QSharedPointer<NetworkEdge> > NetworkNode::getFullEdgesOut() const
108{
109 QList<QSharedPointer<NetworkEdge> > edgeList;
110
111 for(int i = 0; i< m_lEdges.size(); i++) {
112 if(m_lEdges.at(i)->getStartNodeID() == this->getId()) {
113 edgeList << m_lEdges.at(i);
114 }
115 }
116
117 return edgeList;
118}
119
120//=============================================================================================================
121
122QList<QSharedPointer<NetworkEdge> > NetworkNode::getThresholdedEdgesOut() const
123{
124 QList<QSharedPointer<NetworkEdge> > edgeList;
125
126 for(int i = 0; i< m_lEdges.size(); i++) {
127 if(m_lEdges.at(i)->isActive() && m_lEdges.at(i)->getStartNodeID() == this->getId()) {
128 edgeList << m_lEdges.at(i);
129 }
130 }
131
132 return edgeList;
133}
134
135//=============================================================================================================
136
137const RowVectorXf& NetworkNode::getVert() const
138{
139 return m_vecVert;
140}
141
142//=============================================================================================================
143
144qint16 NetworkNode::getId() const
145{
146 return m_iId;
147}
148
149//=============================================================================================================
150
152{
153 return m_lEdges.size();
154}
155
156//=============================================================================================================
157
159{
160 qint16 degree = 0;
161
162 for(int i = 0; i < m_lEdges.size(); i++) {
163 if(m_lEdges.at(i)->isActive()) {
164 degree++;
165 }
166 }
167
168 return degree;
169}
170
171//=============================================================================================================
172
174{
175 qint16 degree = 0;
176
177 for(int i = 0; i< m_lEdges.size(); i++) {
178 if(m_lEdges.at(i)->getEndNodeID() == this->getId()) {
179 degree++;
180 }
181 }
182
183 return degree;
184}
185
186//=============================================================================================================
187
189{
190 qint16 degree = 0;
191
192 for(int i = 0; i< m_lEdges.size(); i++) {
193 if(m_lEdges.at(i)->isActive() && m_lEdges.at(i)->getEndNodeID() == this->getId()) {
194 degree++;
195 }
196 }
197
198 return degree;
199}
200
201//=============================================================================================================
202
204{
205 qint16 degree = 0;
206
207 for(int i = 0; i< m_lEdges.size(); i++) {
208 if(m_lEdges.at(i)->getStartNodeID() == this->getId()) {
209 degree++;
210 }
211 }
212
213 return degree;
214}
215
216//=============================================================================================================
217
219{
220 qint16 degree = 0;
221
222 for(int i = 0; i< m_lEdges.size(); i++) {
223 if(m_lEdges.at(i)->isActive() && m_lEdges.at(i)->getStartNodeID() == this->getId()) {
224 degree++;
225 }
226 }
227
228 return degree;
229}
230
231//=============================================================================================================
232
234{
235 double dStrength = 0.0;
236
237 for(int i = 0; i < m_lEdges.size(); ++i) {
238 dStrength += m_lEdges.at(i)->getWeight();
239 }
240
241 return dStrength;
242}
243
244//=============================================================================================================
245
247{
248 double dStrength = 0.0;
249
250 for(int i = 0; i < m_lEdges.size(); ++i) {
251 if(m_lEdges.at(i)->isActive()) {
252 dStrength += m_lEdges.at(i)->getWeight();
253 }
254 }
255
256 return dStrength;
257}
258
259//=============================================================================================================
260
262{
263 double dStrength = 0.0;
264
265 for(int i = 0; i < m_lEdges.size(); ++i) {
266 if(m_lEdges.at(i)->getEndNodeID() == this->getId()) {
267 dStrength += m_lEdges.at(i)->getWeight();
268 }
269 }
270
271 return dStrength;
272}
273
274//=============================================================================================================
275
277{
278 double dStrength = 0.0;
279
280 for(int i = 0; i < m_lEdges.size(); ++i) {
281 if(m_lEdges.at(i)->isActive() && m_lEdges.at(i)->getEndNodeID() == this->getId()) {
282 dStrength += m_lEdges.at(i)->getWeight();
283 }
284 }
285
286 return dStrength;
287}
288
289//=============================================================================================================
290
292{
293 double dStrength = 0.0;
294
295 for(int i = 0; i < m_lEdges.size(); ++i) {
296 if(m_lEdges.at(i)->getStartNodeID() == this->getId()) {
297 dStrength += m_lEdges.at(i)->getWeight();
298 }
299 }
300
301 return dStrength;
302}
303
304//=============================================================================================================
305
307{
308 double dStrength = 0.0;
309
310 for(int i = 0; i < m_lEdges.size(); ++i) {
311 if(m_lEdges.at(i)->isActive() && m_lEdges.at(i)->getStartNodeID() == this->getId()) {
312 dStrength += m_lEdges.at(i)->getWeight();
313 }
314 }
315
316 return dStrength;
317}
318
319//=============================================================================================================
320
322{
323 m_bIsHub = bIsHub;
324}
325
326//=============================================================================================================
327
329{
330 return m_bIsHub;
331}
332
333//=============================================================================================================
334
335void NetworkNode::append(QSharedPointer<NetworkEdge> newEdge)
336{
337 if(newEdge->getEndNodeID() != newEdge->getStartNodeID()) {
338 m_lEdges << newEdge;
339 }
340}
341
Weighted edge between two NetworkNode instances; stores the full per-frequency weight matrix and the ...
Node of a connectivity Network; carries a 3D position and the lists of incident (in / out,...
Functional connectivity metrics (coherence, PLV, cross-correlation, etc.).
double getThresholdedOutstrength() const
qint16 getThresholdedIndegree() const
qint16 getThresholdedOutdegree() const
QList< QSharedPointer< NetworkEdge > > getThresholdedEdges() const
qint16 getThresholdedDegree() const
double getThresholdedStrength() const
void setHubStatus(bool bIsHub)
NetworkNode(qint16 iId, const Eigen::RowVectorXf &vecVert)
void append(QSharedPointer< NetworkEdge > newEdge)
QList< QSharedPointer< NetworkEdge > > getFullEdgesOut() const
QList< QSharedPointer< NetworkEdge > > getThresholdedEdgesOut() const
double getThresholdedInstrength() const
QList< QSharedPointer< NetworkEdge > > m_lEdges
QList< QSharedPointer< NetworkEdge > > getFullEdgesIn() const
const Eigen::RowVectorXf & getVert() const
Eigen::RowVectorXf m_vecVert
const QList< QSharedPointer< NetworkEdge > > & getFullEdges() const
QList< QSharedPointer< NetworkEdge > > getThresholdedEdgesIn() const