CEBL  2.1
FilterConfig.hpp
Go to the documentation of this file.
1 /*
2 * CEBL : CSU EEG Brain-Computer Interface Lab
3 *
4 * Author: Jeshua Bratman - jeshuabratman@gmail.com
5 *
6 * This file is part of CEBL.
7 *
8 * CEBL is free software; you can redistribute it and/or modify it.
9 * We only ask that if you use our code that you cite the source in
10 * your project or publication.
11 *
12 * EEG Group (www.cs.colostate.edu/eeg)
13 * Department of Computer Science
14 * Colorado State University
15 *
16 */
17 
18 
25 #ifndef FILTERCONFIG_H
26 #define FILTERCONFIG_H
27 
28 #include "PluginLoader.hpp"
29 #include "Filter.hpp"
30 #include "EEGData.hpp"
31 #include "SessionManager.hpp"
32 using namespace CEBL;
33 
34 //std includes
35 #include <vector>
36 using namespace std;
37 
38 //forward declarations
39 class CEBLModel;
40 
42 {
43 private:
44  //make session manager a friend
45  friend class SessionManager;
46 
47  CEBLModel *model;
48 
49  //filter plugins
50  PluginLoader<Filter> * plugin_loader;
51  PluginLoader<Filter> * getPluginLoader() { return plugin_loader; }
52 
53  std::vector<int> selected_components;
54  string selected_components_string;
55  bool selected_components_valid;
56  string selected_filter;
57  int num_lags;
58  int num_components;
59  int num_channels;
60 
61  //values to check what settings the filter was trained on
62  int num_expected_channels;
63  int num_expected_lags;
64  bool trained;
65 
66 public:
68  ~FilterConfig();
69 
70  //GETTING OPERATIONS
71  std::vector<string> getNameList();
72  std::vector<string> getPathList();
73  bool isTrained(string filter = "");
74  int getNumLags();
75  string getSelected() { return selected_filter; }
76  std::vector<int> getSelectedComponents();
77  string getSelectedComponentsString();
78  bool getSelectedComponentsValid();
79  EEGData apply(EEGData data);
80  int getNumExpectedChannels();
81  ublas::matrix<double> getFilterMatrix();
82 
83  //SETTING OPERATIONS
84  void setSelectedComponentsString(string components);
85  void setSelected(string filter = "");
86  void setNumLags(int lags);
87  void train(EEGData training_data, string filter = "");
88  EEGData getComponents(EEGData training_data);
89 };
90 
91 #endif
92