OpenWalnut  1.5.0dev
WPagerEEGLibeep.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 WPAGEREEGLIBEEP_H
26 #define WPAGEREEGLIBEEP_H
27 
28 #ifdef WEEP_ENABLED
29 
30 #include <cstddef>
31 #include <memory>
32 #include <string>
33 #include <vector>
34 
35 
36 #include "core/dataHandler/WEEGValueMatrix.h"
37 #include "core/dataHandler/io/WPagerEEG.h"
38 
39 typedef struct eeg_dummy_t eeg_t;
40 
41 /**
42  * Class to load an EEG file and keep it open to support paging.
43  * Uses the libeep library to read the CNT format.
44  * \ingroup dataHandler
45  */
46 class WPagerEEGLibeep : public WPagerEEG // NOLINT
47 {
48 public:
49  /**
50  * Constructor
51  *
52  * \param fileName path and filename to a CNT file
53  */
54  explicit WPagerEEGLibeep( std::string fileName );
55 
56  /**
57  * Virtual destructor
58  */
59  virtual ~WPagerEEGLibeep();
60 
61  virtual std::size_t getNumberOfSegments() const;
62 
63  virtual std::size_t getNumberOfChannels() const;
64 
65  virtual std::size_t getNumberOfSamples( std::size_t segmentID ) const;
66 
67  virtual std::shared_ptr< WEEGValueMatrix > getValues( std::size_t segmentID, std::size_t start, std::size_t length ) const;
68 
69  virtual double getSamplingRate() const;
70 
71  virtual std::string getChannelUnit( std::size_t channelID ) const;
72 
73  virtual std::string getChannelLabel( std::size_t channelID ) const;
74 
75 protected:
76 private:
77  eeg_t* m_eeg; //!< handler for the cnt file opened by libeep
78 
79  std::size_t m_nbChannels; //!< number of channels
80  std::size_t m_nbSamples; //!< number of samples
81 
82  std::vector< double > m_scales; //!< scale factors of the channels
83 };
84 
85 #endif // WEEP_ENABLED
86 
87 #endif // WPAGEREEGLIBEEP_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.
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.
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.