All Projects → simonarvin → Eyeloop

simonarvin / Eyeloop

Licence: gpl-3.0
EyeLoop is a Python 3-based eye-tracker tailored specifically to dynamic, closed-loop experiments on consumer-grade hardware.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Eyeloop

Psycho.r
An R package for experimental psychologists
Stars: ✭ 113 (-66.37%)
Mutual labels:  neuroscience, psychology
Psychopy
For running psychology and neuroscience experiments
Stars: ✭ 1,020 (+203.57%)
Mutual labels:  neuroscience, psychology
JATOS
Just Another Tool for Online Studies
Stars: ✭ 60 (-82.14%)
Mutual labels:  neuroscience, psychology
Expyriment
Platform-independent lightweight Python library for designing and conducting timing-critical behavioural and neuroimaging experiments
Stars: ✭ 94 (-72.02%)
Mutual labels:  neuroscience, psychology
Opensesame
Graphical experiment builder for the social sciences
Stars: ✭ 173 (-48.51%)
Mutual labels:  neuroscience, psychology
awesome-cogsci
An Awesome List of Cognitive Science Resources
Stars: ✭ 71 (-78.87%)
Mutual labels:  neuroscience, psychology
Neurokit.py
A Python Toolbox for Statistics and Neurophysiological Signal Processing (EEG, EDA, ECG, EMG...).
Stars: ✭ 292 (-13.1%)
Mutual labels:  neuroscience, psychology
programmingforpsych
A textbook for programming techniques for experiment creation and data-analysis
Stars: ✭ 18 (-94.64%)
Mutual labels:  psychology
CereLink
Blackrock Microsystems Cerebus Link for Neural Signal Processing
Stars: ✭ 33 (-90.18%)
Mutual labels:  neuroscience
Chinese-Psychological-QA-DataSet
中文心理问答数据集
Stars: ✭ 23 (-93.15%)
Mutual labels:  psychology
NiFi4Trading
NiFi Bundle for FIX Protocol
Stars: ✭ 14 (-95.83%)
Mutual labels:  visual
NeuroCore.jl
Core methods and structures for neuroscience research in Julia.
Stars: ✭ 15 (-95.54%)
Mutual labels:  neuroscience
Serverlessbydesign
A visual approach to serverless development. Think. Build. Repeat.
Stars: ✭ 254 (-24.4%)
Mutual labels:  visual
imaging tools
A table containing imaging analysis tools for biology, with a focus on calcium imaging.
Stars: ✭ 15 (-95.54%)
Mutual labels:  neuroscience
Livecodelab
a web based livecoding environment
Stars: ✭ 276 (-17.86%)
Mutual labels:  visual
WheatNNLeek
Spiking neural network system
Stars: ✭ 26 (-92.26%)
Mutual labels:  neuroscience
Enso Archive
Looking for Enso, the visual programming language? ➡️ https://github.com/enso-org/enso
Stars: ✭ 305 (-9.23%)
Mutual labels:  visual
Pyriemann
Python package for covariance matrices manipulation and Biosignal classification with application in Brain Computer interface
Stars: ✭ 272 (-19.05%)
Mutual labels:  neuroscience
pulse2percept
A Python-based simulation framework for bionic vision
Stars: ✭ 59 (-82.44%)
Mutual labels:  neuroscience
POMDP
Implementing a RL algorithm based upon a partially observable Markov decision process.
Stars: ✭ 31 (-90.77%)
Mutual labels:  neuroscience

EyeLoop License: GPL v3 contributions welcome Build Status version lab beta

   

EyeLoop is a Python 3-based eye-tracker tailored specifically to dynamic, closed-loop experiments on consumer-grade hardware. This software is actively maintained: Users are encouraged to contribute to its development.

Features

  • [x] High-speed > 1000 Hz on non-specialized hardware (no dedicated processing units necessary).
  • [x] Modular, readable, customizable.
  • [x] Open-source, and entirely Python 3.
  • [x] Works on any platform, easy installation.
  • [x] Actively maintained.

Overview

How it works

EyeLoop consists of two functional domains: the engine and the optional modules. The engine performs the eye-tracking, whereas the modules perform optional tasks, such as:

  • Experiments
  • Data acquisition
  • Importing video sequences to the engine

The modules import or extract data from the engine, and are therefore called Importers and Extractors, respectively.

One of EyeLoop's most appealing features is its modularity: Experiments are built simply by combining modules with the core Engine. Thus, the Engine has one task only: to compute eye-tracking data based on an imported sequence, and offer the generated data for extraction.

How does the Engine work?
How does the Importer work?
How does the Extractor work?

Getting started

Installation

Install EyeLoop simply by cloning the repository:

git clone https://github.com/simonarvin/eyeloop.git

Dependencies: python -m pip install -r requirements.txt

Using pip: pip install .

You may want to use a Conda or Python virtual environment when installing eyeloop, to avoid mixing up with your system dependencies.

Using pip and a virtual environment:

python -m venv venv

source venv/bin/activate

(venv) pip install .

Alternatively:

  • numpy: python pip install numpy
  • opencv: python pip install opencv-python

To download full examples with footage, check out EyeLoop's playground repository:

git clone https://github.com/simonarvin/eyeloop_playground.git

Initiation

EyeLoop is initiated through the command-line utility eyeloop.

eyeloop

To access the video sequence, EyeLoop must be connected to an appropriate importer class module. Usually, the default opencv importer class (cv) is sufficient. For some machine vision cameras, however, a vimba-based importer (vimba) is neccessary.

eyeloop --importer cv/vimba

Click here for more information on importers.

To perform offline eye-tracking, we pass the video argument --video with the path of the video sequence:

eyeloop --video [file]/[folder]

EyeLoop can be used on a multitude of eye types, including rodents, human and non-human primates. Specifically, users can suit their eye-tracking session to any species using the --model argument.

eyeloop --model ellipsoid/circular

In general, the ellipsoid pupil model is best suited for rodents, whereas the circular model is best suited for primates.

To see all command-line arguments, pass:

eyeloop --help

Designing your first experiment

In EyeLoop, experiments are built by stacking modules. By default, EyeLoop imports two base extractors, namely a FPS-counter and a data acquisition tool. To add custom extractors, e.g., for experimental purposes, use the argument tag --extractors:

eyeloop --extractors [file_path]/p (where p = file prompt)

Inside the extractor file, or a composite python file containing several extractors, define the list of extractors to be added:

extractors_add = [extractor1, extractor2, etc]

Extractors are instantiated by EyeLoop at start-up. Then, at every subsequent time-step, the extractor's fetch() function is called by the engine.

class Extractor:
    def __init__(self) -> None:
        ...
    def fetch(self, core) -> None:
        ...

fetch() gains access to all eye-tracking data in real-time via the core pointer.

Click here for more information on extractors.

Open-loop example

As an example, we'll here design a simple open-loop experiment where the brightness of a PC monitor is linked to the phase of the sine wave function. We create anew python-file, say "test_ex.py", and in it define the sine wave frequency and phase using the instantiator:

class Experiment:
    def __init__(self) -> None:
        self.frequency = ...
        self.phase = 0

Then, by using fetch(), we shift the phase of the sine wave function at every time-step, and use this to control the brightness of a cv-render.

    ...
    def fetch(self, engine) -> None:
        self.phase += self.frequency
        sine = numpy.sin(self.phase) * .5 + .5
        brightness = numpy.ones((height, width), dtype=float) * sine
        cv2.imshow("Experiment", brightness)

To add our test extractor to EyeLoop, we'll need to define an extractors_add array:

extractors_add = [Experiment()]

Finally, we test the experiment by running command:

eyeloop --extractors path/to/test_ex.py

See Examples for demo recordings and experimental designs.

Graphical user interface

The default graphical user interface in EyeLoop is minimum-gui.

EyeLoop is compatible with custom graphical user interfaces through its modular logic. Click here for instructions on how to build your own.

Running unit tests

Install testing requirements by running in a terminal:

pip install -r requirements_testing.txt

Then run tox: tox

Reports and results will be outputted to /tests/reports

Known issues

  • [ ] Respawning/freezing windows when running minimum-gui in Ubuntu.

References

If you use any of this code or data, please cite [Arvin et al. 2020] (preprint).

@article {Arvin2020.07.03.186387,
	author = {Arvin, Simon and Rasmussen, Rune and Yonehara, Keisuke},
	title = {EyeLoop: An open-source, high-speed eye-tracker designed for dynamic experiments},
	elocation-id = {2020.07.03.186387},
	year = {2020},
	doi = {10.1101/2020.07.03.186387},
	publisher = {Cold Spring Harbor Laboratory},
	URL = {https://www.biorxiv.org/content/early/2020/07/04/2020.07.03.186387},
	eprint = {https://www.biorxiv.org/content/early/2020/07/04/2020.07.03.186387.full.pdf},
	journal = {bioRxiv}
}

License

This project is licensed under the GNU General Public License v3.0. Note that the software is provided "as is", without warranty of any kind, express or implied.

Authors

Lead Developer: Simon Arvin, [email protected]

Researchers:

Corresponding Author: Keisuke Yonehera, [email protected]


         

    

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].