Matlab functions for Ifis fMRI Interface Summary The package of functions described herein execute from within Matlab on a Macintosh PowerPC to communicate with hardware components of IFIS, which is manufactured by Psychology Software Tools Inc. (PST). If you use the Psychophysics Toolbox to generate stimuli during a functional MRI experiment, then use this package of functions to record subject responses within Matlab and to align the record of those responses with the MRI scanner record. The accompanying hardware interface to IFIS consists of a National Instruments parallel digital IO card (model PCI-DIO-96). The enclosed functions include .mex files which control the National Instruments card and .m files which abstract out hardware details to offer a simple programming interface. Hardware Requirements This software operates at Vanderbilt University on the following hardware: PST IFIS, including "button response units." (subject response buttons). Macintosh G4 National Instruments PCI-DIO-96 parallel digital I/O card. MRI scanner. Contents of Package The following files are enclosed in the compressed download. Full documentation of functions is contained within those functions and available from Matlab help. See the FMRIdemo.m file for an example. The following is excerpted from the contents.m file contained in the package. % Miscellaneous files: % % FMRIdemo.m - simple experiment which demonstrates use of interface. % NiPS.m - graphical display of bit state and transitions. Useful for hardware debug. % RectCenter.m - a new psychtoolbox function used by FMRIdemo.m (in case you haven't upgraded). % CenterRectOnPoint.m - a new psychtoolbox function used by FMRIdemo.m (in case you haven't upgraded). % % The following top-level functions are intended to be called from scripts controlling % your experiment: % % InitializeFMRI.m - initializes the PCI-DIO-96 % GetButtons.m - reads the current state of the subject response buttons % WaitScanner.m - waits for the onset of the scanner, use to synchronize your reponse % button records with the MRI scans. % ButtonName - maps between button names and button codes. % % The following subordinate functions are used by the top level functions above. You shouldn't % need to call them directly from your experiment scripts. % % Board_ID.m % Board_ID.mex - returns the NI identification number of the board in a specified slot % % DIG_In_Port.m % DIG_In_Port.mex - reads the value of a port % % DIG_Out_Port.m % DIG_Out_Port.mex - set the value on a port (not used) % % DIG_Prt_Config.m % DIG_Prt_Config.mex - set the data direction of a port % % FindCard.m - finds the slot number of a specified card. % % NiDeviceName.m - maps between NI device names and numbers % Author This software was developed at the Vanderbilt Vision Research Center by Allen Ingling. Bugs As of December 1, 1999 National Instruments NiDAQ extensions were incompatible with some Macintosh G4s. Apple had offered two G4 motherboard designs, one with an AGP slot and one with only PCI slots. The NiDAQ extensions did not work on the newer AGP board, though National Instruments claimed at the time that a bug fix was on the way. The functions in this interface package should execute on any other Macintosh PowerPC computer with a PCI bus except for the AGP G4, though they have only been used here on a non-AGP G4. Update: Ben Singer reports that National Instruments has fixed the AGP G4 bug. Comments You might find parts of this package useful even if you are not doing FMRI, and if you do not have all the expensive hardware from PST. The .mex files which access the NI card could be adapted, for example, to read digital signals from button boxes other than those sold by PST. Package History 2/2/00 public release of version 1.00. 2/6/00 version 1.01 fixes bug: InitializeFMRI function fails to invoke normal mode if previously run in simulation mode. Download The authoritative and current version of documentation and software can be found at http://www.psychtoolbox.org/ The current version of this package as of 2/6/00 is 1.01 available in compressed archive MtbFMRIv1d01.sit.