Programs for Visual Psychophysics on the Amiga: a Tutorial
Total Page:16
File Type:pdf, Size:1020Kb
Behavior Research Methods. Instruments. & Computers 1989, 21 (5), 548-563 Programs for visual psychophysics on the Amiga: A tutorial STUART ANSTIS York University, North York, Ontario, Canada and MICHAEL PARADISO Smith-Kettlewell Eye Research Foundation, San Francisco, California A typical psychophysical experiment presents a sequence of visual stimuli to an observer and collects and stores the responses for later analysis. Although computers can speed up this process, paint programs that allow one to prepare visual stimuli without programming cannot read responses from the mouse or keyboard, whereas BASIC and other programming languages that allow one to collect and store observer's responses unfortunately cannot handle prepainted pic tures. A new programming language called The Director provides the best of both worlds. Its BASIC-like commands can manipulate prepainted pictures, read responses made with the mouse and keyboard, and save these on disk for later analysis. A dozen sample programs are provided. Psychophysics is much easier with the aid of graphics Arts). Methods for using DPaint in visual psychophysics on a home computer (Cavanagh & Anstis, 1980), and the have been described in an earlier article (Anstis, 1986). Commodore Amiga is one of the best home computers The latest version (DPaint ill) also permits page-flipping for colored graphics. The Amiga has some advantages animations. over the more expensive Macintosh II, in that it can hold A new program greatly increases the usefulness of the many more pictures in memory to enable page flipping. Amiga. This is The Director (The Right Answers Group, The Amiga has only 16 gray levels (4 bits per gun per Box 3699, Torrance, CA 90510, (213)-325-1311). Es pixel), whereas the Mac IT has 256 (8 bits), but any Mac sentially the program provides a BASIC-like language for picture must be specified in the full 256-color format manipulating the pictures produced by DPaint, including whether you want it or not, which uses up 640K of whole and partial-screen page flipping, turning on and off memory, so only one whole picture can be stored at a the DPaint facilities such as transparency and color cy time, which rules out rapid page flipping. By specifying cling, collecting responses from the subject in the form Amiga pictures with only the number of colors one really of inputs from the mouse and keyboard, and SAVEing needs (2, 4, 8, 16, or 32), one can squeeze up to 50 pic these to disk for later analysis. These abilitiesmake DPaint tures into 5l2K of RAM. Pictures can be flipped and and The Director an ideal combination for running moved around rapidly with the Amiga's built-in blitter psychophysical experiments. It is also worth buying The (block image transfer) chip. Although there are some ex Director Toolkit, a disk that is sold separately but cannot cellent paint programs for the Mac II, including the be used on its own. remarkable Studio/8 (published by Electronic Arts, 1820 An Amiga 500, 1000, or 2000 is necessary, with two Gateway Drive, San Mateo, CA 94404), there is nothing floppy disk drives: the internal drive known as dID:, and available like The Director to manipulate them within a an external drive, dfl:. Some extra RAM memory is psychophysical program. Add-on boards such as the preferable as well. A hard disk (dh.) is convenient but NuVista make the Mac II very powerful but also very ex not essential. It is best to buy rather than borrow the pro pensive. The inexpensive Amiga offers many of the gram disks, since apart from ethical considerations it is graphics features of the Mac II for a fraction of the price. essential to own and study the manuals. One should make Visual stimuli can be painted on the Amiga screen with working copies of the DPaint and Director disks and write the commercial program DeLuxePaint II (henceforth protect them by moving the tag in the comer of the disks. called DPaint for short; also available from Electronic Thisarticle is not a substitute for the manuals that come with the programs. The reader is assumed to have some This work was supported by Grant A 0260 from the Natural Science familiarity with the Amiga and with DPaint; if not, one and Engineering Research Council of Canada (NSERC). Thanks to Shin should study them beforehand. The programs listed here Shimojo, to Dorothy Kleffner, and to Maureen Reed for criticizing the will help introduce one to The Director, but the manual manuscript. The authors have no personal or fmancial interest in any should always be consulted along with the information of the commercial products mentioned. Correspondence should be ad dressed to Stuart Anstis, Department of Psychology, York University, presented here. Proficiency will come only from careful 4700 Keele St., North York, Ontario M3J IP3, Canada. study and practice. Copyright 1989 Psychonornic Society, Inc. 548 VISUAL PSYCHOPHYSICS ON THE AMIGA 549 This article does two things. For graphics and anima serve space when pictures are stored in RAM memory tion, the main strengthsof The Director, it providessim and also when stored on disk.1 ple workingprogramsthat willguide the user. !hese can SAVE this 4-color blank screen under the name be modified at will, but for a full understanding of the "blank4." Notethat "blank4" hasa 4-eolorpalette, while graphics functions one should work through the manual. "blank32" has a 32-color palette and must be used In areas where The Director is not so strong-the han whenever any other 32-color pictures are also loaded. dling of strings, keyboardinputs, data, and files-s-this ar Return to the DPaint paintingscreen, still with a 4-color ticle provides more extensivecoverage in order to adapt palette, and select the color red and the 5 x 5 square as The Director specifically for use in psychophysical ex the brush. Hit F9 (top right of keyboard) to get rid of the perimentation. top menubar and click down a red square at the extreme The following programs are included: top left corner of the DPaint screen. Put a I-pixel black dot in the middleof the red square. SAVEthis screen to showpix Moves pictures around on the screen. dfl :pix under the name "spot." Make sure that it is Muller A staircase procedure to measure the SAVEdintothe pix directory; that is, inthe SAVEdialog Muller-Lyer illusion. box, type "dfl:pix" in the Drawer box and type "spot" fillarray Accepts keyboard input. in the File box. Then click on the Save box. Returning saveinput Saves keyboard input to disk. to the DPaint screen, some diagonal gratings will now readinput Reads data from disk. be drawn. Clearthescreento black,select the white color, savenumbers Saves keyboard input on disk. the 3 x3 square brush and the straight-line tool, and set (mean&SD A BASIC program to calculate means the Grid to 4 x4. Draw a 45° diagonalgratingof equally & SDs.) spaced black and white lines sloping down to the right readnames Reads picture names from disk. (from 10o'clock to 4 o'clock) coveringthe entire screen. mousepalette Mouse controls palette colors. Hit FlO to hide the menu bars and ensure that the stripes keypointer Keyboard controls a pointer on the cover these regions too. SAVEthis gratingto dfl :pix un screen. der the name "surround." Set the background color to aspect.ratio Complete experiment on peripheral red (to tum off the transparent feature) and pick up the acuity. entiregratingwiththe brushselection tool. Reverseit left to-rightbyhittingthe X key and print it down. This gives Getting Started a grating sloping down to the left, from 2 o'clock to 8 DPaint II or The Director should always be in the in o'clock. ternal disk drive; the program disk should be in the ex SAVE this to dfl :pix under the name''target. " With ternal drive. First, the Workbench disk shouldgo intothe the transparency still turned off, pick up a random rect internal diskdrive (dID:) and a new, unformatted disk into angle, sayabout 1 in. wideand 2 in. high, withthe brush the external drive (dfl:). Initialize the disk in dfl:. The selection tool. Hit X to reverse it left-to-rightand print program disk can be given any name desired. Drag to it it down in a random position. Continueto pick up rect a copy of the Empty drawer from the Workbench disk. angles of random sizesand shapes, reverse them,andprint Rename this drawer from "copy of Empty" to "pix". themdownin randompositions, untilyou havean irregu Drag a copy of the CLI (Command Line Interface) icon lar zigzag pattern over the whole screen. SAVE this to fromtheWorkbench to the programdisk. TheWorkbench dfl :pix under the name "mask." Finally, CLEAR the diskshould nowbe removed andDPaintinserted intodID:. screen again and draw a Muller-Lyer arrow figure, ex Now some sample pictures are going to be SAVEd on actly as shownin Figure 1. Tum on the coordinates from the program disk for use in the Director programs the DPaint Preferencesmenuto ensurethat the x, y coor described below. Drag the icons of the pictures called dinates of your drawing are exactly correct. SAVE this Seascape, Moondance, and Starflight from DPaint into 4-color picture to dfl :pix as "arrow." the pix drawer on the programdisk. (Note:Differentver To checkthat all the picturesare correctly saved, click sions of DPaint may provide differentpictures on the art SAVE again in the leftmost DPaint menu. In the SAVE disk-earlier versionsmayhave KingTut, Waterfall, and dialog box, something like this should appear: Starflight. If so, use these; it does not matter which demonstration pictures one uses. Simply remember to Parent(dir) change the picture names in the programs.) Now open pix(dir) DPaint, setting the resolution to lo-res and the number Clickingon pix(dir)shouldgive, in alphabetical order: of colors to 32.