MNE-CPP  0.1.9
A Framework for Electrophysiology
mne_raw_data.h
Go to the documentation of this file.
1 //=============================================================================================================
37 #ifndef MNERAWDATA_H
38 #define MNERAWDATA_H
39 
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "../mne_global.h"
45 
46 #include <fiff/fiff_dir_node.h>
47 #include <fiff/fiff_stream.h>
48 #include "mne_raw_info.h"
49 #include "mne_raw_buf_def.h"
50 #include "mne_proj_op.h"
51 #include "mne_sss_data.h"
52 #include "mne_ctf_comp_data_set.h"
53 #include "mne_deriv.h"
54 #include "mne_types.h"
55 
56 //=============================================================================================================
57 // EIGEN INCLUDES
58 //=============================================================================================================
59 
60 #include <Eigen/Core>
61 
62 //=============================================================================================================
63 // QT INCLUDES
64 //=============================================================================================================
65 
66 #include <QSharedPointer>
67 #include <QList>
68 
69 //=============================================================================================================
70 // DEFINE NAMESPACE MNELIB
71 //=============================================================================================================
72 
73 namespace MNELIB
74 {
75 
76 //=============================================================================================================
77 // FORWARD DECLARATIONS
78 //=============================================================================================================
79 
80 //=============================================================================================================
87 {
88 public:
89  typedef QSharedPointer<MneRawData> SPtr;
90  typedef QSharedPointer<const MneRawData> ConstSPtr;
92  //=========================================================================================================
97  MneRawData();
98 
99  //=========================================================================================================
104  ~MneRawData();
105 
106  static void mne_raw_add_filter_response(MneRawData* data, int *highpass_effective);
107 
108  static void setup_filter_bufs(MneRawData* data);
109 
110  static int load_one_buffer(MneRawData* data, MneRawBufDef* buf);
111 
112  static int compensate_buffer(MneRawData* data, MneRawBufDef* buf);
113 
114  static int mne_raw_pick_data(MneRawData* data,
115  mneChSelection sel,
116  int firsts,
117  int ns,
118  float **picked);
119 
120  static int mne_raw_pick_data_proj(MneRawData* data,
121  mneChSelection sel,
122  int firsts,
123  int ns,
124  float **picked);
125 
126  static int load_one_filt_buf(MneRawData* data, MneRawBufDef* buf);
127 
128  static int mne_raw_pick_data_filt(MneRawData* data,
129  mneChSelection sel,
130  int firsts,
131  int ns,
132  float **picked);
133 
134  static MneRawData* mne_raw_open_file_comp(const QString& name, int omit_skip, int allow_maxshield, mneFilterDef filter, int comp_set);
135 
136  static MneRawData* mne_raw_open_file(const QString& name, int omit_skip, int allow_maxshield, mneFilterDef filter);
137 
138 public:
139  QString filename; /* This is our file */
140  // FIFFLIB::fiffFile file;
142  MNELIB::MneRawInfo* info; /* Loaded using the mne routines */
143  QStringList ch_names; /* Useful to have the channel names as a single list */
144  QStringList badlist; /* Bad channel names */
145  int nbad; /* How many? */
146  int *bad; /* Which channels are bad? */
147  MNELIB::MneRawBufDef* bufs; /* These are the data */
148  int nbuf; /* How many? */
149  MNELIB::MneRawBufDef* filt_bufs; /* These are the filtered ones */
150  int nfilt_buf;
151  int first_samp; /* First sample? */
152  int omit_samp; /* How many samples of skip omitted in the beginning */
153  int first_samp_old; /* This is the value first_samp would have in the old versions */
154  int omit_samp_old; /* This is the value omit_samp would have in the old versions */
155  int nsamp; /* How many samples in total? */
156  float *first_sample_val; /* Values at the first sample (for dc offset correction before filtering) */
157  MNELIB::MneProjOp* proj; /* Projection operator */
158  MNELIB::MneSssData* sss; /* SSS data found in this file */
159  MNELIB::MneCTFCompDataSet* comp; /* Compensation data */
160  int comp_file; /* Compensation status of these raw data in file */
161  int comp_now; /* Compensation status of these raw data in file */
162  mneFilterDef filter; /* Filter definition */
163  void *filter_data; /* This can be whatever the filter needs */
164  mneUserFreeFunc filter_data_free; /* Function to free the above */
165  mneEventList event_list; /* Trigger events */
166  unsigned int max_event; /* Maximum event number in usenest */
167  QString dig_trigger; /* Name of the digital trigger channel */
168  unsigned int dig_trigger_mask; /* Mask applied to digital trigger channel before considering it */
169  float *offsets; /* Dc offset corrections for display */
170  void *ring; /* The ringbuffer (structure is of no interest to us) */
171  void *filt_ring; /* Separate ring buffer for filtered data */
172  MNELIB::MneDerivSet* deriv; /* Derivation data */
173  MNELIB::MneDeriv* deriv_matched;/* Derivation data matched to this raw data and collected into a single item */
174  float *deriv_offsets; /* Dc offset corrections for display of the derived channels */
175  void *user; /* Whatever */
176  mneUserFreeFunc user_free; /* How this is freed */
177 
179 //typedef struct { /* A comprehensive raw data structure */
180 // char *filename; /* This is our file */
181 // // FIFFLIB::fiffFile file;
182 // FIFFLIB::FiffStream::SPtr stream;
183 // MNELIB::MneRawInfo* info; /* Loaded using the mne routines */
184 // char **ch_names; /* Useful to have the channel names as a single list */
185 // char **badlist; /* Bad channel names */
186 // int nbad; /* How many? */
187 // int *bad; /* Which channels are bad? */
188 // MNELIB::MneRawBufDef* bufs; /* These are the data */
189 // int nbuf; /* How many? */
190 // MNELIB::MneRawBufDef* filt_bufs; /* These are the filtered ones */
191 // int nfilt_buf;
192 // int first_samp; /* First sample? */
193 // int omit_samp; /* How many samples of skip omitted in the beginning */
194 // int first_samp_old; /* This is the value first_samp would have in the old versions */
195 // int omit_samp_old; /* This is the value omit_samp would have in the old versions */
196 // int nsamp; /* How many samples in total? */
197 // float *first_sample_val; /* Values at the first sample (for dc offset correction before filtering) */
198 // MNELIB::MneProjOp* proj; /* Projection operator */
199 // MNELIB::MneSssData* sss; /* SSS data found in this file */
200 // MNELIB::MneCTFCompDataSet* comp; /* Compensation data */
201 // int comp_file; /* Compensation status of these raw data in file */
202 // int comp_now; /* Compensation status of these raw data in file */
203 // mneFilterDef filter; /* Filter definition */
204 // void *filter_data; /* This can be whatever the filter needs */
205 // mneUserFreeFunc filter_data_free; /* Function to free the above */
206 // mneEventList event_list; /* Trigger events */
207 // unsigned int max_event; /* Maximum event number in usenest */
208 // char *dig_trigger; /* Name of the digital trigger channel */
209 // unsigned int dig_trigger_mask; /* Mask applied to digital trigger channel before considering it */
210 // float *offsets; /* Dc offset corrections for display */
211 // void *ring; /* The ringbuffer (structure is of no interest to us) */
212 // void *filt_ring; /* Separate ring buffer for filtered data */
213 // MNELIB::MneDerivSet* deriv; /* Derivation data */
214 // MNELIB::MneDeriv* deriv_matched;/* Derivation data matched to this raw data and collected into a single item */
215 // float *deriv_offsets; /* Dc offset corrections for display of the derived channels */
216 // void *user; /* Whatever */
217 // mneUserFreeFunc user_free; /* How this is freed */
218 //} *mneRawData,mneRawDataRec;
219 };
220 
221 //=============================================================================================================
222 // INLINE DEFINITIONS
223 //=============================================================================================================
224 } // NAMESPACE MNELIB
225 
226 #endif // MNERAWDATA_H
QSharedPointer< MneRawData > SPtr
Definition: mne_raw_data.h:89
One item in a derivation data set.
Definition: mne_deriv_set.h:78
Information about raw data in fiff file.
Definition: mne_raw_info.h:80
FiffStream class declaration.
One linear projection item.
Definition: mne_proj_op.h:83
MNE SSS Data (MneSssData) class declaration.
MneRawInfo class declaration.
MneRawBufDef class declaration.
MNE Derivation (MneDeriv) class declaration.
One item in a derivation data set.
Definition: mne_deriv.h:73
A comprehensive raw data structure.
Definition: mne_raw_data.h:86
Information about raw data in fiff file.
QSharedPointer< const MneRawData > ConstSPtr
Definition: mne_raw_data.h:90
One MNE CTF Compensation Data Set description.
FiffDirNode class declaration, which provides fiff dir tree processing methods.
MNEProjOp class declaration.
#define MNESHARED_EXPORT
Definition: mne_global.h:56
MNE SSS Data description.
Definition: mne_sss_data.h:82
MneCTFCompDataSet class declaration.
QSharedPointer< FiffStream > SPtr
Definition: fiff_stream.h:107