From VISTA LAB WIKI
 Stimulus software: Wandell Lab
PsychToolbox, expTools, dmToolBox and cmToolBox
The retinotopic mapping stimuli (ret.m) and some LOC/FFA localizer stimuli (loc.m) run in Mac OSX using vistadisp. The localizer requires the image database from the KGS lab. The latest version is available here. To run either stimulus type, add the tools to the command path and type ret or loc in the matlab-commandline.
For retinotopy scans, you can specify all your parameters from the command line. This will allow you to prepare your stimulus in advance. Below is a typical example of running an 8-bar retinotopy scan (requires vistadisp tools and PsychToolbox).
% RUNME 4.7.2010 (re-tested 8/11/2010 with vistadisp revision #555) % create some default parameters params = retCreateDefaultGUIParams;
% modify them params.experiment = '8 bars with blanks'; params.fixation = 'dot with grid'; params.modality = 'fMRI'; params.savestimparams = 1; params.repetitions = 10; params.runPriority = 7; params.skipCycleFrames = 0; params.prescanDuration = 12; params.period = 192; params.numCycles = 1; params.motionSteps = 8; params.tempFreq = 2; params.contrast = 1; params.interleaves = ; params.tr = 1.5; params.loadMatrix = ; params.saveMatrix = ; params.calibration = '3T2_projector_800x600temp'; params.stimSize = 'max';
% run it ret(params)
 Triggers and calibration
In order to synchronize the stimulus-sequence with the fMRI acquisitions, the stimulus-program will provide a trigger that can start the fMRI scan. This is accomplished by the StartScan-function of expTools using the DAQ toolbox of Psychtoolbox, which gives a ~5V TTL pulse using the PMD-1208FS data acquisition device (daq) made by Measurement Computing. Pin 14 will give ~5V signal, pin 17 can be used as a ground.
A useful tool for controlling the monitor settings using the commandline is cscreen. This is especially useful when one monitor is in a different (scanner) room.
High quality display calibration, such as we use for HDR displays and engineering applications, has its own dmToolBox. This was written by Greg Ng with help from Joyce Farrell and Brian.
High quality camera calibration, such as we use for Nikon-D series calibration, has its own [cmToolBox]. This was written by Bharadwaj Srinivasan.
We are also developing an MR-compatible color LED stimulus device for projects that require high temporal frequency ganzfeld stimuli.
Our display tools are not intended for use with Windows. However, some users have succeeded in running the retinotopy code in vistadisp on Windows with a few modifications.
Specifically, these three functions must be placed in these locations on the vistadisp paths:
getDevices.m => \exptTools2\misc
DaqDeviceIndex.m => \toolbox\Psychtoolbox\PsychHardware\Daq
Priority.m => \toolbox\Psychtoolbox\PsychPriority
Currently, the functions can be found in vistadisp\trunk\windowsUtilities
 Stimulus software: KGS Lab
Although we keep expTools available on the lab stimulus laptop, it's a bit low-level for some uses. The general procedure for most experiments is to write code in Matlab using PsychToolbox, generate text scripts describing exactly the trial and image order to be used in a series of runs (usually using a function named along the lines of 'myExpt_makescript'), then have a separate function to run the scripts (usually named along the lines of 'myExpt_run' or 'myExpt_readscript').
Lately, we've been collecting useful tools in a directory called stimTools. A copy of this code is available on Rory's web page (for now), http://white.stanford.edu/~sayres/tools.htm.
We also keep an image data base (described in the above link). The accessor function categoryDirs will list where the images for a given object category (e.g. faces, animals, line drawings, women, men, famous) are stored. categoryImages will provide a list of all image files that fit the category description, and loadCategoryImages will load the images for you. First you need to have the file imageDB.m point to wherever you are keeping the ImageDB/JPG directory.
 Visual testing for color and field loss
 Munsell Book of colors
We have two brown leather volumes with these test papers in them. They should be kept with the Ishihara plates (below) and their location should be identified here.
 Ishihara Plates
We have a book with the Ishihara plates somewhere. Brian W. should find it and identify its location here.
A web version can be found here. Of course the accuracy is limited by the display, but it gives a general idea of how the test works and what each plate is meant to test. PDF instructions:
 Visual field testing
Hiroshi has a psychophysical method for visual field testing that Serge, Yoichiro and he developed. Please add some detail here.
 Using and calibrating the 10-bit Cambridge Research Box
 Lucas Center 3T #1
- Front LCD projector
If the subject is foveating at the middle of the screen, the largest stimulus size is about 14.5 degrees on either side (radius). Not the best quality of projection; in particular, if the mirror isn't well positioned or the focus is a little off, the subject may have problems maintaining vergence later in the session (e.g., see two fixation points).
- Back projector
Shielded LCD monitor in back of the 3T magnet room. You need to connect to your stimulus monitor via the five BNC connectors (red, blue, green, horizontal, and vertical), from the long cables connected to the monitor over to the leads in the corner of the magnet room by the pads and blankets.
- Both rigs: Stimulus synchronization
We synchronize our stimuli with the scanner at the start of each fMRI scan. The stimulus computer triggers the start of each scan. When using MacIntosh OSX we use the USB-1208FS data acquisition device and the DAQ Toolbox (see function StartScan.m in the expTools toolbox).
 Lucas Center 3T #2
- Back LCD Projector
The new 3T GE scanner at the Lucas Center has an LCD-projector towards the rear left of the scanner room, which projects through a mirror into the scanner bore. Preliminary measurements (ras, 08/2008) indicate the max eccentricity of a stimulus displayed on this is around 11° visual angle. The display is not calibrated, and has some spatial inhomogeneities where the image isn't always in focus throughout the image. It is sufficient to obtain reasonable retinotopies.
Andreas, Michael, Reno, and Alison made some measurements on September 16, 2009. We found that the viewing distance (for amr) was 32cm. The screen subtended 18.6cm across the horizontal, and 14cm across the vertical. This corresponds to about 32.5 degrees across, and 24.5 degrees vertical. These measurements are not completely precise. The spatial inhomogeneities mentioned above remain.
We have made another set of measurements on March 3, 2010. The viewing distance (eyes to mirror + mirror to screen, for ak) was 35cm, and the screen subtended 14cm across the vertical, corresponding to 22.6 degrees vertical.
 Lucas Center 1.5T
No displays left there now? Only used for anatomies?
 Brightside Display
We used to have a Brightside display. No more.
 Calibrating a display
In order to use a display for experiments in which the contrast, temporal frequency, and/or color of stimuli are carefully controlled, the display needs to be calibrated. This process measures the relationship between the intensity of the [R G B] color signals that are sent from a stimulus computer, and the resulting illumination produced by the display. Each combination of stimulus computer and display needs to have a separate calibration.
To check the location of calibration files and directories, type 'CalDataFolder' in the Matlab command window. This returns the path where psychtoolbox will look for display calibration files. Within this directory, there is a matlab file containing calibration variables, e.g., '3T_binoculars_800x600.mat'. There may also be a corresponding directory with the same name, but with the suffix "displayParams', e.g., '3T_binoculars_800x600displayParams'. This directory may contain a file called displayParams.m. Any fields set in displayParams.m will overwrite parameters set in the the .mat file when executing ExpTools applications. This is convenient, because the .m file can be easily modified, for example to change the viewing distance or screen resolution.
 Equipment needed
To run a calibration, you will need:
- A stimulus computer with MATLAB and PsychToolbox installed
- A display to calibrate
- A photometer (In the Wandell lab, we use an analog Photo Research PR650 photometer for most of our calibrations; ask around for where this is)
- A USB to Serial adapter (e.g., Iogear GUC232A which travels with the PR650)
- note that you may need to install the driver for this adapter
- A dark room
- A tripod or surface on which to position the photometer so that it is facing the display straight on
- Measuring tape to measure the display-photometer lens distance
- A couple of hours
The vistadisp repository contains the function vistaCalibrateMonitor.m that allows to calibrate a monitor using the PsychToolbox routines. Parts of the following instructions are not necessary if using vistaCalibrateMonitor. The function will walk a user through a calibration process. It was last tested on MacBook Pro running Leopard (OSX 10.5+).
 Steps in calibrating using PR650 photometer
PsychToolbox has--very helpfully--provided code to run an automated calibration with the PR650 photometer. The main function is called CalibrateMonitorSpd. You will first need to run the function pr650init to initialize the connection with the photometer. For this to work, you will also need to have the PR650 connected to your stimulus computer via a USB cable, and you will need Java working properly on the version of Matlab you are running.
 Set up the spectrophotometer
- Mount it on a tripod, and plug in the power-supply
- Connect it to the computer (Macintosh here) using a black cable with a bayonette connector on the photometer end, and a special RS-232 connector on the other end. On the RS-232 end, note the small toggle switch with two settings: ctrl and xfer. It must be set to ctrl to do the calibration.
- If it does not already exist, create a folder on the Matlab path called PsychCalLocalData. You can check where cal files are currently stored by calling the function 'CalDataFolder'. (If it returns PsychCalDemoData then you should probably make a new folder, as this can get overwritten when updating PTB.) Note that the VISTADisp toolbox contains its own CalDataFolder (PsychCalLocalData) and the files you're looking for may be there -- try adding VISTADisp to your path and running CalDataFolder again.
- Special requirements for scanner suite calibrations:
- The monitor/screen-box cart must be rolled near the door of the suite where it is visible to the photometer
- Use the same video cables for calibration as used to operate the display for scanning; if the cables must be extended for logistical reasons during calibration, the extensions must remain in place for subsequent scanning operation
- Cover the monitor and photometer with blackout cloth, and turn off as much room lighting as possible
 Run the calibration from Matlab
- Initialize the device
- At the Matlab prompt, type the commands
global g_useIOPort g_useIOPort = 0;
- Turn on the PR650. The screen should look like this:
PR-650 REMOTE MODE (CRTL) s/w V1.19 CMD b
- Initialize the serial port communication, in the matlab prompt type:
Psychtoolbox has two serial port communication toolboxes. Setting the variable g_useIOPort to 0 sets the serial toolbox to SerialComm (instead of the default which is IOPort). If this doesn't work, try setting g_useIOPort to 1 (which will switch back to the default toolbox).
The argument '1' in the call PR650init is the serial port number talking to the PR-650. The command should return something like this:
Opened device: '/dev/cu.PL2303-0000101D' Opened device: '/dev/cu.PL2303-0000101D' ans = 000
- Make a single test measurement. This is not necessary for calibration but allows to make sure things work before starting the lengthy calibration process. In the matlab prompt type:
- Make a full first calibration
For the first calibration of a display type in a matlab prompt:
The number of intensities to measure is determined by the variable cal.describe.nMeas in the CalibrateMonSpd.m file.
- Make a new calibration for a previously calibrated monitor
For subsequent calibrations, first oad a stored calibration file (created by CalibrateMonSpd) for example:
and then run the command:
- Device initialization debugging
- It is possible that the serial port number used is incorrect (PR650init(1)). In this case, use the matlab 'serial' command to determine the correct port number.
- If you do not get a return like the above, try running CMCheckInit to get a list of devices that matlab can see
- If matlab gets hung up on the initialize command, it could be because the meter is not in remote mode. Try power-cycling the photometer.
- If there is an error returned, the serial port number may be incorrect or the computer might not have the right driver installed for the USB->serial device.
- KGS lab: needed to change 2 lines in CMCheckInit.m (defPortString = 'PL2303-0000101D' (or whatever port was found) & comment out g_useIOPort = 1;)
 Help using calibration info
- Take a look at CalDemo.m and PsychCal.m
 Vendors and Part Construction
 Bite bars
a) Applied Science Laboratories www.asleyetracking.com b) The University of Houston College of Optometry http://www.opt.uh.edu/uhcotech/headspot/bitebuddy.cfm c) Stevenson Industries 881 Alma Real Dr. Suite 310 Pacific Palisades, CA 90272-2168 phone (310_ 206-9393 fax : 310-459-1575 "CPAP/PRO boil n' bite mouthpiece insurance product code: A7034 diagnosis code: 780.53 fed ID: 95-254-2635
Instructions for building one from Prof. Thomy Nilsson:
For an adjustable holder see: Nilsson, TH (1983) Observer positioning device. Behav. Res. Meth. & Inst., 15, 106.
For the actual bar, I recommend using 3/8" stainless steel with 2 large holes at one end for molding the wax onto the bar. Autoclave for use with another observer. reuse. I've found that uv light is best for sterilizing after each use. Build an over/under box to hold two lamps - eg. Edmund A53-681 with with A53-683 bulbs, or just buy the bulbs and rig your own bulb holder & supply. A 5 minute timer is good for leave-and-go.
Some people warned me off using bite bars altogether. A good alternative would seem to be a nose rest that the subject would use in addition to a combined head and chin rest. e.g. Arrington Research http://www.arringtonresearch.com/qcframe.html