Binomial Bayes Factor
Reading luminance values from a Minolta LS-1100 photometer
Detecting light flashes with the Response Time Box
Reading keypresses from the Cedrus RB-530 response box
Read, Parker & Cumming 2002
Read & Cumming 2004
Read & Cumming 2007
Hardingham et al. 2010
Read, Phillipson & Glennerster 2009
Nityananda, Tarawneh et al 2015
Signal detection theory
Code fragments for SMI RED eyetracker
Here, I have collected together various bits of Matlab code which may prove useful to other researchers. Some of these are code fragments such as how to read data from a Minolta LS-1100 photometer, others are sets of many files which should in theory enable you to reproduce results in my published work. This is a new section of my website, and there are probably lots of teething problems such as missing files etc. If you have any problems using the code here, or reproducing the expected results, please get in touch and I’m sure we’ll be able to sort it out.
Here you can find information about Matlab code and a standalone executable for a GUI which enables you to calculate Bayes Factor for binomial data (e.g. M successes out of N attempts).
A simple model accounts for the response of disparity-tuned V1 neurons to anti-correlated images.
Visual Neuroscience 19: 735-753
ERRATA & Info
Understanding the cortical specialization for horizontal disparity.
Neural Computation Vol: 16(10) Pages: 1983-2020
Here is the code needed to generate the disparity distributions shown in Figure 5 of this paper. They are currently set up to generate Fig 5B.
First run DisparityDistrib_skeleton_rth.m.
This picks many different eye positions and retinal locations, and generates little line segments in disparity space.
It will create a matlab file with a name like DisparityDistrib_skel_rth_xi15_HVSD20_DSD8.mat.
Next run DisparityDistrib_flesh.m in order to convolve this infinitely narrow line segments with a Gaussian and generate a probability distribution suitable for plotting. It will create a matlab file with a name like DisparityDistrib_flesh_rth_xi15_HVSD10_DSD3_xlim1_ylim0.05.mat. Be warned, it is very slow though! (I’m sure it could be made more efficient.)
Finally after you have generated the two .mat files used in the paper, you can run PlotDisparityDistribution_zoomin.m to generate Fig 5.
Read JCA, Cumming BG (2007)
Sensors for impossible stimuli may solve the stereo correspondence problem.
Nature Neuroscience, 10: 1322 – 1328
Comment on this paper in Nature‘s Research Highlights section, Nature, 449: 118.
Please be aware that the algorithms in this paper are very slow to run, because they require multiple convolutions of slightly different receptive fields with large images.
This directory should contain the code I used to generate Fig 3. (Actually, it’s the version of Fig 3 that appears in the Supplementary Material, with the true disparity being 0.06.) If I’ve remembered to include all the necessary files, then if you put all these files in the same directory, move to that directory in the Matlab command window and then type TestWithNoise_smalldisp it should start running. It generates many different noise images with the same disparity, and applies the four different algorithms to each one. After each image, it updates a histogram showing the estimated disparity for each algorithm. For our algorithm, only one bar of this histogram is non-zero: the estimated disparity is virtually always the correct stimulus disparity (error rate ~ 1 in 10,000 or so).
FitPentagon_fine.m generates Figure 5, basically, but be warned, it takes hours to run.
Quantal analysis reveals a functional correlation between pre- and postsynaptic efficacy from excitatory connections in rat neocortex
Journal of Neuroscience 30(4):1441-51.
This directory contains the Matlab code used to do the quantal analysis in Hardingham et al 2006. To get started, type fitdata6 at the Matlab command line. Some very basic information is provided in QuantalAnalysis.doc. If you are interested in using this code, get in touch and I’ll see if I can provide better documentation — I just didn’t want to invest the time without knowing that anyone out there was interested!
The code to generate figures in this paper should be available as supplementary information on the journal’s website here, but there have been some problems accessing this, so I have also made it available here. Instructions on how to use the files are included in the paper.
Nityananda, Tarawneh, Jones, Busby, Herbert, Davies, Read (2015)
This paper reports the contrast sensitivity function for Sphodromantis lineola.
Here you can find the raw data for this paper, in Matlab format, and also an Excel file reporting the fitted thresholds for the individual insects and for the aggregate data pooled across individuals, using the methods reported in the paper.
O'Hanlon, CG and Read JCA ( 2016 )
Blindness to background: an inbuilt bias for visual objects
A video abstract describing the main findings. Here is a press release by Aberystwyth University. Our complete Matlab code for these experiments, including the code for operating the RED50 eye tracker, is available here
For this paper, I needed Matlab code to control a RED50 remote eye tracker made by SMI. I was greatly helped by Frans Cornelissen’s iViewXToolbox, but it didn’t work for me out of the box. I fiddled around until I got my code working, but unfortunately for purposes of sharing, it’s all embedded in code to run the experiments we were doing. The complete code is available in the zip file linked to above, but here I’ve tried to pull out the key parts of my code in the hope it’s useful to anyone else trying this.
As described here, we had a PC running the experiment (displaying stimuli, collecting responses), connected via an ethernet cable to a laptop which controlled the eyetracker using SMI’s software. NB we had to turn off all the Windows firewall stuff in order for the two computers to communicate. The experiment was run using a GUI, ControlPanel.fig and its associated file ControlPanel.m. The experiment was started by typing “ControlPanel” in the Matlab window. DefineExptStructure.m handles the initial set-up. This creates the structure “expt”, which contains basically all the information about how the experiment is set up, the chosen parameters etc. This gets passed around to functions as needed. expt.ivx is a substructure which contains everything different functions need to know about the eyetracker.
Within ControlPanel, the key functions you may want to look at are:
- EyeTracker_Callback. This gets called when the user clicks the button to turn on eye tracking. It doesn’t do much but you’ll see that the state of the variable handles.EyeTracker is read by other functions to see if we are meant to be using the eyetracker or not.
- calibrate_Callback. This gets called when the user hits the button to calibrate. It in turn calls “UpdateExptStructure” to read off various parameters, generate a new filename to store the data etc. It then calls IVXCalibration3.m to actually run the calibration.
- startexpt_Callback. This is called when the user hits the button to run an experiment. It looks up on the GUI what experiment the user wants to run this time and then calls the appropriate program (you will insert your function here!). Then after the participant has made their response, we call AfterTrial.m. If you just look through that using “find” to search for IVX, you’ll see the relevant commands for specifying the format of the eyetracker data, start streaming it from the eyetracker, stop streaming etc. It also calls a function GazeData.m, which has some code that may be relevant to you. It reads in the eye position data, throws away the (0,0) values and draws the gaze path (without any further correction for blinks).These files beginning “IVX…” are the ones relating specifically to communicate with the eyetracker, which as you’ll see are basically Frans Cornelissen’s code plus with a few tweaks I found I had to make.
I realise these code fragments are a terrible mess for anyone else trying to get their head around them, but hey when you’re stuck anything is useful!
This Excel spreadsheet, written by Dr Ignacio Serrano-Pedraza, makes signal detection theory easy. Simply enter the values in the response matrix (hits, false alarms, correct rejects and misses) and it will compute ROC curves, d-prime and beta values for you. Right-click the above link and use “Save target as…” to download the excel file.