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 }
static Network calculate(ConnectivitySettings &connectivitySettings)
static QList< Network > calculate(ConnectivitySettings &connectivitySettings)
This class is a container for connectivity settings.
DebiasedSquaredWeightedPhaseLagIndex class declaration.
CrossCorrelation class declaration.
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: correlation.cpp:79
Network class declaration.
UnbiasedSquaredPhaseLagIndex class declaration.
PhaseLagIndex class declaration.
static Network calculate(ConnectivitySettings &connectivitySettings)
Definition: coherence.cpp:83
static Network calculate(ConnectivitySettings &connectivitySettings)
WeightedPhaseLagIndex class declaration.
Correlation class declaration.
Coherence class declaration.
ConnectivitySettings class declaration.
Connectivity class declaration.
static Network calculate(ConnectivitySettings &connectivitySettings)
static Network calculate(ConnectivitySettings &connectivitySettings)
PhaseLockingValue class declaration.
static Network calculate(ConnectivitySettings &connectivitySettings)
Imaginary coherence class declaration.