49#include <QElapsedTimer>
50#include <QtConcurrent>
56#include <unsupported/Eigen/FFT>
87 if(connectivitySettings.
isEmpty()) {
88 qDebug() <<
"Correlation::calculate - Input data is empty";
95 int rows = connectivitySettings.
at(0).
matData.rows();
96 RowVectorXf rowVert = RowVectorXf::Zero(3);
98 for(
int i = 0; i < rows; ++i) {
99 rowVert = RowVectorXf::Zero(3);
118 QFuture<MatrixXd> resultMat = QtConcurrent::mappedReduced(connectivitySettings.
getTrialData(),
121 resultMat.waitForFinished();
123 MatrixXd matDist = resultMat.result();
138 MatrixXd matWeight(1,1);
139 QSharedPointer<NetworkEdge> pEdge;
142 for(
int i = 0; i < matDist.rows(); ++i) {
143 for(j = i; j < matDist.cols(); ++j) {
144 matWeight << matDist(i,j);
146 pEdge = QSharedPointer<NetworkEdge>(
new NetworkEdge(i, j, matWeight));
148 finalNetwork.
getNodeAt(i)->append(pEdge);
149 finalNetwork.
getNodeAt(j)->append(pEdge);
150 finalNetwork.
append(pEdge);
165 MatrixXd matDist = MatrixXd::Zero(inputData.
matData.rows(), inputData.
matData.rows());
185 const MatrixXd &data)
187 if(resultData.rows() != data.rows() || resultData.cols() != data.cols()) {
188 resultData.resize(data.rows(), data.cols());
189 resultData.setZero();
Correlation class declaration.
NetworkEdge class declaration.
NetworkNode class declaration.
Network class declaration.
Functional connectivity metrics (coherence, PLV, cross-correlation, etc.).
This class is a container for connectivity settings.
QList< IntermediateTrialData > & getTrialData()
const IntermediateTrialData & at(int i) const
int getSamplingFrequency() const
const Eigen::MatrixX3f & getNodePositions() const
Per-trial intermediate frequency-domain data used during connectivity computation.
static Eigen::MatrixXd compute(const ConnectivitySettings::IntermediateTrialData &inputData)
static Network calculate(ConnectivitySettings &connectivitySettings)
static void reduce(Eigen::MatrixXd &resultData, const Eigen::MatrixXd &data)
This class holds information about a network, can compute a distance table and provide network metric...
void append(QSharedPointer< NetworkEdge > newEdge)
void setSamplingFrequency(float fSFreq)
QSharedPointer< NetworkNode > getNodeAt(int i)
This class holds an object to describe the edge of a network.
This class holds an object to describe the node of a network.
QSharedPointer< NetworkNode > SPtr