Introduction
Experimental psychologists and neuroscientists often study the speed and accuracy with which people can respond to events in their surroundings. For example: How much time does it cost athletes to start running when the starter gun goes off, and how often do athletes make a false start?Researchers need software to study this sort of process in experiments. Typically, researchers present stimuli, such as images, sounds, movies, lights, and then they measure the response speed and accuracy of a participant. PsyToolkit delivers this functionality for Linux platforms.
History and future of PsyToolkit
The PsyToolkit project started in 2005 at Washington University in St.Louis. At that time, there were several experimental psychology software packages available for the Microsoft and Macintosh environments, but not for Linux. To fill this gap, I started to write my own software library, and then extended it with a scripting language on top of the library. The library is coded in the programming language C, and it uses SDL libraries heavily.The main aim has always been to have a free software toolkit with which an experimental psychologist can relatively quickly develop an experiment on a Linux computer (you should be able to program a simple experiment in around 15 minutes).
Being free and specifically designed for Linux will remain main aims. The software will be further developed. Over the years, much effort has been put in testing the timing most carefully and code for external devices. In 2011, new video rendering options have been added enabling nicer graphics and moving stimuli.
The advantages of Linux
PsyToolkit is specifically designed for Linux. If you are not a Linux user, you might wonder why. Fact is that Linux is a popular operating system. What sets Linux apart is that it is open source and that most software applications are available for free. It sounds too good to be true, but it is a fact, and it works very well. That said, a Javascript version will help to demonstrate PsyToolkit's functionality to non-Linux users. This latter version runs in a web browser and even allows online data collection.What PsyToolkit is
PsyToolkit has three main components:- A scripting language which helps to implement experiments. The focus of the language is ease of programming.
- Underlying the scripting language is a C library. The library has a set of functions for operations typical in psychological experiments, such as stimulus presentation, response measurement, and time measurement.
- PsyQuest is a lightweight questionnaire presenter. It is programmed in ruby and uses the GTK graphical user interface. It is ideal for questionnaires and also for entering basic data about the experimenter and participant.
The scripting language
The scripting language that comes with PsyToolkit allows a straightforward way to code an experiment using building blocks that make sense in a psychological context. The script enables stimulus presentation (images, videos, sound), response measurement, time measurement, and even IO card control. The script allows for a complex trial structure, including "if/then" statements and "while" loops.If you want more flexibility than the scripting language offers and if you do not want to start from scratch using C, you can write a script, compile it into C using the psycc -k (keep) option, and then extend the resulting C code. Further, you can add C code with the script. There are commands in the syntax that allow you to include just one line of C, whole blocks, or even files of C code. You can also use C code in setting variables, for example: set $x c-expression sqrt(16)
Finally, you can integrate PsyToolkit with the Linux system using the system commands. For example, you can run an R analysis on the data collected and show the results to the participant. In the examples section, you see how simple this is.