MNE-CPP  beta 1.0
fiff_raw_data.cpp
Go to the documentation of this file.
1 //=============================================================================================================
36 //*************************************************************************************************************
37 //=============================================================================================================
38 // INCLUDES
39 //=============================================================================================================
40 
41 #include "fiff_raw_data.h"
42 #include "fiff_tag.h"
43 #include "fiff_stream.h"
44 #include "cstdlib"
45 
46 //*************************************************************************************************************
47 //=============================================================================================================
48 // USED NAMESPACES
49 //=============================================================================================================
50 
51 using namespace FIFFLIB;
52 
53 
54 //*************************************************************************************************************
55 //=============================================================================================================
56 // DEFINE MEMBER METHODS
57 //=============================================================================================================
58 
60 : first_samp(-1)
61 , last_samp(-1)
62 {
63 
64 }
65 
66 
67 //*************************************************************************************************************
68 
69 FiffRawData::FiffRawData(QIODevice &p_IODevice)
70 : first_samp(-1)
71 , last_samp(-1)
72 {
73  //setup FiffRawData object
74  if(!FiffStream::setup_read_raw(p_IODevice, *this))
75  {
76  printf("\tError during fiff setup raw read.\n");
77  //exit(EXIT_FAILURE); //ToDo Throw here, e.g.: throw std::runtime_error("IO Error! File not found");
78  return;
79  }
80 }
81 
82 
83 //*************************************************************************************************************
84 
86 : file(p_FiffRawData.file)
87 , info(p_FiffRawData.info)
88 , first_samp(p_FiffRawData.first_samp)
89 , last_samp(p_FiffRawData.last_samp)
90 , cals(p_FiffRawData.cals)
91 , rawdir(p_FiffRawData.rawdir)
92 , proj(p_FiffRawData.proj)
93 , comp(p_FiffRawData.comp)
94 {
95 
96 }
97 
98 
99 //*************************************************************************************************************
100 
102 {
103 
104 }
105 
106 
107 //*************************************************************************************************************
108 
110 {
111  info.clear();
112  first_samp = -1;
113  last_samp = -1;
114  cals = RowVectorXd();
115  rawdir.clear();
116  proj = MatrixXd();
117  comp.clear();
118 }
119 
120 
121 //*************************************************************************************************************
122 
123 bool FiffRawData::read_raw_segment(MatrixXd& data, MatrixXd& times, fiff_int_t from, fiff_int_t to, const RowVectorXi& sel)
124 {
125  bool projAvailable = true;
126 
127  if (this->proj.size() == 0)
128  projAvailable = false;
129 
130  if(from == -1)
131  from = this->first_samp;
132  if(to == -1)
133  to = this->last_samp;
134  //
135  // Initial checks
136  //
137  if(from < this->first_samp)
138  from = this->first_samp;
139  if(to > this->last_samp)
140  to = this->last_samp;
141  //
142  if(from > to)
143  {
144  printf("No data in this range\n");
145  return false;
146  }
147  printf("Reading %d ... %d = %9.3f ... %9.3f secs...", from, to, ((float)from)/this->info.sfreq, ((float)to)/this->info.sfreq);
148  //
149  // Initialize the data and calibration vector
150  //
151  qint32 nchan = this->info.nchan;
152  qint32 dest = 0;//1;
153  qint32 i, k, r;
154 
155  typedef Eigen::Triplet<double> T;
156  std::vector<T> tripletList;
157  tripletList.reserve(nchan);
158  for(i = 0; i < nchan; ++i)
159  tripletList.push_back(T(i, i, this->cals[i]));
160 
161  SparseMatrix<double> cal(nchan, nchan);
162  cal.setFromTriplets(tripletList.begin(), tripletList.end());
163 // cal.makeCompressed();
164 
165  MatrixXd mult_full;
166  //
167  if (sel.size() == 0)
168  {
169  data = MatrixXd(nchan, to-from+1);
170 // data->setZero();
171  if (projAvailable || this->comp.kind != -1)
172  {
173  if (!projAvailable)
174  mult_full = this->comp.data->data*cal;
175  else if (this->comp.kind == -1)
176  mult_full = this->proj*cal;
177  else
178  mult_full = this->proj*this->comp.data->data*cal;
179  }
180  }
181  else
182  {
183  data = MatrixXd(sel.size(),to-from+1);
184 // data->setZero();
185 
186  MatrixXd selVect(sel.size(), nchan);
187 
188  selVect.setZero();
189 
190  if (!projAvailable && this->comp.kind == -1)
191  {
192  tripletList.clear();
193  tripletList.reserve(sel.size());
194  for(i = 0; i < sel.size(); ++i)
195  tripletList.push_back(T(i, i, this->cals[sel[i]]));
196  cal = SparseMatrix<double>(sel.size(), sel.size());
197  cal.setFromTriplets(tripletList.begin(), tripletList.end());
198  }
199  else
200  {
201  if (!projAvailable)
202  {
203  qDebug() << "This has to be debugged! #1";
204  for( i = 0; i < sel.size(); ++i)
205  selVect.row(i) = this->comp.data->data.block(sel[i],0,1,nchan);
206  mult_full = selVect*cal;
207  }
208  else if (this->comp.kind == -1)
209  {
210  for( i = 0; i < sel.size(); ++i)
211  selVect.row(i) = this->proj.block(sel[i],0,1,nchan);
212 
213  mult_full = selVect*cal;
214  }
215  else
216  {
217  qDebug() << "This has to be debugged! #3";
218  for( i = 0; i < sel.size(); ++i)
219  selVect.row(i) = this->proj.block(sel[i],0,1,nchan);
220 
221  mult_full = selVect*this->comp.data->data*cal;
222  }
223  }
224  }
225 
226  bool do_debug = false;
227  //
228  // Make mult sparse
229  //
230  tripletList.clear();
231  tripletList.reserve(mult_full.rows()*mult_full.cols());
232  for(i = 0; i < mult_full.rows(); ++i)
233  for(k = 0; k < mult_full.cols(); ++k)
234  if(mult_full(i,k) != 0)
235  tripletList.push_back(T(i, k, mult_full(i,k)));
236 
237  SparseMatrix<double> mult(mult_full.rows(),mult_full.cols());
238  if(tripletList.size() > 0)
239  mult.setFromTriplets(tripletList.begin(), tripletList.end());
240 // mult.makeCompressed();
241 
242  //
243 
244  FiffStream::SPtr fid;
245  if (!this->file->device()->isOpen())
246  {
247  if (!this->file->device()->open(QIODevice::ReadOnly))
248  {
249  printf("Cannot open file %s",this->info.filename.toUtf8().constData());
250  }
251  fid = this->file;
252  }
253  else
254  {
255  fid = this->file;
256  }
257 
258  MatrixXd one;
259  fiff_int_t first_pick, last_pick, picksamp;
260  for(k = 0; k < this->rawdir.size(); ++k)
261  {
262  FiffRawDir thisRawDir = this->rawdir[k];
263  //
264  // Do we need this buffer
265  //
266  if (thisRawDir.last > from)
267  {
268  if (thisRawDir.ent.kind == -1)
269  {
270  //
271  // Take the easy route: skip is translated to zeros
272  //
273  if(do_debug)
274  printf("S");
275  if (sel.cols() <= 0)
276  one.resize(nchan,thisRawDir.nsamp);
277  else
278  one.resize(sel.cols(),thisRawDir.nsamp);
279 
280  one.setZero();
281  }
282  else
283  {
284  FiffTag::SPtr t_pTag;
285  FiffTag::read_tag(fid.data(), t_pTag, thisRawDir.ent.pos);
286  //
287  // Depending on the state of the projection and selection
288  // we proceed a little bit differently
289  //
290  if (mult.cols() == 0)
291  {
292  if (sel.cols() == 0)
293  {
294  if (t_pTag->type == FIFFT_DAU_PACK16)
295  one = cal*(Map< MatrixDau16 >( t_pTag->toDauPack16(),nchan, thisRawDir.nsamp)).cast<double>();
296  else if(t_pTag->type == FIFFT_INT)
297  one = cal*(Map< MatrixXi >( t_pTag->toInt(),nchan, thisRawDir.nsamp)).cast<double>();
298  else if(t_pTag->type == FIFFT_FLOAT)
299  one = cal*(Map< MatrixXf >( t_pTag->toFloat(),nchan, thisRawDir.nsamp)).cast<double>();
300  else
301  printf("Data Storage Format not known jet [1]!! Type: %d\n", t_pTag->type);
302  }
303  else
304  {
305 
306  //ToDo find a faster solution for this!! --> make cal and mul sparse like in MATLAB
307  MatrixXd newData(sel.cols(), thisRawDir.nsamp); //ToDo this can be done much faster, without newData
308 
309  if (t_pTag->type == FIFFT_DAU_PACK16)
310  {
311  MatrixXd tmp_data = (Map< MatrixDau16 > ( t_pTag->toDauPack16(),nchan, thisRawDir.nsamp)).cast<double>();
312 
313  for(r = 0; r < sel.size(); ++r)
314  newData.block(r,0,1,thisRawDir.nsamp) = tmp_data.block(sel[r],0,1,thisRawDir.nsamp);
315  }
316  else if(t_pTag->type == FIFFT_INT)
317  {
318  MatrixXd tmp_data = (Map< MatrixXi >( t_pTag->toInt(),nchan, thisRawDir.nsamp)).cast<double>();
319 
320  for(r = 0; r < sel.size(); ++r)
321  newData.block(r,0,1,thisRawDir.nsamp) = tmp_data.block(sel[r],0,1,thisRawDir.nsamp);
322  }
323  else if(t_pTag->type == FIFFT_FLOAT)
324  {
325  MatrixXd tmp_data = (Map< MatrixXf > ( t_pTag->toFloat(),nchan, thisRawDir.nsamp)).cast<double>();
326 
327  for(r = 0; r < sel.size(); ++r)
328  newData.block(r,0,1,thisRawDir.nsamp) = tmp_data.block(sel[r],0,1,thisRawDir.nsamp);
329  }
330  else
331  {
332  printf("Data Storage Format not known jet [2]!! Type: %d\n", t_pTag->type);
333  }
334 
335  one = cal*newData;
336  }
337  }
338  else
339  {
340  if (t_pTag->type == FIFFT_DAU_PACK16)
341  one = mult*(Map< MatrixDau16 >( t_pTag->toDauPack16(),nchan, thisRawDir.nsamp)).cast<double>();
342  else if(t_pTag->type == FIFFT_INT)
343  one = mult*(Map< MatrixXi >( t_pTag->toInt(),nchan, thisRawDir.nsamp)).cast<double>();
344  else if(t_pTag->type == FIFFT_FLOAT)
345  one = mult*(Map< MatrixXf >( t_pTag->toFloat(),nchan, thisRawDir.nsamp)).cast<double>();
346  else
347  printf("Data Storage Format not known jet [3]!! Type: %d\n", t_pTag->type);
348  }
349  }
350  //
351  // The picking logic is a bit complicated
352  //
353  if (to >= thisRawDir.last && from <= thisRawDir.first)
354  {
355  //
356  // We need the whole buffer
357  //
358  first_pick = 0;//1;
359  last_pick = thisRawDir.nsamp - 1;
360  if (do_debug)
361  printf("W");
362  }
363  else if (from > thisRawDir.first)
364  {
365  first_pick = from - thisRawDir.first;// + 1;
366  if(to < thisRawDir.last)
367  {
368  //
369  // Something from the middle
370  //
371 // qDebug() << "This needs to be debugged!";
372  last_pick = thisRawDir.nsamp + to - thisRawDir.last - 1;//is this alright?
373  if (do_debug)
374  printf("M");
375  }
376  else
377  {
378  //
379  // From the middle to the end
380  //
381  last_pick = thisRawDir.nsamp - 1;
382  if (do_debug)
383  printf("E");
384  }
385  }
386  else
387  {
388  //
389  // From the beginning to the middle
390  //
391  first_pick = 0;//1;
392  last_pick = to - thisRawDir.first;// + 1;
393  if (do_debug)
394  printf("B");
395  }
396  //
397  // Now we are ready to pick
398  //
399  picksamp = last_pick - first_pick + 1;
400 
401  if(do_debug)
402  {
403  qDebug() << "first_pick: " << first_pick;
404  qDebug() << "last_pick: " << last_pick;
405  qDebug() << "picksamp: " << picksamp;
406  }
407 
408  if (picksamp > 0)
409  {
410 // for(r = 0; r < data->rows(); ++r)
411 // for(c = 0; c < picksamp; ++c)
412 // (*data)(r,dest + c) = one(r,first_pick + c);
413  data.block(0,dest,data.rows(),picksamp) = one.block(0, first_pick, data.rows(), picksamp);
414 
415  dest += picksamp;
416  }
417  }
418  //
419  // Done?
420  //
421  if (thisRawDir.last >= to)
422  {
423  printf(" [done]\n");
424  break;
425  }
426  }
427 
428 // fclose(fid);
429 
430  times = MatrixXd(1, to-from+1);
431 
432  for (i = 0; i < times.cols(); ++i)
433  times(0, i) = ((float)(from+i)) / this->info.sfreq;
434 
435  return true;
436 }
437 
438 
439 //*************************************************************************************************************
440 
441 bool FiffRawData::read_raw_segment(MatrixXd& data, MatrixXd& times, SparseMatrix<double>& multSegment, fiff_int_t from, fiff_int_t to, const RowVectorXi& sel)
442 {
443  bool projAvailable = true;
444 
445  if (this->proj.size() == 0)
446  projAvailable = false;
447 
448  if(from == -1)
449  from = this->first_samp;
450  if(to == -1)
451  to = this->last_samp;
452  //
453  // Initial checks
454  //
455  if(from < this->first_samp)
456  from = this->first_samp;
457  if(to > this->last_samp)
458  to = this->last_samp;
459  //
460  if(from > to)
461  {
462  printf("No data in this range\n");
463  return false;
464  }
465  printf("Reading %d ... %d = %9.3f ... %9.3f secs...", from, to, ((float)from)/this->info.sfreq, ((float)to)/this->info.sfreq);
466  //
467  // Initialize the data and calibration vector
468  //
469  qint32 nchan = this->info.nchan;
470  qint32 dest = 0;//1;
471  qint32 i, k, r;
472 
473  typedef Eigen::Triplet<double> T;
474  std::vector<T> tripletList;
475  tripletList.reserve(nchan);
476  for(i = 0; i < nchan; ++i)
477  tripletList.push_back(T(i, i, this->cals[i]));
478 
479  SparseMatrix<double> cal(nchan, nchan);
480  cal.setFromTriplets(tripletList.begin(), tripletList.end());
481 // cal.makeCompressed();
482 
483  MatrixXd mult_full;
484  //
485  if (sel.size() == 0)
486  {
487  data = MatrixXd(nchan, to-from+1);
488 // data->setZero();
489  if (projAvailable || this->comp.kind != -1)
490  {
491  if (!projAvailable)
492  mult_full = this->comp.data->data*cal;
493  else if (this->comp.kind == -1)
494  mult_full = this->proj*cal;
495  else
496  mult_full = this->proj*this->comp.data->data*cal;
497  }
498  }
499  else
500  {
501  data = MatrixXd(sel.size(),to-from+1);
502 // data->setZero();
503 
504  MatrixXd selVect(sel.size(), nchan);
505 
506  selVect.setZero();
507 
508  if (!projAvailable && this->comp.kind == -1)
509  {
510  tripletList.clear();
511  tripletList.reserve(sel.size());
512  for(i = 0; i < sel.size(); ++i)
513  tripletList.push_back(T(i, i, this->cals[sel[i]]));
514  cal = SparseMatrix<double>(sel.size(), sel.size());
515  cal.setFromTriplets(tripletList.begin(), tripletList.end());
516  }
517  else
518  {
519  if (!projAvailable)
520  {
521  qDebug() << "This has to be debugged! #1";
522  for( i = 0; i < sel.size(); ++i)
523  selVect.row(i) = this->comp.data->data.block(sel[i],0,1,nchan);
524  mult_full = selVect*cal;
525  }
526  else if (this->comp.kind == -1)
527  {
528  for( i = 0; i < sel.size(); ++i)
529  selVect.row(i) = this->proj.block(sel[i],0,1,nchan);
530 
531  mult_full = selVect*cal;
532  }
533  else
534  {
535  qDebug() << "This has to be debugged! #3";
536  for( i = 0; i < sel.size(); ++i)
537  selVect.row(i) = this->proj.block(sel[i],0,1,nchan);
538 
539  mult_full = selVect*this->comp.data->data*cal;
540  }
541  }
542  }
543 
544  bool do_debug = false;
545  //
546  // Make mult sparse
547  //
548  tripletList.clear();
549  tripletList.reserve(mult_full.rows()*mult_full.cols());
550  for(i = 0; i < mult_full.rows(); ++i)
551  for(k = 0; k < mult_full.cols(); ++k)
552  if(mult_full(i,k) != 0)
553  tripletList.push_back(T(i, k, mult_full(i,k)));
554 
555  SparseMatrix<double> mult(mult_full.rows(),mult_full.cols());
556  if(tripletList.size() > 0)
557  mult.setFromTriplets(tripletList.begin(), tripletList.end());
558 // mult.makeCompressed();
559 
560  //
561 
562  FiffStream::SPtr fid;
563  if (!this->file->device()->isOpen())
564  {
565  if (!this->file->device()->open(QIODevice::ReadOnly))
566  {
567  printf("Cannot open file %s",this->info.filename.toUtf8().constData());
568  }
569  fid = this->file;
570  }
571  else
572  {
573  fid = this->file;
574  }
575 
576  MatrixXd one;
577  fiff_int_t first_pick, last_pick, picksamp;
578  for(k = 0; k < this->rawdir.size(); ++k)
579  {
580  FiffRawDir thisRawDir = this->rawdir[k];
581  //
582  // Do we need this buffer
583  //
584  if (thisRawDir.last > from)
585  {
586  if (thisRawDir.ent.kind == -1)
587  {
588  //
589  // Take the easy route: skip is translated to zeros
590  //
591  if(do_debug)
592  printf("S");
593  if (sel.cols() <= 0)
594  one.resize(nchan,thisRawDir.nsamp);
595  else
596  one.resize(sel.cols(),thisRawDir.nsamp);
597 
598  one.setZero();
599  }
600  else
601  {
602  FiffTag::SPtr t_pTag;
603  FiffTag::read_tag(fid.data(), t_pTag, thisRawDir.ent.pos);
604  //
605  // Depending on the state of the projection and selection
606  // we proceed a little bit differently
607  //
608  if (mult.cols() == 0)
609  {
610  if (sel.cols() == 0)
611  {
612  if (t_pTag->type == FIFFT_DAU_PACK16)
613  one = cal*(Map< MatrixDau16 >( t_pTag->toDauPack16(),nchan, thisRawDir.nsamp)).cast<double>();
614  else if(t_pTag->type == FIFFT_INT)
615  one = cal*(Map< MatrixXi >( t_pTag->toInt(),nchan, thisRawDir.nsamp)).cast<double>();
616  else if(t_pTag->type == FIFFT_FLOAT)
617  one = cal*(Map< MatrixXf >( t_pTag->toFloat(),nchan, thisRawDir.nsamp)).cast<double>();
618  else
619  printf("Data Storage Format not known jet [1]!! Type: %d\n", t_pTag->type);
620  }
621  else
622  {
623 
624  //ToDo find a faster solution for this!! --> make cal and mul sparse like in MATLAB
625  MatrixXd newData(sel.cols(), thisRawDir.nsamp); //ToDo this can be done much faster, without newData
626 
627  if (t_pTag->type == FIFFT_DAU_PACK16)
628  {
629  MatrixXd tmp_data = (Map< MatrixDau16 > ( t_pTag->toDauPack16(),nchan, thisRawDir.nsamp)).cast<double>();
630 
631  for(r = 0; r < sel.size(); ++r)
632  newData.block(r,0,1,thisRawDir.nsamp) = tmp_data.block(sel[r],0,1,thisRawDir.nsamp);
633  }
634  else if(t_pTag->type == FIFFT_INT)
635  {
636  MatrixXd tmp_data = (Map< MatrixXi >( t_pTag->toInt(),nchan, thisRawDir.nsamp)).cast<double>();
637 
638  for(r = 0; r < sel.size(); ++r)
639  newData.block(r,0,1,thisRawDir.nsamp) = tmp_data.block(sel[r],0,1,thisRawDir.nsamp);
640  }
641  else if(t_pTag->type == FIFFT_FLOAT)
642  {
643  MatrixXd tmp_data = (Map< MatrixXf > ( t_pTag->toFloat(),nchan, thisRawDir.nsamp)).cast<double>();
644 
645  for(r = 0; r < sel.size(); ++r)
646  newData.block(r,0,1,thisRawDir.nsamp) = tmp_data.block(sel[r],0,1,thisRawDir.nsamp);
647  }
648  else
649  {
650  printf("Data Storage Format not known jet [2]!! Type: %d\n", t_pTag->type);
651  }
652 
653  one = cal*newData;
654  }
655  }
656  else
657  {
658  if (t_pTag->type == FIFFT_DAU_PACK16)
659  one = mult*(Map< MatrixDau16 >( t_pTag->toDauPack16(),nchan, thisRawDir.nsamp)).cast<double>();
660  else if(t_pTag->type == FIFFT_INT)
661  one = mult*(Map< MatrixXi >( t_pTag->toInt(),nchan, thisRawDir.nsamp)).cast<double>();
662  else if(t_pTag->type == FIFFT_FLOAT)
663  one = mult*(Map< MatrixXf >( t_pTag->toFloat(),nchan, thisRawDir.nsamp)).cast<double>();
664  else
665  printf("Data Storage Format not known jet [3]!! Type: %d\n", t_pTag->type);
666  }
667  }
668  //
669  // The picking logic is a bit complicated
670  //
671  if (to >= thisRawDir.last && from <= thisRawDir.first)
672  {
673  //
674  // We need the whole buffer
675  //
676  first_pick = 0;//1;
677  last_pick = thisRawDir.nsamp - 1;
678  if (do_debug)
679  printf("W");
680  }
681  else if (from > thisRawDir.first)
682  {
683  first_pick = from - thisRawDir.first;// + 1;
684  if(to < thisRawDir.last)
685  {
686  //
687  // Something from the middle
688  //
689 // qDebug() << "This needs to be debugged!";
690  last_pick = thisRawDir.nsamp + to - thisRawDir.last - 1;//is this alright?
691  if (do_debug)
692  printf("M");
693  }
694  else
695  {
696  //
697  // From the middle to the end
698  //
699  last_pick = thisRawDir.nsamp - 1;
700  if (do_debug)
701  printf("E");
702  }
703  }
704  else
705  {
706  //
707  // From the beginning to the middle
708  //
709  first_pick = 0;//1;
710  last_pick = to - thisRawDir.first;// + 1;
711  if (do_debug)
712  printf("B");
713  }
714  //
715  // Now we are ready to pick
716  //
717  picksamp = last_pick - first_pick + 1;
718 
719  if(do_debug)
720  {
721  qDebug() << "first_pick: " << first_pick;
722  qDebug() << "last_pick: " << last_pick;
723  qDebug() << "picksamp: " << picksamp;
724  }
725 
726  if (picksamp > 0)
727  {
728 // for(r = 0; r < data->rows(); ++r)
729 // for(c = 0; c < picksamp; ++c)
730 // (*data)(r,dest + c) = one(r,first_pick + c);
731  data.block(0,dest,data.rows(),picksamp) = one.block(0, first_pick, data.rows(), picksamp);
732 
733  dest += picksamp;
734  }
735  }
736  //
737  // Done?
738  //
739  if (thisRawDir.last >= to)
740  {
741  printf(" [done]\n");
742  break;
743  }
744  }
745 
746  if(mult.cols()==0)
747  multSegment = cal;
748  else
749  multSegment = mult;
750 // fclose(fid);
751 
752  times = MatrixXd(1, to-from+1);
753 
754  for (i = 0; i < times.cols(); ++i)
755  times(0, i) = ((float)(from+i)) / this->info.sfreq;
756 
757  return true;
758 }
759 
760 
761 //*************************************************************************************************************
762 
763 bool FiffRawData::read_raw_segment_times(MatrixXd& data, MatrixXd& times, float from, float to, const RowVectorXi& sel)
764 {
765  //
766  // Convert to samples
767  //
768  from = floor(from*this->info.sfreq);
769  to = ceil(to*this->info.sfreq);
770  //
771  // Read it
772  //
773  return this->read_raw_segment(data, times, (qint32)from, (qint32)to, sel);
774 }
fiff_int_t kind
QSharedPointer< FiffTag > SPtr
Definition: fiff_tag.h:166
Raw Directory entry.
Definition: fiff_raw_dir.h:81
FiffDirEntry ent
Definition: fiff_raw_dir.h:108
static bool read_tag(FiffStream *p_pStream, FiffTag::SPtr &p_pTag, qint64 pos=-1)
Definition: fiff_tag.cpp:204
bool read_raw_segment_times(MatrixXd &data, MatrixXd &times, float from, float to, const RowVectorXi &sel=defaultRowVectorXi)
QList< FiffRawDir > rawdir
QSharedPointer< FiffStream > SPtr
Definition: fiff_stream.h:132
fiff_int_t pos
FIFF raw measurement data.
Definition: fiff_raw_data.h:94
FiffStream::SPtr file
static bool setup_read_raw(QIODevice &p_IODevice, FiffRawData &data, bool allow_maxshield=false)
bool read_raw_segment(MatrixXd &data, MatrixXd &times, fiff_int_t from=-1, fiff_int_t to=-1, const RowVectorXi &sel=defaultRowVectorXi)
FiffNamedMatrix::SDPtr data
FiffStream class declaration.
Definition: fiff.h:98
FiffRawData class declaration.
FiffTag class declaration, which provides fiff tag I/O and processing methods.