OpenSesame and PyGaze workshop in Potsdam

Titus von der Malsburg and colleagues have organised an OpenSesame and PyGaze workshop at the University of Potsdam. This page contains instructions and downloads, and is updated throughout the workshop based on what we need and produce on each day.

The workshop spans two days. On the first day, we will explore OpenSesame and PyGaze, and learn how to create experiments in a graphical user environment, and by using Python code. There will be an eye tracker (GazePoint GP3) present to demonstrate the software’s gaze-tracking capabilities. The second day consists of lab meetings where individual problems and ideas can be discussed.

OpenSesame installation

This one is easy! Just go to the OpenSesame documentation website, and choose the download for your operating system.

Python installation

  1. Download and install Anaconda. This is a Python distribution. Please select the version for your operating system, version 2.7, 64-bit. When prompted, make sure you ask the installer to make this your default Python installation. (NOTE: This is assuming you do not already have a Python installation up and running. If you do, you don’t have to install Anaconda!)
  2. Open a command prompt or terminal. See below for OS-specific instructions.
    1. Windows: Go to the folder where you installed Anaconda, for example C:\Anaconda27, and double-click on the programme called “Anaconda Command Prompt”.
    2. Linux: Open a Terminal.
    3. OS X: Type “Terminal” in the finder, and hit Enter.
  3. Install pygame by running the following command in your command prompt/terminal:
    pip install pygame
  4. Install PsychoPy by running the following commands in your command prompt/terminal:
    pip install pyglet
    pip install json_tricks
    pip install future
    pip install psychopy
  5. Install PyGaze by running the following commands in your command prompt/terminal:
    pip install python-pygaze

Tutorial instructions

We will be doing most things during the workshop, but some supporting files will be published on this page. For now (before the workshop starts), you only have to download and install OpenSesame and Python via the instructions listed above.

Where next?

If you liked the taste of Python you had during the workshop, there are a few options to continue learning.

A Byte Of Python is a free eBook that has an extensive overview of the language. Learn Python The Hard Way is a similar resource. A lot of the concepts these books introduce are not necessarily relevant for an experimental psychologist or cognitive neuroscientist, so feel free to be somewhat particular about which sections you read.

A more targeted resource is the book Python For Experimental Psychologists. It was written specifically with cognitive experiments in mind, and is therefore a good start for any researcher in experimental psychology or cognitive neuroscience.

Another great resource is the book Python Machine Learning. It has a more advanced scope, and you should definitely already be familiar with Python before sinking your teeth in it.

Downloads

All the experiments we created the workshop can be downloaded form the links below. If they open as text files in your browser, simply select “Save Page As” (under “File“) from your browsers menu.

3 Comments:

  1. Dear friend

    I am an academic with little resources and wonder which eye tracker (desktop/lab top mounted ) to purchase to allow the use of open source software for data analysis
    Tobii and some others charge big dollars to use theirs with the analytical licence
    many thanks for your kind advice
    Tom

  2. Paola Francesca Spadaro

    Hy,
    I am an individual researcher. I would like to know which eye tracker hardware is supported by your software. Thank you. Paola

  3. I have a dataset of x and y coordinates of eye gaze data with fixation duration.

    I want to plot a heatmap on a png image and the output will be like in the link

    https://i.insider.com/53ce61e16bb3f7dd693ffa82?width=1000&format=jpeg&auto=webp

    How do I plot it in Python

    Let’s assume that this is the database

    we have x , y and time [900.399, 980.142, 0.78] ,,

    Time represents the intensity of the heat

    x and y represent the coordinates of the eye gaze on the image

    the image = width and height x and y

    data = [ [900.399, 980.142, 0.78], [922.252, 880.885, 0.68], [724.311, 780.543, 0.58], [523.195, 582.994, 0.46], [623.431, 680.427, 0.76], [926.363, 881.791, 1.81], [722.942, 783.257, 0.75], [223.751, 279.995, 0.16], [723.215, 781.004, 0.64], [724.541, 779.889, 0.55] ]

    and let’s also assume that this is the width and height image that I want to plot on it = [1920, 1080]

    Can you help me designing a method in python to generate heatmap please

Leave a Reply to tom bo sing lee Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">