private static void RunEEGCSV(string filepath) { EEGReader reader = new EEGFileReader(filepath); EEGProcessor processor = new EEGProcessor(reader, true); processor.Start(); while (!processor.Finished) { processor.Update(); } List <TrainingValue> results = processor.TrainingValues; StringBuilder csv = new StringBuilder(); foreach (TrainingValue t in results) { csv.AppendLine(String.Format("{0},{1},{2}", (t.Features[0] + t.Features[1]) / 2, (t.Features[2] + t.Features[3]) / 2, t.State)); } string filename = filepath.Split('.')[0] + ".csv"; //string filename2 = filename + "-2.csv"; //filename += "-1.csv"; File.WriteAllText(filename, String.Empty); File.WriteAllText(filename, csv.ToString()); //File.WriteAllText(filename2, String.Empty); //File.WriteAllText(filename2, csv2.ToString()); }
internal static List <TrainingValue> getTrainingValues(string filepath) { EEGReader reader; reader = new EEGFileReader(filepath); EEGProcessor processor = new EEGProcessor(reader, true); processor.Training = true; processor.Start(); while (!processor.Finished) { processor.Update(); } return(processor.TrainingValues); }
private static void RunEEG(string filepath = null) { EEGReader reader; if (filepath != null) { reader = new EEGFileReader(filepath); } else { reader = new EEGOSCReader(5005); } EEGProcessor processor = new EEGProcessor(reader); processor.Start(); while (true) { processor.Update(); } }