MNE-CPP  0.1.9
A Framework for Electrophysiology
connectivity.cpp
Go to the documentation of this file.
1 //=============================================================================================================
37 //=============================================================================================================
38 // INCLUDES
39 //=============================================================================================================
40 
41 #include "connectivity.h"
42 
43 #include "connectivitysettings.h"
44 #include "network/network.h"
45 #include "metrics/correlation.h"
47 #include "metrics/coherence.h"
48 #include "metrics/imagcoherence.h"
49 #include "metrics/phaselagindex.h"
54 
55 //=============================================================================================================
56 // QT INCLUDES
57 //=============================================================================================================
58 
59 #include <QDebug>
60 #include <QFutureSynchronizer>
61 #include <QtConcurrent>
62 
63 //=============================================================================================================
64 // EIGEN INCLUDES
65 //=============================================================================================================
66 
67 //=============================================================================================================
68 // USED NAMESPACES
69 //=============================================================================================================
70 
71 using namespace CONNECTIVITYLIB;
72 
73 //=============================================================================================================
74 // DEFINE GLOBAL METHODS
75 //=============================================================================================================
76 
77 //=============================================================================================================
78 // DEFINE MEMBER METHODS
79 //=============================================================================================================
80 
82 {
83 }
84 
85 //=============================================================================================================
86 
87 QList<Network> Connectivity::calculate(ConnectivitySettings& connectivitySettings)
88 {
89  QStringList lMethods = connectivitySettings.getConnectivityMethods();
90  QList<Network> results;
91  QElapsedTimer timer;
92  timer.start();
93 
94  if(lMethods.contains("WPLI")) {
95  results.append(WeightedPhaseLagIndex::calculate(connectivitySettings));
96  }
97 
98  if(lMethods.contains("USPLI")) {
99  results.append(UnbiasedSquaredPhaseLagIndex::calculate(connectivitySettings));
100  }
101 
102  if(lMethods.contains("COR")) {
103  results.append(Correlation::calculate(connectivitySettings));
104  }
105 
106  if(lMethods.contains("XCOR")) {
107  results.append(CrossCorrelation::calculate(connectivitySettings));
108  }
109 
110  if(lMethods.contains("PLI")) {
111  results.append(PhaseLagIndex::calculate(connectivitySettings));
112  }
113 
114  if(lMethods.contains("COH")) {
115  results.append(Coherence::calculate(connectivitySettings));
116  }
117 
118  if(lMethods.contains("IMAGCOH")) {
119  results.append(ImagCoherence::calculate(connectivitySettings));
120  }
121 
122  if(lMethods.contains("PLV")) {
123  results.append(PhaseLockingValue::calculate(connectivitySettings));
124  }
125 
126  if(lMethods.contains("DSWPLI")) {
127  results.append(DebiasedSquaredWeightedPhaseLagIndex::calculate(connectivitySettings));
128  }
129 
130  qWarning() << "Total" << timer.elapsed();
131  qDebug() << "Connectivity::calculateMultiMethods - Calculated"<< lMethods <<"for" << connectivitySettings.size() << "trials in"<< timer.elapsed() << "msecs.";
132 
133  return results;
134 }
debiasedsquaredweightedphaselagindex.h
DebiasedSquaredWeightedPhaseLagIndex class declaration.
network.h
Network class declaration.
CONNECTIVITYLIB::PhaseLockingValue::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: phaselockingvalue.cpp:85
crosscorrelation.h
CrossCorrelation class declaration.
CONNECTIVITYLIB::Connectivity::calculate
static QList< Network > calculate(ConnectivitySettings &connectivitySettings)
Definition: connectivity.cpp:87
CONNECTIVITYLIB::Correlation::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: correlation.cpp:79
weightedphaselagindex.h
WeightedPhaseLagIndex class declaration.
CONNECTIVITYLIB::CrossCorrelation::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: crosscorrelation.cpp:81
unbiasedsquaredphaselagindex.h
UnbiasedSquaredPhaseLagIndex class declaration.
phaselagindex.h
PhaseLagIndex class declaration.
CONNECTIVITYLIB::Connectivity::Connectivity
Connectivity()
Definition: connectivity.cpp:81
CONNECTIVITYLIB::ImagCoherence::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: imagcoherence.cpp:82
CONNECTIVITYLIB::PhaseLagIndex::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: phaselagindex.cpp:85
CONNECTIVITYLIB::ConnectivitySettings
This class is a container for connectivity settings.
Definition: connectivitysettings.h:91
phaselockingvalue.h
PhaseLockingValue class declaration.
CONNECTIVITYLIB::DebiasedSquaredWeightedPhaseLagIndex::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: debiasedsquaredweightedphaselagindex.cpp:85
correlation.h
Correlation class declaration.
CONNECTIVITYLIB::UnbiasedSquaredPhaseLagIndex::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: unbiasedsquaredphaselagindex.cpp:85
coherence.h
Coherence class declaration.
CONNECTIVITYLIB::Coherence::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: coherence.cpp:83
imagcoherence.h
Imaginary coherence class declaration.
connectivitysettings.h
ConnectivitySettings class declaration.
connectivity.h
Connectivity class declaration.
CONNECTIVITYLIB::WeightedPhaseLagIndex::calculate
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: weightedphaselagindex.cpp:86