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