OpenWalnut  1.5.0dev
WReaderBiosig.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 WREADERBIOSIG_H
26 #define WREADERBIOSIG_H
27 
28 #ifdef WBIOSIG_ENABLED
29 
30 #include <memory>
31 #include <string>
32 #include <vector>
33 
34 #include <biosig.h> // NOLINT: brainlint thinks this is C System Header
35 
36 #include "WReaderEEG.h"
37 
38 /**
39  * Reader for several formats for biological signal.
40  * Uses BiosigC++ 4.
41  * \ingroup dataHandler
42  */
43 class WReaderBiosig : public WReaderEEG
44 {
45 public:
46  /**
47  * Constructs a loader to be executed in its own thread and sets the data needed
48  * for the loader when executed in its own thread.
49  * \param fileName this file will be loaded
50  */
51  explicit WReaderBiosig( std::string fileName );
52 
53  /**
54  * Loads the dataset.
55  *
56  * \return the dataset loaded.
57  */
58  virtual std::shared_ptr< WDataSet > load();
59 
60 protected:
61 private:
62  /**
63  * Fill the data into the segment doing the needed conversions, assuming
64  * column based channels
65  * \param segment the segment to be filled
66  * \param data the data to be filled into the segment
67  */
68  void fillSegmentColumnBased( std::vector<std::vector<double> >* segment, biosig_data_type* data );
69 
70  /**
71  * Fill the data into the segment doing the needed conversions, assuming
72  * row based channels
73  * \param segment the segment to be filled
74  * \param data the data to be filled into the segment
75  */
76  void fillSegmentRowBased( std::vector<std::vector<double> >* segment, biosig_data_type* data );
77 
78  HDRTYPE* hd; //!< Header of file
79  size_t m_columns; //!< columns of the storage in the file
80  size_t m_rows; //!< rows of the storage in the file
81 };
82 
83 #endif // WBIOSIG_ENABLED
84 
85 #endif // WREADERBIOSIG_H
Abstract base class for all Readers who handle with EEG data.
Definition: WReaderEEG.h:39