public void SetFeautreIndexTab(EEGSensorID sensorID) { this.SelectFeatureSensorID = sensorID; if (FeatureChannelTab != null) { for (int i = 0; i < FeatureChannelTab.Length; i++) { Image TabImage = FeatureChannelTab[i].GetComponent <Image>(); if (TabImage != null) { TabImage.color = ((EEGSensorID)i == SelectFeatureSensorID) ? ConnectedColor : new Color(0.098f, 0.102f, 0.110f, 1.0f); } FeatureChannelTab[i].SendMessage("SetNormalColor", ((EEGSensorID)i == SelectFeatureSensorID) ? ConnectedColor : new Color(0.098f, 0.102f, 0.110f, 1.0f)); } } }
public void OnSelectChannel(int num) { this.SelectChannel = (EEGSensorID)num; }
private List <double> GetFeatureDataList(EEGSensorID sensorID, FeatureIndexEnum featureIndex) { List <double> dataList = new List <double>(); List <double> ScaleDataList = new List <double>(); List <EEGFeatureIndex> featureScaleList = LooxidLinkData.Instance.GetEEGFeatureIndexData(10.0f); if (featureScaleList.Count > 0) { for (int i = 0; i < featureScaleList.Count; i++) { if (featureIndex == FeatureIndexEnum.DELTA && !double.IsNaN(featureScaleList[i].Delta(sensorID))) { ScaleDataList.Add(featureScaleList[i].Delta(sensorID)); } if (featureIndex == FeatureIndexEnum.THETA && !double.IsNaN(featureScaleList[i].Theta(sensorID))) { ScaleDataList.Add(featureScaleList[i].Theta(sensorID)); } if (featureIndex == FeatureIndexEnum.ALPHA && !double.IsNaN(featureScaleList[i].Alpha(sensorID))) { ScaleDataList.Add(featureScaleList[i].Alpha(sensorID)); } if (featureIndex == FeatureIndexEnum.BETA && !double.IsNaN(featureScaleList[i].Beta(sensorID))) { ScaleDataList.Add(featureScaleList[i].Beta(sensorID)); } if (featureIndex == FeatureIndexEnum.GAMMA && !double.IsNaN(featureScaleList[i].Gamma(sensorID))) { ScaleDataList.Add(featureScaleList[i].Gamma(sensorID)); } } } List <EEGFeatureIndex> featureDataList = LooxidLinkData.Instance.GetEEGFeatureIndexData(8.0f); if (featureDataList.Count > 0) { double min = Min(ScaleDataList); double max = Max(ScaleDataList); int numIndexList = 6 * linkFequency; for (int i = 0; i < featureDataList.Count; i++) { if (i < numIndexList) { if (featureIndex == FeatureIndexEnum.DELTA) { double delta = double.IsNaN(featureDataList[i].Delta(sensorID)) ? 0.0 : LooxidLinkUtility.Scale(min, max, 0.0f, 1.0f, featureDataList[i].Delta(sensorID)); dataList.Add(delta); } if (featureIndex == FeatureIndexEnum.THETA) { double theta = double.IsNaN(featureDataList[i].Theta(sensorID)) ? 0.0 : LooxidLinkUtility.Scale(min, max, 0.0f, 1.0f, featureDataList[i].Theta(sensorID)); dataList.Add(theta); } if (featureIndex == FeatureIndexEnum.ALPHA) { double alpha = double.IsNaN(featureDataList[i].Alpha(sensorID)) ? 0.0 : LooxidLinkUtility.Scale(min, max, 0.0f, 1.0f, featureDataList[i].Alpha(sensorID)); dataList.Add(alpha); } if (featureIndex == FeatureIndexEnum.BETA) { double beta = double.IsNaN(featureDataList[i].Beta(sensorID)) ? 0.0 : LooxidLinkUtility.Scale(min, max, 0.0f, 1.0f, featureDataList[i].Beta(sensorID)); dataList.Add(beta); } if (featureIndex == FeatureIndexEnum.GAMMA) { double gamma = double.IsNaN(featureDataList[i].Gamma(sensorID)) ? 0.0 : LooxidLinkUtility.Scale(min, max, 0.0f, 1.0f, featureDataList[i].Gamma(sensorID)); dataList.Add(gamma); } } } } return(dataList); }