~ubuntu-branches/ubuntu/precise/openwalnut/precise

« back to all changes in this revision

Viewing changes to src/modules/data/io/WReaderBiosig.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Eichelbaum
  • Date: 2011-06-21 10:26:54 UTC
  • Revision ID: james.westby@ubuntu.com-20110621102654-rq0zf436q949biih
Tags: upstream-1.2.5
ImportĀ upstreamĀ versionĀ 1.2.5

Show diffs side-by-side

added added

removed removed

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