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
70class MNEHemisphere;
71
72//=============================================================================================================
79{
80public:
81 using SPtr = std::shared_ptr<MNESourceSpace>;
82 using ConstSPtr = std::shared_ptr<const MNESourceSpace>;
83 using UPtr = std::unique_ptr<MNESourceSpace>;
84
85 //=========================================================================================================
89 MNESourceSpace(int np = 0);
90
91 //=========================================================================================================
95 ~MNESourceSpace() override;
96
97 //=========================================================================================================
103 virtual MNESourceSpace::SPtr clone() const;
104
105 //=========================================================================================================
109 void enable_all_sources();
110
111 //=========================================================================================================
118 bool is_left_hemi() const;
119
120 //=========================================================================================================
127 qint32 find_source_space_hemi() const;
128
129 //=========================================================================================================
135 void update_inuse(Eigen::VectorXi new_inuse);
136
137 //=========================================================================================================
145
146 //=========================================================================================================
152 int add_patch_stats();
153
154 //=========================================================================================================
160
161 //=========================================================================================================
169 static std::unique_ptr<MNESourceSpace> create_source_space(int np);
170
171 //=========================================================================================================
179 static std::unique_ptr<MNESourceSpace> load_surface(const QString& surf_file,
180 const QString& curv_file);
181
182 //=========================================================================================================
192 static std::unique_ptr<MNESourceSpace> load_surface_geom(const QString& surf_file,
193 const QString& curv_file,
194 bool add_geometry,
195 bool check_too_many_neighbors);
196
197 //=========================================================================================================
212 float grid,
213 float exclude,
214 float mindist);
215
216 //=========================================================================================================
217 // Source-space filtering, I/O, and label helpers (moved from MNESurfaceOrVolume)
218 //=========================================================================================================
219
220 static int filter_source_spaces(const MNESurface& surf,
221 float limit,
222 const FIFFLIB::FiffCoordTrans& mri_head_t,
223 std::vector<std::unique_ptr<MNESourceSpace>>& spaces,
224 QTextStream *filtered);
225
226 static void filter_source_space(FilterThreadArg *arg);
227
228 static int filter_source_spaces(float limit,
229 const QString& bemfile,
230 const FIFFLIB::FiffCoordTrans& mri_head_t,
231 std::vector<std::unique_ptr<MNESourceSpace>>& spaces,
232 QTextStream *filtered,
233 bool use_threads);
234
235 static int read_source_spaces(const QString& name,
236 std::vector<std::unique_ptr<MNESourceSpace>>& spaces);
237
240 std::vector<std::unique_ptr<MNESourceSpace>>& spaces);
241
242 static int restrict_sources_to_labels(std::vector<std::unique_ptr<MNESourceSpace>>& spaces,
243 const QStringList& labels,
244 int nlabel);
245
246 static int read_label(const QString& label,
247 Eigen::VectorXi& sel);
248
249 //=========================================================================================================
258 int writeToStream(FIFFLIB::FiffStream::SPtr& stream, bool selected_only) const;
259
260 //=========================================================================================================
275 static MNEHemisphere icoDownsample(const MNEHemisphere& hemi, int icoGrade);
276
277private:
286 int writeVolumeInfo(FIFFLIB::FiffStream::SPtr& stream, bool selected_only) const;
287};
288
289//=============================================================================================================
290// INLINE DEFINITIONS
291//=============================================================================================================
292} // NAMESPACE MNELIB
293
294#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,...
Hemisphere provides geometry information.
virtual MNESourceSpace::SPtr clone() const
std::unique_ptr< MNESourceSpace > UPtr
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 std::unique_ptr< MNESourceSpace > load_surface_geom(const QString &surf_file, const QString &curv_file, bool add_geometry, bool check_too_many_neighbors)
static MNEHemisphere icoDownsample(const MNEHemisphere &hemi, int icoGrade)
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.