v2.0.0
Loading...
Searching...
No Matches
mne_cluster_info.h
Go to the documentation of this file.
1//=============================================================================================================
22
23#ifndef MNE_CLUSTER_INFO_H
24#define MNE_CLUSTER_INFO_H
25
26//=============================================================================================================
27// INCLUDES
28//=============================================================================================================
29
30#include "mne_global.h"
31
32//=============================================================================================================
33// EIGEN INCLUDES
34//=============================================================================================================
35
36#include <Eigen/Core>
37
38//=============================================================================================================
39// QT INCLUDES
40//=============================================================================================================
41
42#include <QSharedPointer>
43#include <QList>
44
45//=============================================================================================================
46// DEFINE NAMESPACE MNELIB
47//=============================================================================================================
48
49namespace MNELIB
50{
51
52//=============================================================================================================
60{
61public:
62 typedef QSharedPointer<MNEClusterInfo> SPtr;
63 typedef QSharedPointer<const MNEClusterInfo> ConstSPtr;
64
65 //=========================================================================================================
70
71 //=========================================================================================================
75 void clear();
76
77 //=========================================================================================================
83 inline bool isEmpty() const;
84
85 //=========================================================================================================
91 inline qint32 numClust() const;
92
93 //=========================================================================================================
99 void write(QString p_sFileName) const;
100
108 friend bool operator== (const MNEClusterInfo &a, const MNEClusterInfo &b);
109
110public:
111 QList<QString> clusterLabelNames;
112 QList<qint32> clusterLabelIds;
113 QList<qint32> centroidVertno;
114 QList<Eigen::Vector3f> centroidSource_rr;
115 QList<Eigen::VectorXi> clusterVertnos;
116 QList<Eigen::MatrixX3f> clusterSource_rr;
117 QList<Eigen::VectorXd> clusterDistances;
118};
119
120//=============================================================================================================
121// INLINE DEFINITIONS
122//=============================================================================================================
123
124inline bool MNEClusterInfo::isEmpty() const
125{
126 return !(this->clusterVertnos.size() > 0);
127}
128
129//=============================================================================================================
130
131inline qint32 MNEClusterInfo::numClust() const
132{
133 return this->clusterVertnos.size();
134}
135
136//=============================================================================================================
137
138inline bool operator== (const MNEClusterInfo &a, const MNEClusterInfo &b)
139{
140 if(a.centroidSource_rr.size() == b.centroidSource_rr.size()) {
141 for(int i = 0; i < a.centroidSource_rr.size(); ++i) {
142 if(!a.centroidSource_rr.at(i).isApprox(b.centroidSource_rr.at(i), 0.0001f)) {
143 return false;
144 }
145 }
146 } else {
147 return false;
148 }
149
150 if(a.clusterVertnos.size() == b.clusterVertnos.size()) {
151 for(int i = 0; i < a.clusterVertnos.size(); ++i) {
152 if(!a.clusterVertnos.at(i).isApprox(b.clusterVertnos.at(i))) {
153 return false;
154 }
155 }
156 } else {
157 return false;
158 }
159
160 if(a.clusterSource_rr.size() == b.clusterSource_rr.size()) {
161 for(int i = 0; i < a.clusterSource_rr.size(); ++i) {
162 if(!a.clusterSource_rr.at(i).isApprox(b.clusterSource_rr.at(i), 0.0001f)) {
163 return false;
164 }
165 }
166 } else {
167 return false;
168 }
169
170 if(a.clusterDistances.size() == b.clusterDistances.size()) {
171 for(int i = 0; i < a.clusterDistances.size(); ++i) {
172 if(!a.clusterDistances.at(i).isApprox(b.clusterDistances.at(i))) {
173 return false;
174 }
175 }
176 } else {
177 return false;
178 }
179
180 return (a.clusterLabelNames == b.clusterLabelNames &&
183}
184} // NAMESPACE
185
186#endif // MNE_CLUSTER_INFO_H
bool operator==(const BIDSPath &a, const BIDSPath &b)
MNELIB shared-library export/import macros and library build metadata.
#define MNESHARED_EXPORT
Definition mne_global.h:40
Core MNE data structures (source spaces, source estimates, hemispheres).
bool operator==(const MNEClusterInfo &a, const MNEClusterInfo &b)
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
void write(QString p_sFileName) const
QList< qint32 > centroidVertno
QList< Eigen::Vector3f > centroidSource_rr