v2.0.0
Loading...
Searching...
No Matches
mne_source_space.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef MNESOURCESPACE_H
38#define MNESOURCESPACE_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "mne_global.h"
46
47//=============================================================================================================
48// EIGEN INCLUDES
49//=============================================================================================================
50
51#include <Eigen/Core>
52
53//=============================================================================================================
54// STL INCLUDES
55//=============================================================================================================
56
57#include <memory>
58
59//=============================================================================================================
60// DEFINE NAMESPACE MNELIB
61//=============================================================================================================
62
63namespace MNELIB
64{
65
66//=============================================================================================================
67// FORWARD DECLARATIONS
68//=============================================================================================================
69
70//=============================================================================================================
77{
78public:
79 using SPtr = std::shared_ptr<MNESourceSpace>;
80 using ConstSPtr = std::shared_ptr<const MNESourceSpace>;
81 using UPtr = std::unique_ptr<MNESourceSpace>;
82
83 //=========================================================================================================
87 MNESourceSpace(int np = 0);
88
89 //=========================================================================================================
93 ~MNESourceSpace() override;
94
95 //=========================================================================================================
101 virtual MNESourceSpace::SPtr clone() const;
102
103 //=========================================================================================================
107 void enable_all_sources();
108
109 //=========================================================================================================
116 int is_left_hemi() const;
117
118 //=========================================================================================================
125 qint32 find_source_space_hemi() const;
126
127 //=========================================================================================================
133 void update_inuse(Eigen::VectorXi new_inuse);
134
135 //=========================================================================================================
143
144 //=========================================================================================================
150 int add_patch_stats();
151
152 //=========================================================================================================
158
159 //=========================================================================================================
167 static std::unique_ptr<MNESourceSpace> create_source_space(int np);
168
169 //=========================================================================================================
177 static std::unique_ptr<MNESourceSpace> load_surface(const QString& surf_file,
178 const QString& curv_file);
179
180 //=========================================================================================================
190 static std::unique_ptr<MNESourceSpace> load_surface_geom(const QString& surf_file,
191 const QString& curv_file,
192 int add_geometry,
193 int check_too_many_neighbors);
194
195 //=========================================================================================================
210 float grid,
211 float exclude,
212 float mindist);
213
214 //=========================================================================================================
215 // Source-space filtering, I/O, and label helpers (moved from MNESurfaceOrVolume)
216 //=========================================================================================================
217
218 static int filter_source_spaces(const MNESurface& surf,
219 float limit,
220 const FIFFLIB::FiffCoordTrans& mri_head_t,
221 std::vector<std::unique_ptr<MNESourceSpace>>& spaces,
222 QTextStream *filtered);
223
224 static void filter_source_space(FilterThreadArg *arg);
225
226 static int filter_source_spaces(float limit,
227 const QString& bemfile,
228 const FIFFLIB::FiffCoordTrans& mri_head_t,
229 std::vector<std::unique_ptr<MNESourceSpace>>& spaces,
230 QTextStream *filtered,
231 bool use_threads);
232
233 static int read_source_spaces(const QString& name,
234 std::vector<std::unique_ptr<MNESourceSpace>>& spaces);
235
238 std::vector<std::unique_ptr<MNESourceSpace>>& spaces);
239
240 static int restrict_sources_to_labels(std::vector<std::unique_ptr<MNESourceSpace>>& spaces,
241 const QStringList& labels,
242 int nlabel);
243
244 static int read_label(const QString& label,
245 Eigen::VectorXi& sel);
246
247 //=========================================================================================================
256 int writeToStream(FIFFLIB::FiffStream::SPtr& stream, bool selected_only) const;
257
258private:
267 int writeVolumeInfo(FIFFLIB::FiffStream::SPtr& stream, bool selected_only) const;
268};
269
270//=============================================================================================================
271// INLINE DEFINITIONS
272//=============================================================================================================
273} // NAMESPACE MNELIB
274
275#endif // MNESOURCESPACE_H
mne library export/import macros.
#define MNESHARED_EXPORT
Definition mne_global.h:52
MNE FsSurface or Volume (MNESurfaceOrVolume) class declaration.
Core MNE data structures (source spaces, source estimates, hemispheres).
Coordinate transformation description.
QSharedPointer< FiffStream > SPtr
Thread-local arguments for parallel raw data filtering (channel range, filter kernel,...
virtual MNESourceSpace::SPtr clone() const
std::unique_ptr< MNESourceSpace > UPtr
static std::unique_ptr< MNESourceSpace > load_surface_geom(const QString &surf_file, const QString &curv_file, int add_geometry, int check_too_many_neighbors)
static std::unique_ptr< MNESourceSpace > load_surface(const QString &surf_file, const QString &curv_file)
qint32 find_source_space_hemi() const
std::shared_ptr< MNESourceSpace > SPtr
static int restrict_sources_to_labels(std::vector< std::unique_ptr< MNESourceSpace > > &spaces, const QStringList &labels, int nlabel)
static int filter_source_spaces(const MNESurface &surf, float limit, const FIFFLIB::FiffCoordTrans &mri_head_t, std::vector< std::unique_ptr< MNESourceSpace > > &spaces, QTextStream *filtered)
static int read_source_spaces(const QString &name, std::vector< std::unique_ptr< MNESourceSpace > > &spaces)
static std::unique_ptr< MNESourceSpace > create_source_space(int np)
static void filter_source_space(FilterThreadArg *arg)
int writeToStream(FIFFLIB::FiffStream::SPtr &stream, bool selected_only) const
static MNESourceSpace * make_volume_source_space(const MNESurface &surf, float grid, float exclude, float mindist)
std::shared_ptr< const MNESourceSpace > ConstSPtr
int transform_source_space(const FIFFLIB::FiffCoordTrans &t)
static int read_label(const QString &label, Eigen::VectorXi &sel)
static int transform_source_spaces_to(int coord_frame, const FIFFLIB::FiffCoordTrans &t, std::vector< std::unique_ptr< MNESourceSpace > > &spaces)
void update_inuse(Eigen::VectorXi new_inuse)
This defines a surface.
Definition mne_surface.h:79
MNESurfaceOrVolume()
Constructs the MNE FsSurface or Volume.