00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef WEEG_H
00026 #define WEEG_H
00027
00028 #include <map>
00029 #include <string>
00030 #include <vector>
00031 #include "WRecording.h"
00032 #include "../common/WPrototyped.h"
00033 #include "../common/math/linearAlgebra/WLinearAlgebra.h"
00034 #include "WExportDataHandler.h"
00035
00036
00037
00038
00039 class OWDATAHANDLER_EXPORT WEEGElectrodeObject
00040 {
00041 public:
00042
00043
00044
00045
00046 explicit WEEGElectrodeObject( WPosition position );
00047
00048
00049
00050
00051
00052 WPosition getPosition() const;
00053 protected:
00054 private:
00055 WPosition m_position;
00056 };
00057
00058 typedef std::vector< double > WEEGElectrode;
00059 typedef std::vector< WEEGElectrode > WEEGSegment;
00060 typedef std::vector< WEEGSegment > WEEGSegmentArray;
00061
00062 typedef std::vector< WEEGElectrodeObject > WEEGElectrodeLibrary;
00063 typedef std::vector< std::pair< std::string, std::string > > WEEGChannelLabels;
00064
00065
00066
00067
00068 class OWDATAHANDLER_EXPORT WEEG : public WRecording
00069 {
00070 public:
00071
00072
00073
00074
00075
00076
00077
00078
00079 explicit WEEG( const WEEGSegmentArray& data,
00080 const WEEGElectrodeLibrary& electrodeLib,
00081 const WEEGChannelLabels& channelLabels );
00082
00083
00084
00085
00086 WEEG();
00087
00088
00089
00090
00091
00092
00093
00094
00095 const double& operator()( size_t segment, size_t signal, size_t sample ) const;
00096
00097
00098
00099
00100
00101
00102 size_t getNumberOfSamples( size_t segmentId ) const;
00103
00104
00105
00106
00107
00108 size_t getNumberOfChannels() const;
00109
00110
00111
00112
00113
00114 size_t getNumberOfSegments() const;
00115
00116
00117
00118
00119
00120
00121 std::string getChannelLabel( size_t channelId ) const;
00122
00123
00124
00125
00126
00127
00128 WPosition getChannelPosition( size_t channelId ) const;
00129
00130
00131
00132
00133
00134
00135 virtual bool isTexture() const;
00136
00137
00138
00139
00140
00141
00142 virtual const std::string getName() const;
00143
00144
00145
00146
00147
00148
00149 virtual const std::string getDescription() const;
00150
00151
00152
00153
00154
00155
00156 static boost::shared_ptr< WPrototyped > getPrototype();
00157
00158 protected:
00159
00160
00161
00162
00163 static boost::shared_ptr< WPrototyped > m_prototype;
00164
00165 private:
00166
00167
00168
00169 double m_samplingRate;
00170
00171
00172
00173 std::map< std::string, size_t > m_electrodeDescriptions;
00174
00175
00176
00177
00178 WEEGElectrodeLibrary m_electrodeLibrary;
00179
00180
00181
00182
00183
00184
00185 WEEGSegmentArray m_segments;
00186
00187
00188
00189
00190 WEEGChannelLabels m_channelLabels;
00191
00192
00193
00194
00195 std::vector< bool > m_channelEnabled;
00196 };
00197
00198 inline const double& WEEG::operator()( size_t segment, size_t signal, size_t sample ) const
00199 {
00200 return m_segments[segment][signal][sample];
00201 }
00202
00203 inline size_t WEEG::getNumberOfSamples( size_t segmentId ) const
00204 {
00205 return m_segments[segmentId][0].size();
00206 }
00207
00208 inline size_t WEEG::getNumberOfChannels() const
00209 {
00210 return m_segments[0].size();
00211 }
00212
00213 inline size_t WEEG::getNumberOfSegments() const
00214 {
00215 return m_segments.size();
00216 }
00217
00218 inline std::string WEEG::getChannelLabel( size_t channelId ) const
00219 {
00220
00221 return m_channelLabels[channelId].first;
00222 }
00223
00224 inline WPosition WEEG::getChannelPosition( size_t channelId ) const
00225 {
00226 return m_electrodeLibrary[channelId].getPosition();
00227 }
00228
00229 #endif // WEEG_H