49 #include <QCommandLineParser>
50 #include <QElapsedTimer>
61 using namespace CONNECTIVITYLIB;
62 using namespace MNELIB;
63 using namespace Eigen;
64 using namespace FIFFLIB;
65 using namespace FSLIB;
76 : m_fFreqResolution(1.0f)
78 , m_sWindowType(
"hanning")
81 qRegisterMetaType<CONNECTIVITYLIB::ConnectivitySettings>(
"CONNECTIVITYLIB::ConnectivitySettings");
86 void ConnectivitySettings::clearAllData()
90 clearIntermediateData();
95 void ConnectivitySettings::clearIntermediateData()
117 void ConnectivitySettings::append(
const QList<MatrixXd>& matInputData)
119 for(
int i = 0; i < matInputData.size(); ++i) {
120 this->append(matInputData.at(i));
126 void ConnectivitySettings::append(
const MatrixXd& matInputData)
129 tempData.matData = matInputData;
150 int ConnectivitySettings::size()
const
157 bool ConnectivitySettings::isEmpty()
const
164 void ConnectivitySettings::removeFirst(
int iAmount)
171 qDebug() <<
"ConnectivitySettings::removeFirst - No elements to delete. Returning.";
176 qDebug() <<
"ConnectivitySettings::removeFirst - Not enough elements stored in list in order to delete them. Returning.";
181 for (
int j = 0; j < iAmount; ++j) {
182 for (
int i = 0; i <
m_trialData.first().matData.rows(); ++i) {
215 void ConnectivitySettings::removeLast(
int iAmount)
222 qDebug() <<
"ConnectivitySettings::removeLast - No elements to delete. Returning.";
227 qDebug() <<
"ConnectivitySettings::removeLast - Not enough elements stored in list in order to delete them. Returning.";
232 for (
int j = 0; j < iAmount; ++j) {
233 for (
int i = 0; i <
m_trialData.last().matData.rows(); ++i) {
266 void ConnectivitySettings::setConnectivityMethods(
const QStringList& sConnectivityMethods)
273 const QStringList& ConnectivitySettings::getConnectivityMethods()
const
280 void ConnectivitySettings::setSamplingFrequency(
int iSFreq)
286 clearIntermediateData();
297 int ConnectivitySettings::getSamplingFrequency()
const
304 void ConnectivitySettings::setFFTSize(
int iNfft)
310 clearIntermediateData();
318 int ConnectivitySettings::getFFTSize()
const
325 void ConnectivitySettings::setWindowType(
const QString& sWindowType)
328 clearIntermediateData();
335 const QString& ConnectivitySettings::getWindowType()
const
342 void ConnectivitySettings::setNodePositions(
const FiffInfo& fiffInfo,
343 const RowVectorXi& picks)
348 for(
int i = 0; i < picks.cols(); ++i) {
349 kind = fiffInfo.
chs.at(i).kind;
350 if(kind == FIFFV_EEG_CH ||
351 kind == FIFFV_MEG_CH) {
364 MatrixX3f matNodeVertLeft, matNodeVertRight;
367 matNodeVertLeft.resize(forwardSolution.
src[0].cluster_info.centroidVertno.
size(),3);
368 for(
int j = 0; j < matNodeVertLeft.rows(); ++j) {
369 matNodeVertLeft.row(j) = surfSet[0].rr().row(forwardSolution.
src[0].cluster_info.centroidVertno.at(j)) - surfSet[0].offset().transpose();
372 matNodeVertRight.resize(forwardSolution.
src[1].cluster_info.centroidVertno.
size(),3);
373 for(
int j = 0; j < matNodeVertRight.rows(); ++j) {
374 matNodeVertRight.row(j) = surfSet[1].rr().row(forwardSolution.
src[1].cluster_info.centroidVertno.at(j)) - surfSet[1].offset().transpose();
377 matNodeVertLeft.resize(forwardSolution.
src[0].vertno.rows(),3);
378 for(
int j = 0; j < matNodeVertLeft.rows(); ++j) {
379 matNodeVertLeft.row(j) = surfSet[0].rr().row(forwardSolution.
src[0].vertno(j)) - surfSet[0].offset().transpose();
382 matNodeVertRight.resize(forwardSolution.
src[1].vertno.rows(),3);
383 for(
int j = 0; j < matNodeVertRight.rows(); ++j) {
384 matNodeVertRight.row(j) = surfSet[1].rr().row(forwardSolution.
src[1].vertno(j)) - surfSet[1].offset().transpose();
394 void ConnectivitySettings::setNodePositions(
const MatrixX3f& matNodePositions)
401 const MatrixX3f& ConnectivitySettings::getNodePositions()
const
408 QList<ConnectivitySettings::IntermediateTrialData>& ConnectivitySettings::getTrialData()