v2.0.0
Loading...
Searching...
No Matches
connectivity.cpp
Go to the documentation of this file.
1//=============================================================================================================
24
25//=============================================================================================================
26// INCLUDES
27//=============================================================================================================
28
29#include "connectivity.h"
30
32#include "network/network.h"
33#include "metrics/correlation.h"
35#include "metrics/coherence.h"
45
46//=============================================================================================================
47// QT INCLUDES
48//=============================================================================================================
49
50#include <QDebug>
51#include <QFutureSynchronizer>
52#include <QtConcurrent>
53
54//=============================================================================================================
55// EIGEN INCLUDES
56//=============================================================================================================
57
58//=============================================================================================================
59// USED NAMESPACES
60//=============================================================================================================
61
62using namespace CONNECTIVITYLIB;
63
64//=============================================================================================================
65// DEFINE GLOBAL METHODS
66//=============================================================================================================
67
68//=============================================================================================================
69// DEFINE MEMBER METHODS
70//=============================================================================================================
71
75
76//=============================================================================================================
77
78QList<Network> Connectivity::calculate(ConnectivitySettings& connectivitySettings)
79{
80 QStringList lMethods = connectivitySettings.getConnectivityMethods();
81 QList<Network> results;
82 QElapsedTimer timer;
83 timer.start();
84
85 if (lMethods.contains("WPLI")) {
86 results.append(WeightedPhaseLagIndex::calculate(connectivitySettings));
87 }
88
89 if (lMethods.contains("USPLI")) {
90 results.append(UnbiasedSquaredPhaseLagIndex::calculate(connectivitySettings));
91 }
92
93 if (lMethods.contains("COR")) {
94 results.append(Correlation::calculate(connectivitySettings));
95 }
96
97 if (lMethods.contains("XCOR")) {
98 results.append(CrossCorrelation::calculate(connectivitySettings));
99 }
100
101 if (lMethods.contains("PLI")) {
102 results.append(PhaseLagIndex::calculate(connectivitySettings));
103 }
104
105 if (lMethods.contains("COH")) {
106 results.append(Coherence::calculate(connectivitySettings));
107 }
108
109 if (lMethods.contains("IMAGCOH")) {
110 results.append(ImagCoherence::calculate(connectivitySettings));
111 }
112
113 if (lMethods.contains("PLV")) {
114 results.append(PhaseLockingValue::calculate(connectivitySettings));
115 }
116
117 if (lMethods.contains("DSWPLI")) {
118 results.append(DebiasedSquaredWeightedPhaseLagIndex::calculate(connectivitySettings));
119 }
120
121 if (lMethods.contains("GC")) {
122 results.append(GrangerCausality::calculate(connectivitySettings));
123 }
124
125 if (lMethods.contains("DTF")) {
126 results.append(DirectedTransferFunction::calculate(connectivitySettings));
127 }
128
129 if (lMethods.contains("PDC")) {
130 results.append(PartialDirectedCoherence::calculate(connectivitySettings));
131 }
132
133 qWarning() << "Total" << timer.elapsed();
134 qDebug() << "Connectivity::calculateMultiMethods - Calculated" << lMethods << "for" << connectivitySettings.size() << "trials in" << timer.elapsed() << "msecs.";
135
136 return results;
137}
Front-end dispatcher that runs the requested connectivity metrics over a CONNECTIVITYLIB::Connectivit...
Graph container that stores the result of one functional-connectivity metric as nodes (sources/sensor...
Input-data and parameter container shared by every functional-connectivity metric in CONNECTIVITYLIB.
Spectral Granger Causality (Geweke 1982, Bressler & Seth 2011) between every channel pair,...
Magnitude-squared coherence (MSC) between every channel pair, band-averaged over the selected DPSS sp...
Debiased squared Weighted Phase Lag Index (Vinck et al., 2011) between every channel pair.
Unbiased estimator of squared Phase Lag Index between every channel pair.
Phase Lag Index (Stam, Nolte & Daffertshofer 2007) between every channel pair.
Time-lagged cross-correlation between every channel pair, computed via the inverse FFT of the cross-s...
Partial Directed Coherence (Baccala & Sameshima 2001) between every channel pair, derived from a fitt...
Directed Transfer Function (Kaminski & Blinowska 1991) between every channel pair,...
Weighted Phase Lag Index (Vinck, Oostenveld, van Wingerden, Battaglia & Pennartz 2011) between every ...
Pearson correlation coefficient between every pair of zero-lag time-domain channels.
Volume-conduction-robust imaginary coherence (Nolte et al., 2004) between every channel pair.
Phase Locking Value (Lachaux, Rodriguez, Martinerie & Varela 1999) between every channel pair.
Functional connectivity metrics (coherence, PLV, cross-correlation, etc.).
static QList< Network > calculate(ConnectivitySettings &connectivitySettings)
Aggregates trial data, spectral cache and node geometry shared by all CONNECTIVITYLIB metrics.
const QStringList & getConnectivityMethods() const
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition coherence.cpp:61
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)