v2.0.0
Loading...
Searching...
No Matches
mne_proj_item.cpp
Go to the documentation of this file.
1//=============================================================================================================
36
37//=============================================================================================================
38// INCLUDES
39//=============================================================================================================
40
41#include "mne_proj_item.h"
42#include "mne_named_matrix.h"
43#include "mne_types.h"
44
45//=============================================================================================================
46// USED NAMESPACES
47//=============================================================================================================
48
49using namespace MNELIB;
50
51//=============================================================================================================
52// DEFINE MEMBER METHODS
53//=============================================================================================================
54
56: nvec(0)
58, active(true)
59, active_file(false)
60, has_meg(false)
61, has_eeg(false)
62{
63}
64
65//=============================================================================================================
66
68: vecs(other.vecs ? std::make_unique<MNENamedMatrix>(*other.vecs) : nullptr)
69, nvec(other.nvec)
70, desc(other.desc)
71, kind(other.kind)
72, active(other.active)
74, has_meg(other.has_meg)
75, has_eeg(other.has_eeg)
76{
77}
78
79//=============================================================================================================
80
82{
83 if (this != &other) {
84 vecs = other.vecs ? std::make_unique<MNENamedMatrix>(*other.vecs) : nullptr;
85 nvec = other.nvec;
86 desc = other.desc;
87 kind = other.kind;
88 active = other.active;
90 has_meg = other.has_meg;
91 has_eeg = other.has_eeg;
92 }
93 return *this;
94}
95
96//=============================================================================================================
97
101
102//=============================================================================================================
103
104int MNEProjItem::affect(const QStringList& list, int nlist) const
105{
106 if (nvec == 0 || !vecs)
107 return false;
108
109 for (int k = 0; k < nlist; ++k) {
110 for (int p = 0; p < vecs->ncol; ++p) {
111 if (QString::compare(vecs->collist[p], list[k]) == 0) {
112 for (int q = 0; q < vecs->nrow; ++q) {
113 if (vecs->data(q, p) != 0.0f)
114 return true;
115 }
116 }
117 }
118 }
119 return false;
120}
#define FIFFV_PROJ_ITEM_NONE
Definition fiff_file.h:822
MNEProjItem class declaration.
Legacy MNE-C constants and common typedefs.
MNENamedMatrix class declaration.
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.