64using namespace CONNECTIVITYLIB;
66using namespace UTILSLIB;
78: m_sConnectivityMethod(sConnectivityMethod)
79, m_minMaxFullWeights(QPair<double,double>(
std::numeric_limits<double>::max(),0.0))
80, m_minMaxThresholdedWeights(QPair<double,double>(
std::numeric_limits<double>::max(),0.0))
81, m_dThreshold(dThreshold)
86 qRegisterMetaType<CONNECTIVITYLIB::Network>(
"CONNECTIVITYLIB::Network");
87 qRegisterMetaType<CONNECTIVITYLIB::Network::SPtr>(
"CONNECTIVITYLIB::Network::SPtr");
88 qRegisterMetaType<QList<CONNECTIVITYLIB::Network> >(
"QList<CONNECTIVITYLIB::Network>");
89 qRegisterMetaType<QList<CONNECTIVITYLIB::Network::SPtr> >(
"QList<CONNECTIVITYLIB::Network::SPtr>");
103 if(row < matDist.rows() && col < matDist.cols()) {
106 if(bGetMirroredVersion) {
127 if(row < matDist.rows() && col < matDist.cols()) {
130 if(bGetMirroredVersion) {
172 qint16 distribution = 0;
174 for(
int i = 0; i <
m_lNodes.size(); ++i) {
175 distribution +=
m_lNodes.at(i)->getFullDegree();
185 qint16 distribution = 0;
187 for(
int i = 0; i <
m_lNodes.size(); ++i) {
188 distribution +=
m_lNodes.at(i)->getThresholdedDegree();
227 int minDegree = 1000000;
229 for(
int i = 0; i <
m_lNodes.size(); ++i) {
230 if(
m_lNodes.at(i)->getFullDegree() > maxDegree){
231 maxDegree =
m_lNodes.at(i)->getFullDegree();
232 }
else if (
m_lNodes.at(i)->getFullDegree() < minDegree){
233 minDegree =
m_lNodes.at(i)->getFullDegree();
237 return QPair<int,int>(minDegree,maxDegree);
245 int minDegree = 1000000;
247 for(
int i = 0; i <
m_lNodes.size(); ++i) {
248 if(
m_lNodes.at(i)->getThresholdedDegree() > maxDegree){
249 maxDegree =
m_lNodes.at(i)->getThresholdedDegree();
250 }
else if (
m_lNodes.at(i)->getThresholdedDegree() < minDegree){
251 minDegree =
m_lNodes.at(i)->getThresholdedDegree();
255 return QPair<int,int>(minDegree,maxDegree);
263 int minDegree = 1000000;
265 for(
int i = 0; i <
m_lNodes.size(); ++i) {
266 if(
m_lNodes.at(i)->getFullIndegree() > maxDegree){
267 maxDegree =
m_lNodes.at(i)->getFullIndegree();
268 }
else if (
m_lNodes.at(i)->getFullIndegree() < minDegree){
269 minDegree =
m_lNodes.at(i)->getFullIndegree();
273 return QPair<int,int>(minDegree,maxDegree);
281 int minDegree = 1000000;
283 for(
int i = 0; i <
m_lNodes.size(); ++i) {
284 if(
m_lNodes.at(i)->getThresholdedIndegree() > maxDegree){
285 maxDegree =
m_lNodes.at(i)->getThresholdedIndegree();
286 }
else if (
m_lNodes.at(i)->getThresholdedIndegree() < minDegree){
287 minDegree =
m_lNodes.at(i)->getThresholdedIndegree();
291 return QPair<int,int>(minDegree,maxDegree);
299 int minDegree = 1000000;
301 for(
int i = 0; i <
m_lNodes.size(); ++i) {
302 if(
m_lNodes.at(i)->getFullOutdegree() > maxDegree){
303 maxDegree =
m_lNodes.at(i)->getFullOutdegree();
304 }
else if (
m_lNodes.at(i)->getFullOutdegree() < minDegree){
305 minDegree =
m_lNodes.at(i)->getFullOutdegree();
309 return QPair<int,int>(minDegree,maxDegree);
317 int minDegree = 1000000;
319 for(
int i = 0; i <
m_lNodes.size(); ++i) {
320 if(
m_lNodes.at(i)->getThresholdedOutdegree() > maxDegree){
321 maxDegree =
m_lNodes.at(i)->getThresholdedOutdegree();
322 }
else if (
m_lNodes.at(i)->getThresholdedOutdegree() < minDegree){
323 minDegree =
m_lNodes.at(i)->getThresholdedOutdegree();
327 return QPair<int,int>(minDegree,maxDegree);
361 if(fLowerFreq > fUpperFreq || fUpperFreq < fLowerFreq) {
362 qDebug() <<
"Network::setFrequencyRange - Upper and lower frequency are out of range from each other. Weights will not be recalculated. Returning.";
367 qDebug() <<
"Network::setFrequencyRange - Sampling frequency has not been set. Returning.";
372 qDebug() <<
"Network::setFrequencyRange - Upper frequency is bigger than nyquist frequency. Returning.";
377 qDebug() <<
"Network::setFrequencyRange - Number of samples has not been set. Returning.";
386 int iLowerBin = fLowerFreq * dScaleFactor;
387 int iUpperBin = fUpperFreq * dScaleFactor;
393 m_lFullEdges.at(i)->setFrequencyBins(QPair<int,int>(iLowerBin,iUpperBin));
414 if(newEdge->getEndNodeID() != newEdge->getStartNodeID()) {
415 double dEdgeWeight = newEdge->getWeight();
454 qDebug() <<
"Network::normalize() - Max weight is 0. Returning.";
NetworkEdge class declaration.
NetworkNode class declaration.
Network class declaration.
Declaration of Spectral class.
VisualizationInfo getVisualizationInfo() const
void setVisualizationInfo(const VisualizationInfo &visualizationInfo)
int getUsedFreqBins() const
qint16 getThresholdedDistribution() const
void setUsedFreqBins(int iNumberFreqBins)
void setConnectivityMethod(const QString &sConnectivityMethod)
void append(QSharedPointer< NetworkEdge > newEdge)
QPair< double, double > m_minMaxFullWeights
QPair< int, int > getMinMaxFullDegrees() const
Eigen::MatrixXd getThresholdedConnectivityMatrix(bool bGetMirroredVersion=true) const
QPair< double, double > getMinMaxThresholdedWeights() const
void setFFTSize(int iFFTSize)
QPair< double, double > getMinMaxFullWeights() const
QList< QSharedPointer< NetworkNode > > m_lNodes
QPair< int, int > getMinMaxFullIndegrees() const
Network(const QString &sConnectivityMethod="Unknown", double dThreshold=0.0)
void setSamplingFrequency(float fSFreq)
const QPair< float, float > & getFrequencyRange() const
void setThreshold(double dThreshold=0.0)
QString getConnectivityMethod() const
Eigen::MatrixXd getFullConnectivityMatrix(bool bGetMirroredVersion=true) const
VisualizationInfo m_visualizationInfo
QPair< int, int > getMinMaxThresholdedDegrees() const
QSharedPointer< NetworkNode > getNodeAt(int i)
QPair< double, double > m_minMaxThresholdedWeights
const QList< QSharedPointer< NetworkNode > > & getNodes() const
QPair< int, int > getMinMaxThresholdedIndegrees() const
float getSamplingFrequency() const
void setFrequencyRange(float fLowerFreq, float fUpperFreq)
QPair< int, int > getMinMaxFullOutdegrees() const
const QList< QSharedPointer< NetworkEdge > > & getThresholdedEdges() const
QPair< float, float > m_minMaxFrequency
QList< QSharedPointer< NetworkEdge > > m_lThresholdedEdges
const QList< QSharedPointer< NetworkEdge > > & getFullEdges() const
QPair< int, int > getMinMaxThresholdedOutdegrees() const
QList< QSharedPointer< NetworkEdge > > m_lFullEdges
qint16 getFullDistribution() const
QString m_sConnectivityMethod
QSharedPointer< NetworkEdge > SPtr
QSharedPointer< NetworkNode > SPtr