Software Lesson 2
July 24, 1997
Programming on Macintosh
4. Psychophysics withMATLAB
Shimojo Lab Home
Caltech Home
written by Yukiyasu Kamitani, kamitani@percipi.caltech.edu
Last Modified: April 19, 1999
1. Introduction
-
Hardware for Visual Psychophysics in Shimojo Lab
-
Advantage of Macintosh
-
Cheap (vs. SGI, VSG)
-
Easy extension (vs. SGI)
-
Low level video control (vs. SGI)
-
High spatial and temporal resolution (vs. AMIGA)
-
Disadvantage of Macintosh
-
Poor 3D graphics environment
-
Unstable system software
-
Future of Apple Inc.
-
Software Environment for Visual Experiment on Macintosh
-
Commercial software: e.g. Director
-
Softwares developed by reserchers: e.g. Maclab, MacProbe,
MacStim, PsyScope, RSVP, etc.
-
Programming languages like C and MATLAB: see below
2. C Compiler for Macintosh
-
Symantec C++ (Symantec)
-
Think Project Manager: for 68K code
-
Symantec Project Manager: for PowerPC code
-
Metroworks Codewarrior (Metroworks)
-
for both 68K and PowerPC codes
-
supports also Java and Pascal
-
How to make a project file: demo
3. C Library for Psychophysics
-
Vision Shell (Comtois & Cavanagh at Harvard
Vision Lab, MICRO M-L Inc.)
-
Commercial product (about $500)
-
Functions for accurate video control (synchronization of
program with monitor)
-
Functions for manipulation of stimulus parameters via GUI
-
Rich drawing functions
-
Source codes are not provided; object library only for Think
C (68K code)
-
Sample Code by Y. Kamitani
4StrokeAppMotion.c
-
VideoToolbox
(Pelli at NYU)
-
Free
-
Functions for accurate video control (synchronization of
program with monitor)
-
Rich statistical functions
-
Source codes are provides; runs with both Metroworks and
Symantec (both PPC and 68K)
-
Messy collection of codes; hard to read and learn the codes
4. Psychophysics on MATLAB
-
MATLAB (Mathworks)
-
More intuitive and shorter code
-
High-level functions
-
No need for declaration of variables
-
Matrix-based operation reduces the number of for-loops
-
However, slower and less flexible than C, especially in graphics
-
MEX file
-
C functions can be converted into "MEX" files, which can
be called from MATLAB
-
MEX files are compiled codes, so fast to be executed
-
Psychophysics
Toolbox (Brainard & Pelli)
-
Collection of functions in MEX (M) files converted from VideoToolbox
-
Free
-
Same graphical capability as VideoToolbox
-
Easier code than VideoToolbox
-
No GUI provided
-
Poor drawing functions
-
Sample code using PsychophysicsToolbox, by Y. Kamitani
LineMotion.m
Shimojo Lab Home
Caltech Home
written by Yukiyasu Kamitani, kamitani@percipi.caltech.edu
Last Modified: April 19, 1999