Introduction
Duijnhouwer-Psychtoolbox-Experiments (DPX) is a Matlab toolbox for creating and analyzing psychophysical experiments for vision research. It is a fully object-oriented extension of Psychtoolbox (PTB) which needs to be installed on your system for DPX to function. DPX is designed to create and manage experiments in a way that promotes simplicity and code reuse. Stimuli and response measures are designed as modules that are plugged into the tried and tested core of DPX. A wide range of these modules currently exists, and creating new ones is straightforward. The core takes care of all the bookkeeping that is common to any experiment, including data output. DPX automatically saves all aspects of the experiments as an easy to work-with format called DPXD. Functions to create analyses based on DPXD-structs are included.
I like to think that DPX relates to PTB as LaTeX to TeX. All the hard work (low-level graphics processing, keeping track of timing, etc.) is done by PTB while DPX provides an easy, structured, yet flexible environment to prepare, run, and analyse experiments.
If you publish work for which DPX was used you should cite PTB.
Requirements
To use DPX you need the following:
- A Windows, Mac OS X, or Linux computer. I've tested DPX on Windows 7 and 10, Ubuntu 12.04 and 14.04, and Mac OS X 10.6.8 and 10.9.5.
- Matlab. DPX was tested with R2012b, R2014a/b, and R2015b. I expect that any version since the introduction object-oriented syntax (R2008b and up) will work.
- Psychtoolbox-3 (Installation instructions). Try and test PTB before installing installing DPX, have a look at
help Psychdemos
. If this is the first time you run PTB, there will likely be some steps to take, most notably restarting Matlab. Carefully read the instructions PTB spews onto the command window.
Installation
To obtain the DPX files and give Matlab access to them:
- Change the current working directory of Matlab to the location where you wish to install the DPX toolbox. For example, to move to the default location for Matlab toolboxes on Windows you could type:
cd('C:\Users\YOURUSERNAME\Documents\MATLAB')
- Download DPX from GitHub to your system by copying the following to the Matlab command window:
!svn checkout https://github.com/duijnhouwer/dpx/trunk DPX
- Add the newly created folder “DPX” and its subfolders to the path by right-clicking on the “DPX” folder in the “Current Folder” panel of the Matlab GUI and selecting “Add to Path>Selected Folder and Subfolders”. You could use the
pathtool
instead but you'd have to manually delete all the “.svn” folders from the path.
Test
If everything is installed properly, the command dpxExampleExperiment
will run a basic 2AFC left-right random-dot motion discrimination experiment. Use dpxExampleExperimentAnalysis
to plot a psychometric curve of the data. I have heavily commented these examples so that they can serve as DPX tutorials.
Troubleshooting
If you encounter any problems please look in the issues section on GitHub whether your problem has been encountered and (hopefully) solved before. If the problem persists, please raise a new issue.