public static FixationData Classify(GazeData.GazeData gazeData) { FixationData fixationData = gazeData.ToFixationData(); if (XValueList.Count < Settings.Default.IDT_Window) { fixationData.Type = "SACCADES"; XValueList.Add(fixationData.X_Median); YValueList.Add(fixationData.Y_Median); } else { XValueList.RemoveAt(0); YValueList.RemoveAt(0); XValueList.Add(fixationData.X_Median); YValueList.Add(fixationData.Y_Median); double dispersion = GetDispersion(fixationData); if (dispersion > Settings.Default.IDT_Threshold) { if (PreviousFixationData.Type == "FIXATIONS") { fixationData.EventType = "END"; } fixationData.EventType = "SACCADES"; fixationData.Type = "SACCADES"; //Console.WriteLine("-------------XXX--------------------"); } else { //Console.WriteLine("--------------------FIXATION--------------------"); fixationData.Type = "FIXATIONS"; if (PreviousFixationData.Type == "SACCADES") { fixationData.EventType = "BEGIN"; counter += 1; } else { fixationData.EventType = "DATA"; } // For Fixations - compute centroid fixationData.X_Median = XValueList.Average(); fixationData.Y_Median = YValueList.Average(); } } //Console.WriteLine(counter); PreviousFixationData = fixationData; return(fixationData); }
public static FixationData Classify(GazeData.GazeData gazeData, double threshold) { FixationData fixationData = gazeData.ToFixationData(); if (PreviousFixationData == null) { fixationData.Type = "SACCADES"; } else { double distance = GetDistance(PreviousFixationData, gazeData); if (distance > 600) { if (PreviousFixationData.Type == "FIXATIONS") { fixationData.EventType = "END"; } fixationData.Type = "SACCADES"; //Console.WriteLine("-------------XXX--------------------"); } else { //Console.WriteLine("--------------------FIXATION--------------------"); fixationData.Type = "FIXATIONS"; if (PreviousFixationData.Type == "SACCADES") { fixationData.EventType = "BEGIN"; } else { fixationData.EventType = "DATA"; } } } PreviousFixationData = fixationData; return(fixationData); }