Programming

I write programs to help me run experiments, analyse large and complex data sets and visualise data. I have used C, JAVA, Visual Basic and Applescript but  recently I have mostly been using MATLAB, Python and R.  Where possible I will post code and executable programs here and people are welcome to use them for their own research. Of course, they may not always work the way you think they do (indeed they may not work at all!) and you should always back up your data before opening it in something that might edit it. In other words it's not my fault if things get messed up.

If you do use any of the following, think about contacting me with comments, suggestions or lavish praise. You might also like to cite one of my publications.

Eye movement analysis workshop at ECEM 2013

I co-taught a workshop at ECEM 2013 (Lund, Sweden) entitled "Analysing eye movements in space and time" (with Walter Bischof and Alan Kingstone). Slides and scanpath comparison code are available here.

VideoCoder: an Applescript video coder for QuickTime

I have been working with video and wrote this program to help with video annotation. It's a simple Mac application that works alongside QuickTime and allows the user to control the speed of a video and log certain events. It requires Mac OS X and should work as long as QuickTime can play the video in question. 

Download application bundles:

Version 1.0 (works with Tiger)

Version 1.1 (for Mac OS 10.5.8 Leopard etc)

Version 1.1 (for Snow Leopard: not well tested)

Version 1.2 (works along side QuickTime 7 which can be installed on more recent OSs and is the preferred option on these systems)

EM Tools for scanpath comparison (not updated for a long while)

There are lots of different ways to look at and analyse data from complex eye movement experiments. In my research I have been particularly interested in comparing whole sequences of eye movements ("scanpaths") to see whether people are consistent in where, and when, they look.

There are several different ways scanpaths can be compared, and I wrote some programs during my PhD to analyse this data and to plot eye movements (see e.g., Foulsham and Underwood, 2008, Journal of Vision).

I've bundled these programs together into "EMTools". You can download a zip file of the source and class files for this program, and it should work on most operating systems, provided that Java is installed.

There is a readme file for EMTools located here.

You can view an older, simpler version of one of the programs as a Java applet from within your browser here. [UPDATE: this is unlikely to work in modern browsers]

MATLAB code

codeVideoWithKeys.m - This is a GUI function designed for continuously logging something (e.g. the position of a gaze cursor) in frames of a video played at a slow speed. It was written with MATLAB 2008a on Mac OS X and it requires some of the newer functions and various video codecs (in other words it's highly likely that it wont work on other systems without a few changes!).

getMovingIA.m - This function allows one to play a video at a slow speed and move an interest area to track an object.  The interest area is then defined as a series of coordinates in time.

See also my code for modeling saccade biases here.

MATLAB code for comparing scanpaths with MultiMatch, written with Marcus Nystrom and Richard Dewhurst at Lund University, is available here.