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