PsychoPy2: Experiments in behavior made easy

Jonathan Peirce, Jeremy R Gray, Sol Simpson, Michael MacAskill, Richard Höchenberger, Hiroyuki Sogo, Erik Kastman, Jonas Kristoffer Lindeløv, Jonathan Peirce, Jeremy R Gray, Sol Simpson, Michael MacAskill, Richard Höchenberger, Hiroyuki Sogo, Erik Kastman, Jonas Kristoffer Lindeløv

Abstract

PsychoPy is an application for the creation of experiments in behavioral science (psychology, neuroscience, linguistics, etc.) with precise spatial control and timing of stimuli. It now provides a choice of interface; users can write scripts in Python if they choose, while those who prefer to construct experiments graphically can use the new Builder interface. Here we describe the features that have been added over the last 10 years of its development. The most notable addition has been that Builder interface, allowing users to create studies with minimal or no programming, while also allowing the insertion of Python code for maximal flexibility. We also present some of the other new features, including further stimulus options, asynchronous time-stamped hardware polling, and better support for open science and reproducibility. Tens of thousands of users now launch PsychoPy every month, and more than 90 people have contributed to the code. We discuss the current state of the project, as well as plans for the future.

Keywords: Experiment; Open science; Open-source; Psychology; Reaction time; Software; Timing.

Figures

Fig. 1
Fig. 1
The PsychoPy Builder interface. The right-hand panel contains the Components that can be added to the experiment, organized by categories that can be expanded or collapsed. These Components can be added into Routines and appear like “tracks” in the Routine panel. In the demo shown here, in the Routine named “trial,” we simply present a word after a 500 ms pause and simultaneously start monitoring the keyboard for responses, but any number of Components can be set to start and stop in a synchronous or asynchronous fashion. The bottom panel of the interface shows the Flow of the experiment: the sequence in which the Routines will be presented, including the occurrence of any Loops in which we can repeat trials and/or blocks and control the randomization of conditions. Users report that this view is a highly intuitive and flexible way to implement their experimental designs
Fig. 2
Fig. 2
A more complex Flow arrangement. Loops and Routines can be nested in arbitrarily complex ways. PsychoPy itself is agnostic about whether a Loop designates trials, a sequence of stimuli within a trial, or a sequence of blocks around a loop of trials, as above. Furthermore, the mechanism for each loop is independent; it might be sequential, random, or a something more complex, such as an interleaved staircase of trials
Fig. 3
Fig. 3
Users per month, based on unique IP addresses launching the application. These figures are underestimates, due mostly to the fact that multiple computers on a local area network typically have a single IP address. We can also see the holiday patterns of users, with dips in usage during Christmas and the Northern hemisphere summer

References

    1. Bertamini M. Programming visual illusions for everyone. Cham: Springer; 2018.
    1. Brainard DH. The Psychophysics Toolbox. Spatial Vision. 1997;10:433–436. doi: 10.1163/156856897X00357.
    1. Dalmaijer ES. Python for experimental psychologists. London: Routledge; 2016.
    1. Dalmaijer ES, Mathôt S, Van der Stigchel S. PyGaze: an open-source, cross-platform toolbox for minimal-effort programming of eye tracking experiments. Behavior Research Methods. 2014;46:913–921. doi: 10.3758/s13428-013-0422-2.
    1. Garaizar P, Vadillo MA. Accuracy and precision of visual stimulus timing in PsychoPy: No timing errors in standard usage. PLoS ONE. 2014;9:e112033. doi: 10.1371/journal.pone.0112033.
    1. Garaizar P, Vadillo MA, López-de-Ipiña D, Matute H. Measuring software timing errors in the presentation of visual stimuli in cognitive neuroscience experiments. PLoS ONE. 2014;9:e85108. doi: 10.1371/journal.pone.0085108.
    1. Geller AS, Schlefer IK, Sederberg PB, Jacobs J, Kahana MJ. PyEPL: A cross-platform experiment-programming library. Behavior Research Methods. 2007;39:950–958. doi: 10.3758/BF03192990.
    1. Kleiner M, Brainard D, Pelli D. What’s new in Psychtoolbox-3? Perception. 2007;36(ECVP Abstract Suppl):14.
    1. Krause F, Lindemann O. Expyriment: A Python library for cognitive and neuroscientific experiments. Behavior Research Methods. 2014;46:416–428. doi: 10.3758/s13428-013-0390-6.
    1. Mathôt S, Schreij D, Theeuwes J. OpenSesame: An open-source, graphical experiment builder for the social sciences. Behavior Research Methods. 2012;44:314–324. doi: 10.3758/s13428-011-0168-7.
    1. Peirce JW. PsychoPy—Psychophysics software in Python. Journal of Neuroscience Methods. 2007;162:8–13. doi: 10.1016/j.jneumeth.2006.11.017.
    1. Peirce JW. Generating stimuli for neuroscience using PsychoPy. Frontiers in Neuroinformatics. 2009;2:10.
    1. Peirce JW, MacAskill MR. Building experiments in PsychoPy. London: Sage; 2018.
    1. Pelli DG. The VideoToolbox software for visual psychophysics: Transforming numbers into movies. Spatial Vision. 1997;10:437–442. doi: 10.1163/156856897X00366.
    1. Plant, R. R., & Quinlan, P. T. (2013). Could millisecond timing errors in commonly used equipment be a cause of replication failure in some neuroscience studies? Cognitive, Affective, & Behavioral Neuroscience, 13, 598–614. 10.3758/s13415-013-0166-6
    1. Sogo H. Shinrigaku jikken programming—Python/PsychoPy ni yoru jikken sakusei to data shori [Programming psychological experiments: Creating experiment programs and data handling with Python/PsychoPy] Tokyo: Asakura Shoten; 2017.
    1. Straw AD. Vision Egg: An open-source library for realtime visual stimulus generation. Frontiers in Neuroinformatics. 2008;2:4. doi: 10.3389/neuro.11.004.2008.

Source: PubMed

3
Suscribir