WEEG.h 4.09 KB
 wiebel committed Aug 31, 2009 1 2 ``````//--------------------------------------------------------------------------- // `````` Alexander Wiebel committed Sep 17, 2009 3 ``````// Project: OpenWalnut ( http://www.openwalnut.org ) `````` wiebel committed Aug 31, 2009 4 ``````// `````` Alexander Wiebel committed Sep 17, 2009 5 6 ``````// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS // For more information see http://www.openwalnut.org/copying `````` wiebel committed Aug 31, 2009 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ``````// // This file is part of OpenWalnut. // // OpenWalnut is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // OpenWalnut is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with OpenWalnut. If not, see . // //--------------------------------------------------------------------------- #ifndef WEEG_H #define WEEG_H #include #include #include #include "WRecording.h" `````` Alexander Wiebel committed Sep 10, 2009 34 `````` `````` wiebel committed Aug 31, 2009 35 ``````///====================================== `````` Alexander Wiebel committed Sep 16, 2009 36 ``````// TODO(wiebel): use this szuff or remove it `````` wiebel committed Aug 31, 2009 37 ``````#include "../math/WPosition.h" `````` Alexander Wiebel committed Sep 25, 2009 38 ``````typedef double WDummyType; `````` wiebel committed Aug 31, 2009 39 40 41 42 43 44 ``````class WEEGElectrodeObject { public: protected: private: wmath::WPosition m_position; `````` Alexander Wiebel committed Sep 23, 2009 45 46 47 `````` // TODO(wiebel): The following is suggested in the // eemagine design document // WColor color; `````` wiebel committed Aug 31, 2009 48 49 50 51 52 53 ``````}; class WEEGSegementInfo { public: protected: private: `````` Alexander Wiebel committed Sep 25, 2009 54 55 56 `````` WDummyType m_startSample; WDummyType m_endSample; WDummyType m_segmentStartDate; `````` wiebel committed Aug 31, 2009 57 58 59 ``````}; //================================================ `````` Alexander Wiebel committed Sep 10, 2009 60 61 62 63 64 65 ``````typedef std::vector< double > WEEGElectrode; typedef std::vector< WEEGElectrode > WEEGSegment; typedef std::vector< WEEGSegment > WEEGSegmentArray; typedef std::vector< WEEGElectrodeObject > WEEGElectrodeLibrary; typedef std::vector< std::pair< std::string, std::string > > WEEGChannelLabels; `````` wiebel committed Aug 31, 2009 66 ``````/** `````` wiebel committed Sep 01, 2009 67 68 `````` * Contains EEG recording data. * \ingroup dataHandler `````` wiebel committed Aug 31, 2009 69 70 71 72 `````` */ class WEEG : public WRecording { public: `````` Alexander Wiebel committed Sep 10, 2009 73 `````` `````` wiebel committed Aug 31, 2009 74 75 76 77 `````` /** * TODO(wiebel): Document this! */ `````` Alexander Wiebel committed Sep 16, 2009 78 `````` explicit WEEG( const WEEGSegmentArray& data, `````` Alexander Wiebel committed Sep 10, 2009 79 80 `````` const WEEGElectrodeLibrary& electrodeLib, const WEEGChannelLabels& channelLabels ); `````` wiebel committed Aug 31, 2009 81 `````` `````` wiebel committed Sep 02, 2009 82 83 84 `````` /** * Access operator for single samples. */ `````` wiebel committed Aug 31, 2009 85 86 87 88 89 `````` const double& operator()( size_t segment, size_t signal, size_t sample ) const { return m_segments[segment][signal][sample]; } `````` Alexander Wiebel committed Sep 09, 2009 90 91 92 `````` /** * Returns number of samples of a given segment. */ `````` Alexander Wiebel committed Sep 10, 2009 93 `````` size_t getNumberOfSamples( size_t segmentId ) const `````` Alexander Wiebel committed Sep 09, 2009 94 95 96 97 98 99 100 `````` { return m_segments[segmentId][0].size(); } /** * Return the number of channels this EEG has. */ `````` Alexander Wiebel committed Sep 10, 2009 101 `````` size_t getNumberOfChannels() const `````` Alexander Wiebel committed Sep 09, 2009 102 103 104 105 106 107 108 `````` { return m_segments[0].size(); } /** * Return the number of segments this EEG consists of. */ `````` Alexander Wiebel committed Sep 10, 2009 109 `````` size_t getNumberOfSegments() const `````` Alexander Wiebel committed Sep 09, 2009 110 111 112 113 `````` { return m_segments.size(); } `````` Alexander Wiebel committed Sep 10, 2009 114 115 116 117 118 `````` /** * Return the label of a certain channel. */ std::string getChannelLabel( size_t channelId ) const { `````` Alexander Wiebel committed Sep 23, 2009 119 `````` // TODO(wiebel): what is done with the second string of the label? `````` Alexander Wiebel committed Sep 10, 2009 120 121 122 `````` return m_channelLabels[channelId].first; } `````` wiebel committed Aug 31, 2009 123 124 125 126 127 128 129 130 131 132 133 134 135 136 ``````protected: private: /** * We have only on sampling rate for all channels. */ double m_samplingRate; /** * Information about segments. An array of WEEGSegmentInfo objects. */ std::vector< WEEGSegementInfo > m_segmentInfo; /** * Description of electrodes */ std::map< std::string, size_t > m_electrodeDescriptions; `````` Alexander Wiebel committed Sep 10, 2009 137 138 139 140 141 `````` /** * Information about the electrodes. */ WEEGElectrodeLibrary m_electrodeLibrary; `````` wiebel committed Aug 31, 2009 142 143 144 `````` /** * Contains the EEG data as an arry of segements `````` wiebel committed Sep 02, 2009 145 `````` * of data which consist of an array of electrodes `````` wiebel committed Aug 31, 2009 146 147 148 `````` * which again consist of an array of samples over time. */ WEEGSegmentArray m_segments; `````` Alexander Wiebel committed Sep 10, 2009 149 150 151 152 153 154 155 156 157 158 `````` /** * Label for each channel. */ WEEGChannelLabels m_channelLabels; /** * Is the channel enabled? */ std::vector< bool > m_channelEnabled; `````` wiebel committed Aug 31, 2009 159 160 161 162 ``````}; #endif // WEEG_H``````