OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
WPagerEEG.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 WPAGEREEG_H
26 #define WPAGEREEG_H
27 
28 #include <cstddef>
29 
30 #include <string>
31 
32 #include <boost/shared_ptr.hpp>
33 
34 #include "../WEEGValueMatrix.h"
35 #include "../WExportDataHandler.h"
36 
37 
38 /**
39  * Abstract class to load an EEG file and keep it open to support paging.
40  * \ingroup dataHandler
41  */
43 {
44 public:
45  /**
46  * Virtual destructor
47  */
48  virtual ~WPagerEEG();
49 
50  /**
51  * Get the name of the loaded file.
52  *
53  * \return name of file
54  */
55  std::string getFileName() const;
56 
57  /**
58  * Get the number of segments this EEG consists of.
59  *
60  * \return number of segments
61  */
62  virtual std::size_t getNumberOfSegments() const = 0;
63 
64  /**
65  * Get the number of channels this EEG has.
66  *
67  * \return number of channels
68  */
69  virtual std::size_t getNumberOfChannels() const = 0;
70 
71  /**
72  * Get the number of samples of a given segment.
73  *
74  * \param segmentID segment number being inspected
75  * \return number of samples
76  */
77  virtual std::size_t getNumberOfSamples( std::size_t segmentID ) const = 0;
78 
79  /**
80  * Get the values of all channels for a given sample range.
81  *
82  * \param segmentID segment number to read the values from
83  * \param start start sample of the sample range
84  * \param length length of the sample range
85  * \return matrix of values
86  */
87  virtual boost::shared_ptr< WEEGValueMatrix > getValues( std::size_t segmentID, std::size_t start, std::size_t length ) const = 0;
88 
89  /**
90  * Get the sampling rate used by the recording.
91  *
92  * \return sampling rate
93  */
94  virtual double getSamplingRate() const = 0;
95 
96  /**
97  * Get the unit used by the recording of a given channel.
98  *
99  * \param channelID channel number
100  * \return unit as string
101  */
102  virtual std::string getChannelUnit( std::size_t channelID ) const = 0;
103 
104  /**
105  * Get the label of a given channel.
106  *
107  * \param channelID channel number
108  * \return label as string
109  */
110  virtual std::string getChannelLabel( std::size_t channelID ) const = 0;
111 
112 protected:
113  /**
114  * Constructor
115  *
116  * \param fileName path and filename to the file to load
117  */
118  explicit WPagerEEG( std::string fileName );
119 
120  std::string m_fileName; //!< name of the loaded file
121 
122 private:
123 };
124 
125 #endif // WPAGEREEG_H