OpenWalnut  1.5.0dev
WEEGSourceCalculator.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 WEEGSOURCECALCULATOR_H
26 #define WEEGSOURCECALCULATOR_H
27 
28 #include <cstddef>
29 #include <memory>
30 #include <vector>
31 
32 
33 #include "WEEGEvent.h"
34 #include "core/common/math/linearAlgebra/WPosition.h"
35 #include "core/dataHandler/WEEG2.h"
36 
37 
38 /**
39  * Class which calculates a source position from an EEG recording at a given
40  * time position
41  */
43 {
44 public:
45  /**
46  * Constructor
47  *
48  * \param eeg pointer to the EEG dataset
49  */
50  explicit WEEGSourceCalculator( const std::shared_ptr< const WEEG2 > eeg );
51 
52  /**
53  * Does the calculation
54  *
55  * \param event an event marking a time position
56  * \return the calculated position
57  */
58  WPosition calculate( const std::shared_ptr< const WEEGEvent > event ) const;
59 
60 protected:
61 private:
62  /**
63  * pointer to the EEG dataset
64  */
65  const std::shared_ptr< const WEEG2 > m_eeg;
66 
67  /**
68  * vector which saves for each channel whether there exists a position in
69  * the EEG dataset or not
70  */
71  std::vector< bool > m_hasPosition;
72 
73  /**
74  * how many channels with positions exist in the EEG dataset
75  */
76  std::size_t m_numPositions;
77 };
78 
79 #endif // WEEGSOURCECALCULATOR_H
Class which calculates a source position from an EEG recording at a given time position.
const std::shared_ptr< const WEEG2 > m_eeg
pointer to the EEG dataset
std::vector< bool > m_hasPosition
vector which saves for each channel whether there exists a position in the EEG dataset or not
std::size_t m_numPositions
how many channels with positions exist in the EEG dataset
WEEGSourceCalculator(const std::shared_ptr< const WEEG2 > eeg)
Constructor.
WPosition calculate(const std::shared_ptr< const WEEGEvent > event) const
Does the calculation.
This only is a 3d double vector.