EEG.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef _EEG_h_
  2. #define _EEG_h_
  3. /* EEG.h
  4. *
  5. * Copyright (C) 2011-2012,2014-2018 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "Sound.h"
  21. #include "TextGrid.h"
  22. #include "../dwtools/ICA.h"
  23. #include "EEG_def.h"
  24. autoEEG EEG_create (double tmin, double tmax);
  25. autoEEG EEG_readFromBdfFile (MelderFile file);
  26. autoEEG EEGs_concatenate (OrderedOf<structEEG>* me);
  27. void EEG_init (EEG me, double tmin, double tmax);
  28. integer EEG_getChannelNumber (EEG me, conststring32 channelName);
  29. void EEG_setChannelName (EEG me, integer channelNumber, conststring32 newName);
  30. static inline integer EEG_getNumberOfCapElectrodes (EEG me) {
  31. return (my numberOfChannels - 1) & ~ 15L; // BUG
  32. }
  33. static inline integer EEG_getNumberOfExtraSensors (EEG me) {
  34. return my numberOfChannels == 1 ? 0 : my numberOfChannels & 1 ? 1 : 8; // BUG
  35. }
  36. static inline integer EEG_getNumberOfExternalElectrodes (EEG me) {
  37. return my numberOfChannels - EEG_getNumberOfCapElectrodes (me) - EEG_getNumberOfExtraSensors (me);
  38. }
  39. void EEG_setExternalElectrodeNames (EEG me, conststring32 nameExg1, conststring32 nameExg2, conststring32 nameExg3, conststring32 nameExg4,
  40. conststring32 nameExg5, conststring32 nameExg6, conststring32 nameExg7, conststring32 nameExg8);
  41. void EEG_detrend (EEG me);
  42. void EEG_filter (EEG me, double lowFrequency, double lowWidth, double highFrequency, double highWidth, bool doNotch50Hz);
  43. void EEG_subtractReference (EEG me, conststring32 channelName1, conststring32 channelName2);
  44. void EEG_subtractMeanChannel (EEG me, integer fromChannel, integer toChannel);
  45. void EEG_setChannelToZero (EEG me, integer channelNumber);
  46. void EEG_setChannelToZero (EEG me, conststring32 channelName);
  47. void EEG_removeTriggers (EEG me, kMelder_string which, conststring32 criterion);
  48. autoEEG EEG_extractChannel (EEG me, integer channelNumber);
  49. autoEEG EEG_extractChannel (EEG me, conststring32 channelName);
  50. autoEEG EEG_extractChannels (EEG me, constVEC channelNumbers);
  51. void EEG_removeChannel (EEG me, integer channelNumber);
  52. void EEG_removeChannel (EEG me, conststring32 channelName);
  53. static inline autoSound EEG_extractSound (EEG me) { return Data_copy (my sound.get()); }
  54. static inline autoTextGrid EEG_extractTextGrid (EEG me) { return Data_copy (my textgrid.get()); }
  55. autoEEG EEG_extractPart (EEG me, double tmin, double tmax, bool preserveTimes);
  56. void EEG_replaceTextGrid (EEG me, TextGrid textgrid);
  57. autoMixingMatrix EEG_to_MixingMatrix (EEG me,
  58. double startTime, double endTime, integer numberOfCrossCorrelations, double lagStep,
  59. integer maxNumberOfIterations, double tol, int method);
  60. autoEEG EEG_MixingMatrix_to_EEG_unmix (EEG me, MixingMatrix you);
  61. autoEEG EEG_MixingMatrix_to_EEG_mix (EEG me, MixingMatrix you);
  62. /* End of file EEG.h */
  63. #endif