Tips: How To

by Denis Pelli

VideoToolbox
PsychToolbox
Tips
 
speed
displays
how to
mac software
bibliographies

visitors since September 17, 1996.
7 March 2001

HOW TO:


HOW TO USE THE KEYBOARD FROM FAR AWAY

HOW TO MAKE A USB DEVICE

HOW TO FIND PCI CARDS

HOW TO ADD AUDIO PORTS

The following is reproduced from MacInTouch (1/25/98):

"The latest MacInTouch column in MacWEEK talks about audio glitches in standard PowerMac hardware. Channel D Software has a page describing ground-loop hum. Readers noted Mac audio cards from:

  1. Digidesign
  2. Ensoniq
  3. emagic (Audiowerk)
  4. Korg
  5. Sonic Solutions

Another resource is the unofficial Deck II site. Lucid Audio's NB24 NuBus card offers an S/PDIF digital interface for audio recording with digital sound sources, including external A-D/D-A converters (see the FAQ for compatibility notes). Event Electronics has attractive PCI cards for Windows systems and has been promising Mac support, but apparently hasn't ever delivered the Mac drivers."

HOW TO MEASURE SLOW PHYSIOLOGICAL PARAMETERS

Marilyn Mendolia, writes (12/13/98), "Several weeks ago I contacted the MacPsych list and asked for recommendations for data acquisition hardware and software to monitor skin conductance, heart rate, and facial EMG. In my note, I expressed a preference for a Macintosh-driven psychophysiology laboratory. ... A summary of the information I received is attached to this note.

BIOPAC was recommended by five people. Their comments were very positive, but general in nature. However, two people expressed concern regarding the expertise of the technical support staff. Regarding web-based support, I visited the BIOPAC website and was impressed with the availability of technical and application notes. I also previewed a lesson from the Student Laboratory Manual; the BIOPAC materials appear to be well suited for training and classroom use.

PowerLab formerly (MacLab) was recommended by seven people. Their comments were very enthusiastic. The interface was described as intuitive (a turnkey operation) and a good choice for teaching laboratories. Furthermore, the system can handle electrode transducers and amplifiers that you may have. The external package for HR (to calculate interbeat interval) was favored and the GSR equipment was described to be excellent. Data files can be easily transported to SPSS. As for user concerns, one individual was dissatisfied with technical support and another individual stated that the measures were unstable (it seems that participants have to remain absolutely still or the probes lose their connection).

National Instruments (LabView) Two individuals reported using LabView (one with Coulbourn equipment and the other with Grass). One person was extremely pleased with the power of LabView. The other individual, however, seemed frustrated with the steep learning curve required to develop LabView programs.

CB Sciences was mentioned, but I did not receive any evaluative comments.

Other information - Someone suggested impedance cardiography rather than heart rate. I have listed a few hardware and software equipment vendors.

Minnesota Impedance Cardiograph
Instrumentation for Medicine
150 Mason St., Box 1408
Greenwich, Conn. 06830
203-661-1644

Sorba Impedance Cardiograph
Sorba Medical Systems
SORBA Medical Systems, Inc.
120 Bishops Way, Ste.164
Brookfield, WI 53008-0951
sorba@execpc.com
414-827-2740

Cardiac Output Program (for Windows) - For Use with Impedance Cardiography
Instrumentation
Microtronics Corp of Chapel Hill, NC
http://www.microtronics-nc.com/COPWIN.htm

(Source: 12/13/98, MacPsych)

MONITORING EYE MOVEMENTS

HOW TO LOAD THE CLUT ON A VIDEO CARD WITH MORE-THAN-8-BIT DACS

ABSTRACT Handling of more-than-8 bit DACs is not fully standardized in Apple's scheme. All the cards have a 256-entry CLUT that holds 10-bits per DAC. (There are some 9-bit DACs cards out there too; what I'm saying about 10-bit DACS should apply to any more-than-8 bit DAC cards.) Some cards, like the DOME, use a 1024-entry 10-bit gamma table (i.e. 10 bits in and 10 bits out). Some cards, like the Radius, use a 256-entry 10-bit gamma table (i.e. 8 bits in and 10 bits out). When you call cscSetEntries to load the CLUT the 16-bit values you supply are transformed by the gamma table before loading into the actual hardware CLUT. In vision-research applications we usually load an identity gamma table, and forget about it, using just the cscSetEntries call to load the CLUT. Drivers for 8-bit cards use the top 8 bits of the 16-bit values suplied to cscSetEntries. The DOME driver uses the top 10 bits. However, the Radius driver reads only the top 8 bits of the 16-bit colors you specify to cscSetEntries, so, to specify the full 10-bit DAC values you have to call cscSetGamma. Note that calling cscSetGamma does not trigger the driver to reload the CLUT (on any video card). The new gamma table merely affects subsequent calls to cscSetEntries, which do load the CLUT. Only the software, the video driver, knows about the gamma table, which it uses to transform the colors in your cscSetEntries call before sending them to the video card's CLUT. Thus, in the scheme adopted by Radius, to load a new set of 10-bit values into the CLUT you must make two calls, cscSetGamma and cscSetEntries, instead of just calling cscSetEntries. Hopefully the cscSetGamma call is quick (doesn't wait for blanking), so this scheme may yet allow loading a new CLUT for each frame.

Many people bought the Radius Thunder video cards (for Macintosh), which have 10-bit DACs. (Radius Thunder's bus interface is very slow, about 5 MB/s, making it a poor choice for movies. The ThunderPower cards also have 10-bit DACs and are fast, abou 30 MB/s.) The 10-bit DACs are a plus, but loading the CLUT is tricky. The following explanation specifies the Radius Thunder with 10-bit DACs, but it applies to most of the more-than-8 bit video cards for Macintosh computers.

It's important not to confuse pixel size (1, 2, 4, 8, 16, or 24 bits, which you typically set in the Monitors control panel or SCREEN OpenWindow) with the DAC size, which is 8 (most common), 9, or 10 bits. The DAC size cannot be changed. The stand-alone application TimeVideo and the MATLAB program ScreenTest (which uses SCREEN Preference ClutDacSize) both report the DAC size for each of your video cards. [SCREEN and ScreenTest are part of the Psychophysics Toolbox for MATLAB.]

The Radius Thunder card has three 10-bit DACs, one for each color channel: R, G, and B. Each DAC is driven by a corresponding 10-bit output of the video card's hardware Color LookUp Table (CLUT). The CLUT holds 256x3 10-bit numbers. The way that the pixel data are fed into the CLUT depends on the pixel size, but the CLUT itself is always the same size, and the commands that affect the CLUT are essentially independent of the pixel size.

You control what goes into that CLUT by two low-level graphics driver calls:

With most video drivers (all of those with 8-bit DACs) it is most convenient to load the gamma table with an identity transform and use just cscSetEntries to control the CLUT.

With more-than-8-bit-DAC video drivers like the Radius Thunder it's easier to pass an identity transform to cscSetEntries and change the gamma table to control the CLUT. However, note that the driver does nothing to the hardware when you pass a new gamma table, it updates the CLUT only when you call cscSetEntries. So this scheme requires two calls every time you want to change the CLUT.

Most video cards have 8-bit dacs, but some have more-than-8 bit dacs. Every video driver identifies the number of significant bits in the DAC; it's the value of gDataWidth in the gamma table returned by a cscGetGamma Status call to the driver. (You can use GDDacSize() in GDVideo.c.) Apple, forseeing the possibility of more-than-8-bit dacs, specifies colors as RGB triplets, in which r, g, and b each get 16 bits. The cscSetEntries Control call passes these 16-bit values to the driver, which loads the CLUT (after gamma correction). The cscGetEntries Status call allocates 16-bits for the values returned by the driver, which reads the CLUT. Most video cards have only 8-bit dacs and store only the most significant 8 bits. They typically return that 8-bit value in both the upper and lower 8-bits of the 16-bit field. This spreads out the 256 values to span the entire 16-bit range, from 0x0000 to 0xFFFF.

HOW TO USE A MACINTOSH SERIAL PORT (AND DEBUG THE CABLE)

HOW TO USE A MACINTOSH SERIAL PORT FROM MATLAB

HOW TO USE A MACINTOSH SERIAL PORT FROM APPLESCRIPT

HOW TO USE A MACINTOSH SERIAL PORT FROM C

That's the old way, using the Device Manager and a serial driver. As of 1996, Apple said the new way would be to use Open Transport, but Open Transport isn't available under Mac OS X, so it's hard to imagine why one would want to do this.

HOW TO ADD SERIAL PORTS

HOW TO ADD A JOY STICK

HOW TO CONNECT CHEAP PC PERIPHERALS (& OTHER STUFF) TO YOUR MAC

HOW TO CONTROL APPLIANCES

HOW TO USE A RADIO SHACK DIGITAL MULTIMETER

HOW TO CALIBRATE A MONITOR: PHOTOMETERS

HOW TO CAPTURE AUDIO AND VIDEO IN SYNCH

Michael Rosenstark writes (7/97), "Here's how to sync audio to picture, given the track layout of video-audio/dialog-audio/SMPTE on a standard Hi-Fi VHS tape. Get a capture card that has an audio chipset built-in, such as the Miro DC30 (by the way, you can get these cheap from PowerComputing if you bought your machine from them, even if you got it way back when), and capture audio (both tracks) and video at the same time. Then just export the audio portion of the resulting Quicktime movie to a stereo AIFF file, and open that file within your audio editor. Since all of this takes place on your computer in the digital domain, you shouldn't experience any sync or drift problems. Think of it like this: when the video/audio tracks are being captured, they're locked to ONE ANOTHER, as they're being captured at the same time, so there's no sync problem there. When you export the audio, one track is sync and the other dialog, and they're both getting exported to AIFF format simultaneously, so there's no sync drift there either. And that's it."

HOW TO PRINT CALIBRATED IMAGES ON PAPER OR TRANSPARENCY

YiXiong Zhou asks, "have you ever calibrated transparency or printing paper?"

Yes, John Robson and I did that when producing the Pelli-Robson chart. It's hard. The problem is that the printing industry universally assumes that invisible errors are negligible, whereas psychophysics is affected by these errors.

Laserwriters (pennies per page) vary a lot with amount of toner in the cartridge, across the page and from page to page. Linotypes ($8 per page) use a laser to expose photographic paper or transparency film, which is pretty well controlled, except that the developing solution is poorly controlled, so that density is strongly dependent on how long it's been since the developer was last replenished. Halftone printing (to print many copies) has variations over the page and over time; it's hellish to control to psychophysical standards.

For producing a few images, you can do quite well by calibrating the output of a Linotype just before printing your final copies. You should be able to find a Linotype by looking in the Yellow Pages for "Graphics Printing", or something like that. It's usually easier if you bring your own computer with you and connect it to their network and print directly from your machine. You will need to create test patterns, and you'll need an appropriate densitometer (reflection or transmission), which cost one or two thousands of dollars. The graphics workshop might have one they'd let you use in-house.

GREEN LASER DIODE

"CASIX, Inc. is pleased to announce its Green Diode Laser module. This is a 808 nm laser diode pumped packaged with two crystals bonded together (Nd:YVO4 and KTP), resulting in an output wavelength of 532nm. The package is small (10 mm diameter and 10 mm high), very stable and easy to mount. The output power is 1 to 5 mW with a beam divergence of less than 10 mrad (1/e2) operating in a TEM00 (80%) mode."

CASIX, Inc.
P.O. Box 1103, Fuzhou, Fujian 350014, P.R. China
Tel: +86- 591-362 1246
Fax: +86-591-362 1248
http://www.CASIX.com