GazeDataHandler that detects fixations. GazeDataReceived method must be subscribed to gaze data events for fixations to be detected. Fixation start, update and end events can be subscribed to through the FixationDetector property. FixDetector written by Oleg Špakov at the University of Tampere in Tampere, Finland. http://www.sis.uta.fi/~csolsp/projects.php Documentation available through download link above.
Inheritance: GazeDataSynchronizedHandler
Exemplo n.º 1
0
        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        private static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);

            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);

            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            if (Settings.ProcessorDefinitions.ContainsKey(connector.Info.ProductId))
            {
                foreach (EmdatProcessorSettings settings in Settings.ProcessorDefinitions[connector.Info.ProductId])
                {
                    EmdatProcessor processor = new EmdatProcessor(syncManager);
                    processor.CumulativeData = settings.Cumulative;
                    connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
                    fixations.FixDetector.FixationEnd     += processor.FixationEnd;
                    Processors.Add(settings.ProcessorId, processor);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);

            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);

            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            /*/ 1. print each event to console
             * ConsolePrinter printer = new ConsolePrinter(syncManager);
             * //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
             * fixations.FixDetector.FixationEnd += printer.FixationEnd;//*/

            /*/ 2. windowed print to console
             * WindowingConsolePrinter printer = new WindowingConsolePrinter(syncManager);
             * //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
             * fixations.FixDetector.FixationEnd += printer.FixationEnd;
             *
             * printer.StartWindow();
             * while (true)
             * {
             *  Thread.Sleep(windowDuration);
             *  printer.ProcessWindow(cumulativeWindows);
             * }//*/

            // 3. process windows with EMDAT
            EmdatProcessor processor = new EmdatProcessor(syncManager);

            if (aoiFilePath != null)
            {
                processor.AoiFilePath = aoiFilePath;
            }

            connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
            fixations.FixDetector.FixationEnd     += processor.FixationEnd;

            processor.StartWindow();
            while (true)
            {
                Thread.Sleep(windowDuration);
                processor.ProcessWindow(cumulativeWindows);
            }//*/
        }
Exemplo n.º 3
0
        private static int windowDuration = 3000; // ms

        #endregion Fields

        #region Methods

        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);
            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);
            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            /*/ 1. print each event to console
            ConsolePrinter printer = new ConsolePrinter(syncManager);
            //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
            fixations.FixDetector.FixationEnd += printer.FixationEnd;//*/

            /*/ 2. windowed print to console
            WindowingConsolePrinter printer = new WindowingConsolePrinter(syncManager);
            //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
            fixations.FixDetector.FixationEnd += printer.FixationEnd;

            printer.StartWindow();
            while (true)
            {
                Thread.Sleep(windowDuration);
                printer.ProcessWindow(cumulativeWindows);
            }//*/

            // 3. process windows with EMDAT
            EmdatProcessor processor = new EmdatProcessor(syncManager);
            if (aoiFilePath != null)
            {
                processor.AoiFilePath = aoiFilePath;
            }

            connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
            fixations.FixDetector.FixationEnd += processor.FixationEnd;

            processor.StartWindow();
            while (true)
            {
                Thread.Sleep(windowDuration);
                processor.ProcessWindow(cumulativeWindows);
            }//*/
        }
Exemplo n.º 4
0
        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        private static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);
            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);
            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            if (Settings.ProcessorDefinitions.ContainsKey(connector.Info.ProductId))
            {
                foreach (EmdatProcessorSettings settings in Settings.ProcessorDefinitions[connector.Info.ProductId])
                {
                    EmdatProcessor processor = new EmdatProcessor(syncManager);
                    processor.CumulativeData = settings.Cumulative;
                    connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
                    fixations.FixDetector.FixationEnd += processor.FixationEnd;
                    Processors.Add(settings.ProcessorId, processor);
                }
            }
        }