66 qRegisterMetaType<CONNECTIVITYLIB::Network>(
"CONNECTIVITYLIB::Network");
67 qRegisterMetaType<CONNECTIVITYLIB::Network::SPtr>(
"CONNECTIVITYLIB::Network::SPtr");
68 qRegisterMetaType<QList<CONNECTIVITYLIB::Network>>(
"QList<CONNECTIVITYLIB::Network>");
69 qRegisterMetaType<QList<CONNECTIVITYLIB::Network::SPtr>>(
"QList<CONNECTIVITYLIB::Network::SPtr>");
83 if (row < matDist.rows() && col < matDist.cols()) {
86 if (bGetMirroredVersion) {
107 if (row < matDist.rows() && col < matDist.cols()) {
110 if (bGetMirroredVersion) {
159 qint16 distribution = 0;
161 for (
int i = 0; i <
m_lNodes.size(); ++i) {
162 distribution +=
m_lNodes.at(i)->getFullDegree();
172 qint16 distribution = 0;
174 for (
int i = 0; i <
m_lNodes.size(); ++i) {
175 distribution +=
m_lNodes.at(i)->getThresholdedDegree();
214 int minDegree = 1000000;
216 for (
int i = 0; i <
m_lNodes.size(); ++i) {
217 if (
m_lNodes.at(i)->getFullDegree() > maxDegree) {
218 maxDegree =
m_lNodes.at(i)->getFullDegree();
220 if (
m_lNodes.at(i)->getFullDegree() < minDegree) {
221 minDegree =
m_lNodes.at(i)->getFullDegree();
225 return QPair<int, int>(minDegree, maxDegree);
233 int minDegree = 1000000;
235 for (
int i = 0; i <
m_lNodes.size(); ++i) {
236 if (
m_lNodes.at(i)->getThresholdedDegree() > maxDegree) {
237 maxDegree =
m_lNodes.at(i)->getThresholdedDegree();
239 if (
m_lNodes.at(i)->getThresholdedDegree() < minDegree) {
240 minDegree =
m_lNodes.at(i)->getThresholdedDegree();
244 return QPair<int, int>(minDegree, maxDegree);
252 int minDegree = 1000000;
254 for (
int i = 0; i <
m_lNodes.size(); ++i) {
255 if (
m_lNodes.at(i)->getFullIndegree() > maxDegree) {
256 maxDegree =
m_lNodes.at(i)->getFullIndegree();
258 if (
m_lNodes.at(i)->getFullIndegree() < minDegree) {
259 minDegree =
m_lNodes.at(i)->getFullIndegree();
263 return QPair<int, int>(minDegree, maxDegree);
271 int minDegree = 1000000;
273 for (
int i = 0; i <
m_lNodes.size(); ++i) {
274 if (
m_lNodes.at(i)->getThresholdedIndegree() > maxDegree) {
275 maxDegree =
m_lNodes.at(i)->getThresholdedIndegree();
277 if (
m_lNodes.at(i)->getThresholdedIndegree() < minDegree) {
278 minDegree =
m_lNodes.at(i)->getThresholdedIndegree();
282 return QPair<int, int>(minDegree, maxDegree);
290 int minDegree = 1000000;
292 for (
int i = 0; i <
m_lNodes.size(); ++i) {
293 if (
m_lNodes.at(i)->getFullOutdegree() > maxDegree) {
294 maxDegree =
m_lNodes.at(i)->getFullOutdegree();
296 if (
m_lNodes.at(i)->getFullOutdegree() < minDegree) {
297 minDegree =
m_lNodes.at(i)->getFullOutdegree();
301 return QPair<int, int>(minDegree, maxDegree);
309 int minDegree = 1000000;
311 for (
int i = 0; i <
m_lNodes.size(); ++i) {
312 if (
m_lNodes.at(i)->getThresholdedOutdegree() > maxDegree) {
313 maxDegree =
m_lNodes.at(i)->getThresholdedOutdegree();
315 if (
m_lNodes.at(i)->getThresholdedOutdegree() < minDegree) {
316 minDegree =
m_lNodes.at(i)->getThresholdedOutdegree();
320 return QPair<int, int>(minDegree, maxDegree);
354 if (fLowerFreq > fUpperFreq) {
355 qDebug() <<
"Network::setFrequencyRange - Upper and lower frequency are out of range from each other. Weights will not be recalculated. Returning.";
360 qDebug() <<
"Network::setFrequencyRange - Sampling frequency has not been set. Returning.";
365 qDebug() <<
"Network::setFrequencyRange - Upper frequency is bigger than nyquist frequency. Returning.";
370 qDebug() <<
"Network::setFrequencyRange - Number of samples has not been set. Returning.";
379 int iLowerBin = fLowerFreq * dScaleFactor;
380 int iUpperBin = fUpperFreq * dScaleFactor;
386 m_lFullEdges.at(i)->setFrequencyBins(QPair<int, int>(iLowerBin, iUpperBin));
408 if (newEdge->getEndNodeID() != newEdge->getStartNodeID()) {
409 double dEdgeWeight = newEdge->getWeight();
449 qDebug() <<
"Network::normalize() - Max weight is 0. Returning.";
Multi-taper spectral estimation: tapered FFT, power and cross-spectral density, DPSS weighting.
Node of a connectivity CONNECTIVITYLIB::Network; carries a 3D position and the lists of incident (in ...
Weighted edge between two CONNECTIVITYLIB::NetworkNode instances; stores the full per-frequency weigh...
Graph container that stores the result of one functional-connectivity metric as nodes (sources/sensor...
Functional connectivity metrics (coherence, PLV, cross-correlation, etc.).
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
Per-network rendering hints: colour-map name or fixed RGBA for nodes and edges.
VisualizationInfo getVisualizationInfo() const
void setVisualizationInfo(const VisualizationInfo &visualizationInfo)
int getUsedFreqBins() const
qint16 getThresholdedDistribution() const
void setUsedFreqBins(int iNumberFreqBins)
void setConnectivityMethod(const QString &sConnectivityMethod)
QSharedPointer< NetworkEdge > getEdgeAt(int i)
void append(QSharedPointer< NetworkEdge > newEdge)
QPair< int, int > getMinMaxFullDegrees() const
Eigen::MatrixXd getThresholdedConnectivityMatrix(bool bGetMirroredVersion=true) const
QPair< double, double > getMinMaxThresholdedWeights() const
QPair< double, double > m_minMaxThresholdedWeights
void setFFTSize(int iFFTSize)
QPair< double, double > getMinMaxFullWeights() const
QPair< float, float > m_minMaxFrequency
QPair< double, double > m_minMaxFullWeights
QList< QSharedPointer< NetworkNode > > m_lNodes
QPair< int, int > getMinMaxFullIndegrees() const
Network(const QString &sConnectivityMethod="Unknown", double dThreshold=0.0)
void setSamplingFrequency(float fSFreq)
const QPair< float, float > & getFrequencyRange() const
void setThreshold(double dThreshold=0.0)
QString getConnectivityMethod() const
Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion=true) const
VisualizationInfo m_visualizationInfo
QPair< int, int > getMinMaxThresholdedDegrees() const
QSharedPointer< NetworkNode > getNodeAt(int i)
const QList< QSharedPointer< NetworkNode > > & getNodes() const
QPair< int, int > getMinMaxThresholdedIndegrees() const
float getSamplingFrequency() const
void setFrequencyRange(float fLowerFreq, float fUpperFreq)
QPair< int, int > getMinMaxFullOutdegrees() const
const QList< QSharedPointer< NetworkEdge > > & getThresholdedEdges() const
QList< QSharedPointer< NetworkEdge > > m_lThresholdedEdges
const QList< QSharedPointer< NetworkEdge > > & getFullEdges() const
QPair< int, int > getMinMaxThresholdedOutdegrees() const
QList< QSharedPointer< NetworkEdge > > m_lFullEdges
qint16 getFullDistribution() const
QString m_sConnectivityMethod
QSharedPointer< NetworkEdge > SPtr
QSharedPointer< NetworkNode > SPtr