MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
mne_cluster_info.h
Go to the documentation of this file.
1//=============================================================================================================
37#ifndef MNE_CLUSTER_INFO_H
38#define MNE_CLUSTER_INFO_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "mne_global.h"
45
46//=============================================================================================================
47// EIGEN INCLUDES
48//=============================================================================================================
49
50#include <Eigen/Core>
51
52//=============================================================================================================
53// QT INCLUDES
54//=============================================================================================================
55
56#include <QSharedPointer>
57#include <QList>
58
59//=============================================================================================================
60// DEFINE NAMESPACE MNELIB
61//=============================================================================================================
62
63namespace MNELIB
64{
65
66//=============================================================================================================
73{
74public:
75 typedef QSharedPointer<MNEClusterInfo> SPtr;
76 typedef QSharedPointer<const MNEClusterInfo> ConstSPtr;
78 //=========================================================================================================
83
84 //=========================================================================================================
88 void clear();
89
90 //=========================================================================================================
96 inline bool isEmpty() const;
97
98 //=========================================================================================================
104 inline qint32 numClust() const;
105
106 //=========================================================================================================
112 void write(QString p_sFileName) const;
113
121 friend bool operator== (const MNEClusterInfo &a, const MNEClusterInfo &b);
122
123public:
124 QList<QString> clusterLabelNames;
125 QList<qint32> clusterLabelIds;
126 QList<qint32> centroidVertno;
127 QList<Eigen::Vector3f> centroidSource_rr;
128 QList<Eigen::VectorXi> clusterVertnos;
129 QList<Eigen::MatrixX3f> clusterSource_rr;
130 QList<Eigen::VectorXd> clusterDistances;
131};
132
133//=============================================================================================================
134// INLINE DEFINITIONS
135//=============================================================================================================
136
137inline bool MNEClusterInfo::isEmpty() const
138{
139 return !(this->clusterVertnos.size() > 0);
140}
141
142//=============================================================================================================
143
144inline qint32 MNEClusterInfo::numClust() const
145{
146 return this->clusterVertnos.size();
147}
148
149//=============================================================================================================
150
151inline bool operator== (const MNEClusterInfo &a, const MNEClusterInfo &b)
152{
153 if(a.centroidSource_rr.size() == b.centroidSource_rr.size()) {
154 for(int i = 0; i < a.centroidSource_rr.size(); ++i) {
155 if(!a.centroidSource_rr.at(i).isApprox(b.centroidSource_rr.at(i), 0.0001f)) {
156 return false;
157 }
158 }
159 } else {
160 return false;
161 }
162
163 if(a.clusterVertnos.size() == b.clusterVertnos.size()) {
164 for(int i = 0; i < a.clusterVertnos.size(); ++i) {
165 if(!a.clusterVertnos.at(i).isApprox(b.clusterVertnos.at(i))) {
166 return false;
167 }
168 }
169 } else {
170 return false;
171 }
172
173 if(a.clusterSource_rr.size() == b.clusterSource_rr.size()) {
174 for(int i = 0; i < a.clusterSource_rr.size(); ++i) {
175 if(!a.clusterSource_rr.at(i).isApprox(b.clusterSource_rr.at(i), 0.0001f)) {
176 return false;
177 }
178 }
179 } else {
180 return false;
181 }
182
183 if(a.clusterDistances.size() == b.clusterDistances.size()) {
184 for(int i = 0; i < a.clusterDistances.size(); ++i) {
185 if(!a.clusterDistances.at(i).isApprox(b.clusterDistances.at(i))) {
186 return false;
187 }
188 }
189 } else {
190 return false;
191 }
192
193 return (a.clusterLabelNames == b.clusterLabelNames &&
196}
197} // NAMESPACE
198
199#endif // MNE_CLUSTER_INFO_H
mne library export/import macros.
#define MNESHARED_EXPORT
Definition mne_global.h:56
cluster information
QList< Eigen::VectorXd > clusterDistances
QList< QString > clusterLabelNames
QList< qint32 > clusterLabelIds
QList< Eigen::MatrixX3f > clusterSource_rr
QList< Eigen::VectorXi > clusterVertnos
QSharedPointer< const MNEClusterInfo > ConstSPtr
QSharedPointer< MNEClusterInfo > SPtr
QList< qint32 > centroidVertno
QList< Eigen::Vector3f > centroidSource_rr