v2.0.0
Loading...
Searching...
No Matches
mne_proj_item.cpp
Go to the documentation of this file.
1//=============================================================================================================
16
17//=============================================================================================================
18// INCLUDES
19//=============================================================================================================
20
21#include "mne_proj_item.h"
22#include "mne_named_matrix.h"
23#include "mne_types.h"
24
25//=============================================================================================================
26// USED NAMESPACES
27//=============================================================================================================
28
29using namespace MNELIB;
30
31//=============================================================================================================
32// DEFINE MEMBER METHODS
33//=============================================================================================================
34
36: nvec(0)
38, active(true)
39, active_file(false)
40, has_meg(false)
41, has_eeg(false)
42{
43}
44
45//=============================================================================================================
46
48: vecs(other.vecs ? std::make_unique<MNENamedMatrix>(*other.vecs) : nullptr)
49, nvec(other.nvec)
50, desc(other.desc)
51, kind(other.kind)
52, active(other.active)
54, has_meg(other.has_meg)
55, has_eeg(other.has_eeg)
56{
57}
58
59//=============================================================================================================
60
62{
63 if (this != &other) {
64 vecs = other.vecs ? std::make_unique<MNENamedMatrix>(*other.vecs) : nullptr;
65 nvec = other.nvec;
66 desc = other.desc;
67 kind = other.kind;
68 active = other.active;
70 has_meg = other.has_meg;
71 has_eeg = other.has_eeg;
72 }
73 return *this;
74}
75
76//=============================================================================================================
77
81
82//=============================================================================================================
83
84int MNEProjItem::affect(const QStringList& list, int nlist) const
85{
86 if (nvec == 0 || !vecs)
87 return false;
88
89 for (int k = 0; k < nlist; ++k) {
90 for (int p = 0; p < vecs->ncol; ++p) {
91 if (QString::compare(vecs->collist[p], list[k]) == 0) {
92 for (int q = 0; q < vecs->nrow; ++q) {
93 if (vecs->data(q, p) != 0.0f)
94 return true;
95 }
96 }
97 }
98 }
99 return false;
100}
Single SSP projection vector with kind/active flag and channel labels.
Row/column-labelled dense matrix used wherever FIFF stores per-channel data.
Legacy MNE-C constants and shared typedefs used across MNELIB structures.
#define FIFFV_PROJ_ITEM_NONE
Definition fiff_file.h:815
Core MNE data structures (source spaces, source estimates, hemispheres).
A dense matrix with named rows and columns.
std::unique_ptr< MNENamedMatrix > vecs
int affect(const QStringList &list, int nlist) const
Test whether this projection item affects any of the listed channels.
MNEProjItem()
Default constructor.
~MNEProjItem()
Destructor.
MNEProjItem & operator=(const MNEProjItem &other)
Copy assignment operator.