OpenWalnut  1.4.0
WEEG2.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WEEG2_H
26 #define WEEG2_H
27 
28 #include <cstddef>
29 
30 #include <string>
31 #include <vector>
32 
33 #include <boost/shared_ptr.hpp>
34 
35 #include "io/WPagerEEG.h"
36 #include "WEEGChannelInfo.h"
37 #include "WEEGPositionsLibrary.h"
38 #include "WEEG2Segment.h"
39 #include "WRecording.h"
40 
41 
42 
43 /**
44  * Class which contains EEG recording data, read from a WPagerEEG.
45  * \ingroup dataHandler
46  */
47 class WEEG2 : public WRecording // NOLINT
48 {
49 public:
50  /**
51  * Constructor
52  *
53  * \param pager pager class which contains the data, read from a file on
54  * demand
55  * \param positionsLibrary class which contains the positions of the
56  * electrodes
57  */
58  WEEG2( boost::shared_ptr< WPagerEEG > pager, boost::shared_ptr< WEEGPositionsLibrary > positionsLibrary );
59 
60  /**
61  * Constructor creating a quite unusable instance. Useful for prototype
62  * mechanism.
63  */
64  WEEG2();
65 
66  /**
67  * Get the number of segments this EEG consists of.
68  *
69  * \return number of segments
70  */
71  std::size_t getNumberOfSegments() const;
72 
73  /**
74  * Get the number of channels this EEG has.
75  *
76  * \return number of channels
77  */
78  std::size_t getNumberOfChannels() const;
79 
80  /**
81  * Get the sampling rate used by the recording.
82  *
83  * \return sampling rate
84  */
85  double getSamplingRate() const;
86 
87  /**
88  * Get one segment.
89  *
90  * \param segmentID number of segment
91  * \return segment
92  */
93  boost::shared_ptr< WEEG2Segment > getSegment( std::size_t segmentID ) const;
94 
95  /**
96  * Get one channel info object.
97  *
98  * \param channelID number of channel
99  * \return object containing information about the channel
100  */
101  boost::shared_ptr< WEEGChannelInfo > getChannelInfo( std::size_t channelID ) const;
102 
103  /**
104  * Return the name of the dataset
105  *
106  * \return the name
107  */
108  virtual const std::string getName() const;
109 
110  /**
111  * Description of dataset.
112  *
113  * \return description of dataset
114  */
115  virtual const std::string getDescription() const;
116 
117  /**
118  * Get dataset prototype.
119  *
120  * \return the prototype
121  */
122  static boost::shared_ptr< WPrototyped > getPrototype();
123 
124 protected:
125  /**
126  * Prototype needed to allow the EEG dataset to be transferred.
127  */
128  static boost::shared_ptr< WPrototyped > m_prototype;
129 
130 private:
131  double m_samplingRate; //!< sampling rate used by the recording
132 
133  std::vector< boost::shared_ptr< WEEG2Segment > > m_segments; //!< list of all segments this EEG consists of
134 
135  std::vector< boost::shared_ptr< WEEGChannelInfo > > m_channelInfos; //!< list of the information about all channel infos this EEG has
136 };
137 
138 #endif // WEEG2_H