OpenWalnut  1.4.0
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 #ifndef Q_MOC_RUN
33 #include <boost/shared_ptr.hpp>
34 #endif
35 
36 #include "../WEEGValueMatrix.h"
37 #include "../../common/WDefines.h"
38 
39 /**
40  * Abstract class to load an EEG file and keep it open to support paging.
41  * \ingroup dataHandler
42  */
43 class WPagerEEG // NOLINT
44 {
45 public:
46  /**
47  * Virtual destructor
48  */
49  virtual ~WPagerEEG();
50 
51  /**
52  * Get the name of the loaded file.
53  *
54  * \return name of file
55  */
56  std::string getFilename() const;
57 
58  /**
59  * Get the name of the loaded file.
60  *
61  * \return name of file
62  * \deprecated use getFilename instead
63  */
64  OW_API_DEPRECATED std::string getFileName() const;
65 
66  /**
67  * Get the number of segments this EEG consists of.
68  *
69  * \return number of segments
70  */
71  virtual std::size_t getNumberOfSegments() const = 0;
72 
73  /**
74  * Get the number of channels this EEG has.
75  *
76  * \return number of channels
77  */
78  virtual std::size_t getNumberOfChannels() const = 0;
79 
80  /**
81  * Get the number of samples of a given segment.
82  *
83  * \param segmentID segment number being inspected
84  * \return number of samples
85  */
86  virtual std::size_t getNumberOfSamples( std::size_t segmentID ) const = 0;
87 
88  /**
89  * Get the values of all channels for a given sample range.
90  *
91  * \param segmentID segment number to read the values from
92  * \param start start sample of the sample range
93  * \param length length of the sample range
94  * \return matrix of values
95  */
96  virtual boost::shared_ptr< WEEGValueMatrix > getValues( std::size_t segmentID, std::size_t start, std::size_t length ) const = 0;
97 
98  /**
99  * Get the sampling rate used by the recording.
100  *
101  * \return sampling rate
102  */
103  virtual double getSamplingRate() const = 0;
104 
105  /**
106  * Get the unit used by the recording of a given channel.
107  *
108  * \param channelID channel number
109  * \return unit as string
110  */
111  virtual std::string getChannelUnit( std::size_t channelID ) const = 0;
112 
113  /**
114  * Get the label of a given channel.
115  *
116  * \param channelID channel number
117  * \return label as string
118  */
119  virtual std::string getChannelLabel( std::size_t channelID ) const = 0;
120 
121 protected:
122  /**
123  * Constructor
124  *
125  * \param filename path and filename to the file to load
126  */
127  explicit WPagerEEG( std::string filename );
128 private:
129  std::string m_filename; //!< name of the loaded file
130 };
131 
132 #endif // WPAGEREEG_H
std::string getFilename() const
Get the name of the loaded file.
Definition: WPagerEEG.cpp:41
virtual std::size_t getNumberOfChannels() const =0
Get the number of channels this EEG has.
virtual ~WPagerEEG()
Virtual destructor.
Definition: WPagerEEG.cpp:32
virtual std::size_t getNumberOfSegments() const =0
Get the number of segments this EEG consists of.
virtual boost::shared_ptr< WEEGValueMatrix > getValues(std::size_t segmentID, std::size_t start, std::size_t length) const =0
Get the values of all channels for a given sample range.
Abstract class to load an EEG file and keep it open to support paging.
Definition: WPagerEEG.h:43
#define OW_API_DEPRECATED
In order to mark functions for the compiler as deprecated we need to put this before each deprecated ...
Definition: WDefines.h:44
std::string m_filename
name of the loaded file
Definition: WPagerEEG.h:129
virtual std::string getChannelLabel(std::size_t channelID) const =0
Get the label of a given channel.
virtual std::string getChannelUnit(std::size_t channelID) const =0
Get the unit used by the recording of a given channel.
virtual std::size_t getNumberOfSamples(std::size_t segmentID) const =0
Get the number of samples of a given segment.
virtual double getSamplingRate() const =0
Get the sampling rate used by the recording.
OW_API_DEPRECATED std::string getFileName() const
Get the name of the loaded file.
Definition: WPagerEEG.cpp:36
WPagerEEG(std::string filename)
Constructor.
Definition: WPagerEEG.cpp:46