OpenWalnut  1.4.0
WEEG2Segment.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 WEEG2SEGMENT_H
26 #define WEEG2SEGMENT_H
27 
28 #include <cstddef>
29 
30 #ifndef Q_MOC_RUN
31 #include <boost/shared_ptr.hpp>
32 #endif
33 
34 #include "io/WPagerEEG.h"
35 #include "WEEGValueMatrix.h"
36 
37 
38 
39 /**
40  * Class which contains one segment of an EEG recording, read from a WPagerEEG.
41  * \ingroup dataHandler
42  */
43 class WEEG2Segment // NOLINT
44 {
45 public:
46  /**
47  * Constructor
48  *
49  * \param segmentID number of this segment
50  * \param pager pager class which contains the data, read from a file on
51  * demand
52  */
53  WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG > pager );
54 
55  /**
56  * Get the number of samples this segment consists of.
57  *
58  * \return number of samples
59  */
60  std::size_t getNumberOfSamples() const;
61 
62  /**
63  * Get the values of all channels for a given sample range.
64  *
65  * \param start start sample of the sample range
66  * \param length length of the sample range
67  * \return matrix of values
68  */
69  boost::shared_ptr< WEEGValueMatrix > getValues( std::size_t start, std::size_t length ) const;
70 
71 protected:
72 private:
73  std::size_t m_segmentID; //!< number of this segment
74  boost::shared_ptr< WPagerEEG > m_pager; //!< pager class which contains the data, read from a file on demand
75  std::size_t m_nbSamples; //!< number of samples this segment consists of
76 };
77 
78 #endif // WEEG2SEGMENT_H
std::size_t m_segmentID
number of this segment
Definition: WEEG2Segment.h:73
Class which contains one segment of an EEG recording, read from a WPagerEEG.
Definition: WEEG2Segment.h:43
boost::shared_ptr< WPagerEEG > m_pager
pager class which contains the data, read from a file on demand
Definition: WEEG2Segment.h:74
std::size_t getNumberOfSamples() const
Get the number of samples this segment consists of.
std::size_t m_nbSamples
number of samples this segment consists of
Definition: WEEG2Segment.h:75
boost::shared_ptr< WEEGValueMatrix > getValues(std::size_t start, std::size_t length) const
Get the values of all channels for a given sample range.
WEEG2Segment(std::size_t segmentID, boost::shared_ptr< WPagerEEG > pager)
Constructor.