Table of Contents

Name

dig - digitize EEG into ERP continuous data format (ERP DOS programs)

Synopsis

dig hdrfile logfile rawfile | -l condcode [options]

where

hdrfile    
(an input file) is the name of the digitization header file made by mdh(2) or modified by edhead(1) . The convention is to use ".hdr" as the extension.
logfile    
(an output file) is the name of the event logging file to be created. The convention is to use ".log" as the extension.
rawfile or -l
(an output file) is the name of the raw EEG data file to be created. The convention is to use ".raw" as the extension. If -l is specified instead of a file name, only a log file will be created and no raw EEG data file will be created (which may be desireable when collecting only behavioral data).
condcode    
The initial condition code to use (usually 1). The condition code can be changed during the run of the program.

Description

dig is the EEG digitization program in the pair of programs that conduct data collection in the Kutas lab (the other program in the pair is stimpres(2) , the stimulus presentation program). On initialization dig reads parameters such as channel descriptions, sampling rate, and experiment descriptions from hdrfile, sets up the A/D hardware and data headers for the output files accordingly, sets up the I/O hardware for communication with the stimpres(2) program and devices such as response boxes, sets up the color monitor to display the EEG traces and the monochrome monitor as the program control and status display, then awaits commands (that are listed on the control display, and described below) from the experimenter.

Options

-ge startcode endcode
This is a special purpose option that directs dig to automatically generate digital events in the following manner. startcode and endcode are digital event codes that dig is to look for on any of the digital input ports. dig monitors incoming event codes. If it sees startcode, it begins generating sequential event codes with startcode+1, startcode+2, and continuing to increment until the value endcode-1 is reached. These event codes are emitted on every sample, and restart at startcode+1 if they reach endcode-1. If the dig program sees endcode on one of its input ports, it stops generating the sequential event codes. This option has been useful in certain analyses involving saccades, where it is useful to have an eventcode concurrent with every sample of EEG data.
-ignorebbp2
(This option applies only to dig computers that use baseboard cards for I/O, which in the Kutas lab are those in the white room and the training room.)

During initialization dig checks each input port of the Baseboard I/O card and issues a warning on error, which usually indicates there is no cable connected to the port. This option directs dig to ignore Port 2 - not checking it during initialization, and not checking it for incoming codes during digitization. This option probably shouldn’t be used in a typical dig/stim configuration because in such setups Port 2 should be connected to the response box.

-ignorebbp3
(This option applies only to dig computers that use baseboard cards for I/O, which in the Kutas lab are those in the white room and the training room.)

During initialization dig checks each input port of the Baseboard I/O card and issues a warning on error, which usually indicates there is no cable connected to the port. This option directs dig to ignore Port 3 - not checking it during initialization, and not checking it for incoming codes during digitization. In a typical dig/stim configuration there is nothing connected to Port 3 so this option may be used to prevent the initial checking of the port and thus the warning message from appearing (but if this option isn’t given dig will still ignore the port after it fails the initial check).

Operation

Upon starting, dig will display some initial information on the monitor, including the subject name (from hdrfile), the sampling rate, and the names of the log and raw files to be created. If either the logfile or rawfile already exist, dig prompts for permission to overwrite the file. Finally dig asks "Do you wish to continue?" Typing ’y’ at this point tells dig to create the log and raw files, and initialize all of the hardware necessary for the performing the analog/digital conversion of the data, eeg display, etc.

dig displays control and status information on the monochrome monitor, and displays EEG on the color monitor. This information includes the sampling rate, the display scale factor, the elapsed digitization time (the elapsed time clock only advances when dig is in the "RECORDING" state, i.e., recording to disk), the names of the log and raw files, the Remaining RAM Time, the size of the raw file, the diskspace remaining, the current condition code, and the "state" of the digitizer: either PAUSED or RECORDING. There is also a menu of commands at the center of the control monitor Some of these information items need further description in order to be understood:

Recording State

At any given time, dig is in one of two states: "PAUSED" or "RECORDING". When in the Paused state, the word "PAUSED" will appear on the left side of the control monitor, and will be blinking. In this state, the digitizer does not record EEG to disk, but it does display the eeg. In order to conserve disk space, it is important to Pause the digitizer whenever the EEG data is to be ignored, for example, when the subject is taking a break. When in the Recording state, the word "RECORDING" will appear on the right side of the monitor. In this state, the data is being recorded to disk.

Remaining RAM time

dig records EEG data to files on a RAM disk, and transfers this data to the hard disk whenever the dig program enters the PAUSED state. As there is a finite amount of RAM available on the digitization computer, there is a finite amount of time during which you can collect EEG data between pauses. When you have less than 1 minute of recording time left on the RAM disk, dig displays a warning message. Once you have less than 10 seconds of recording time left on the RAM disk, dig will automatically enter the pause state so that it can copy the RAM disk files to hard disk. Once the RAM files are copied to the hard disk, the entire RAM disk space is once again available for recording. A typical digitization computer would be configured to have approximately 30 minutes of data collection time when recording 32 eeg channels at 250 Hz. This would be cut to 15 minutes for 64 channels. This being the case, experiments should be designed to give subjects breaks every 5-10 minutes, which seems to be typical.

Raw File Size and Disk Space Remaining

The Raw File Size is the current size in bytes of the raw file on the hard disk. Note that the reported size does not increase until the digitizer is Paused and the data on the RAM disk is copied to the hard disk. Disk Space Remaining is the number of bytes of free disk space remaining on the hard disk partition where the raw file is being written. Note that the Disk Space Remaining only decreases when the digitizer is put in the Paused state and the data on the RAM disk is copied to the hard disk. It is very important to make sure you have sufficient hard disk space for your raw and log files before you even begin collecting data.

Command Menu

The following commands are displayed on the control monitor. Note that all of the commands are invoked by typing one letter, except for the end program which consists of the combination of the CTRL key and the End key. The commands keys are all upper case in order to minimize the accidental invocation of any of the commands (you must press the shift key and the appropriate command letter, unless of course you have CAPS LOCK on, which is not recommended).

R | begin recording data
Available when dig is in the Paused state. Begins recording eeg data and event code data to the raw and log files.
P | pause recording data
Available when dig is in the Recording state. Pauses recording eeg data and event code data to the raw and log files. All data on the RAM disk is copied to hard disk, making all the RAM disk space available for more recording.
C | change condition code
Pauses the digitizer (if not already paused) and prompts for a new condition code. The Condition code is stored in the log file, and is described in the documentation on the Continuous Data Digitization System and the Log File Format. Some ERP programs (e.g. normerp) expect to find calibration data in condition code 0.
+ | increase eeg plot scale
Doubles the scale factor for EEG display.
- | decrease eeg plot scale
Halves the scale factor for EEG display.
E | stop displaying event codes.
Normally, the digital event codes are displayed above the EEG traces. This takes up some processing time for the computer and can be especially taxing on the system when using the -ge option to generate event codes for every eeg data sample. Pressing E stops dig from displaying the event code, although dig will continue to display a small vertical line above the EEG traces whenever a digital event is detected.
Z | zoom in/out on 1 EEG trace.
Pressing Z will cause a yellow selection box to appear around one of the traces on the EEG display. The box is moved from one EEG trace to another by pressing the arrow keys. Pressing the Enter key causes dig to "zoom" in on the selected trace. Pressing the Z key again will display all the EEG traces.
S | toggle power spectrum display
dig can display both EEG data and frequency spectrum data. Pressing the S key toggles the display between these two modes. Viewing the frequency spectrum can be useful in determining the cause of noise on particular EEG channels.
A | toggle auto cal pulse detection
This auto calibration feature detects sudden changes in voltage in the eeg signal and emits event code 1 when those voltage changes are detected (useful in dig/stim systems that don’t have a stimpres(2) -triggered cal box, but rather use the amplifier’s own calibration feature for recording cal pulses).
CTRL-END | end digitizer program
This terminates the dig program.

Configuration Files

A typical dig user may not need to read this section, the information is more relevant to a person installing dig or setting up the dig computer.

On startup dig reads the configuration file C:\ETC\DIG.CFG, an ASCII file with contents that look like this:


    [SECTION-NAME]
    Section specific commands/parameters
    [SECTION-NAME]
    Section specific commands/parameters.

DIG.CFG is designed to be extensible as new features are dreamed up and added to the program. Currently, the only section is the [RAMDRIVE] section, which gives the root directory of a RAMDRIVE. The dig program collects data to a RAMDISK in order to enhance performance. Whenever the program is paused, data is copied from the RAMDISK to the hard disk.

The Keithley Metrabyte version of dig also requires the configuration file C:\ETC\DAS1800.CFG.

Hardware

A typical dig user may not need to read this section, the information is more relevant to a person installing dig or setting up the dig computer.

dig (as of this writing--December 1996) has been implemented with one hardware configuration only, though plans are in place to implement it with more configurations.

The current hardware needed to run the dig program consists of:

Keithley Metrabyte DAS-1802HC A/D card.
This is a 64 channel A/D card for the ISA bus. It comes with manuals describing its installation. The dig program uses its default set up, which is:    

I/O Address:    0x320
DMA Channels:    5 and 6
IRQ:        10
Channel Mode:    Bipolar
Channel Cfg:    Single-ended
Number Chans:    64

The Keithley Metrabyte libraries expect to find the configuration file, das1800.cfg, which comes with the cards software disk, in the directory c:\tc

The manuals that come with the DAS-1802HC card describe the pin-out for the input connector. Here is the pin-out of a cable used to connect 2 Nicolet Amplifiers to the DAS-1802HC via the Kiethly Metrabyte CONN-1800 connector board. This unusual cable consists of 2 50 pin Centronics connectors on one side and 4 37 pin D-Sub connectors on the other. The 50 pin Centronics connectors each connect to one of the Nicolet Amplifier outputs, and the 37 pin connectors connect to the 4 37 pin connectors on the CONN-1800. The 2 50-pin Centronics connectors are referred to as C1 and C2. The 4 37-pin connectors are referred to as J1, J2, J3, and J4.



    Conn Pin    Conn Pin        Conn Pin    Conn Pin
    ---- ---    ---- ---        ---- ---        ---- ---
     J1  11 -------- C2  29             J3  11 -------- C2  37
     J1  12 -------- C2   4             J3  12 -------- C2  12
     J1  13 -------- C2  28             J3  13 -------- C2  36
     J1  14 -------- C2   3             J3  14 -------- C2  11 
     J1  15 -------- C2  27             J3  15 -------- C2  35
     J1  16 -------- C2   2             J3  16 -------- C2  10 
     J1  17 -------- C2  26             J3  17 -------- C2  34
     J1  18 -------- C2   1             J3  18 -------- C2   9
     J1  29 -------- C1  23             J3  19 -------- C2  23
     J1  30 -------- C1  29             J3  30 -------- C1  37
     J1  31 -------- C1   4             J3  31 -------- C1  12 
     J1  32 -------- C1  28             J3  32 -------- C1  36
     J1  33 -------- C1   3             J3  33 -------- C1  11 
     J1  34 -------- C1  27             J3  34 -------- C1  35
     J1  35 -------- C1   2             J3  35 -------- C1  10 
     J1  36 -------- C1  26             J3  36 -------- C1  34
     J1  37 -------- C1   1             J3  37 -------- C1   9
            
     J2  11 -------- C2  33             J4  11 -------- C2  41
     J2  12 -------- C2   8             J4  12 -------- C2  16
     J2  13 -------- C2  32             J4  13 -------- C2  40
     J2  14 -------- C2   7             J4  14 -------- C2  15 
     J2  15 -------- C2  31             J4  15 -------- C2  39
     J2  16 -------- C2   6             J4  16 -------- C2  14 
     J2  17 -------- C2  30             J4  17 -------- C2  38
     J2  18 -------- C2   5             J4  18 -------- C2  13
     J2  29 -------- C1  48             J4  19 -------- C2  48
     J2  30 -------- C1  33             J4  30 -------- C1  41
     J2  31 -------- C1   8             J4  31 -------- C1  16 
     J2  32 -------- C1  32             J4  32 -------- C1  40
     J2  33 -------- C1   7             J4  33 -------- C1  15 
     J2  34 -------- C1  31             J4  34 -------- C1  39
     J2  35 -------- C1   6             J4  35 -------- C1  14 
     J2  36 -------- C1  30             J4  36 -------- C1  38
     J2  37 -------- C1   5             J4  37 -------- C1  13 

Scientific Solutions Baseboard.

This is a I/O card for the ISA bus that includes 4 parallel ports. It is used to read digital events (triggers). Ports 1-3 are initialized as input, and port 4 is initialized as output. The output port is intended to be connected to a Stimulus-Presentation Computer typically running VVSP or CAVSP, which requires response input (e.g. response buttons) when using its response contingency features (read the stimulus presentation program manuals for more details on the response contingency features). At startup, the dig program checks to make sure the strobe line on each of the 3 input ports is in its inactive state. Dig requires that at least input port 1 pass this test, and exits with and error message if it is not. If ports 2 or 3 do not pass this test, they are simply flagged as not in use and are ignored for the run of the program.

The Baseboard is left at the factory default setting of 0x210 for base I/O address. The Baseboard is used in a polling mode for the dig program, thus soldering for selecting an IRQ level is not needed.

Here is a diagram of the cables needed for using the Baseboard in this application.

        40 Pin Connector Pin Orientation

            40 Pin Connector
            1    21
            2    22
            3    23
            4    24
            5    25
            6    26
            7    27
            8    28
            9    29
            10    30
            11    31
            12    32
            13    33
            14    34
            15    35
            16    36
            17    37
            18    38
            19    39
            20    40

    Input Cable Pin-Out            Output Cable Pin-Out
    
       DB25F           40-Pin Female       DB25F           40-Pin Female
    Pin  Function    Pin  Function        Pin  Function    Pin  Function
    1    Bit 0------21   Line A0        1    Bit 0------21   Line A0
    2    Bit 1------22   Line A1        2    Bit 1------22   Line A1
    3    Bit 2------23   Line A2        3    Bit 2------23   Line A2
    4    Bit 3------24   Line A3        4    Bit 3------24   Line A3
    5    Bit 4------25   Line A4        5    Bit 4------25   Line A4
    6    Bit 5------26   Line A5        6    Bit 5------26   Line A5
    7    Bit 6------27   Line A6        7    Bit 6------27   Line A6
    8    Bit 7------28   Line A7        8    Bit 7------28   Line A7
    9    Bit 8------13   Line B0        9    Bit 8------13   Line B0
    10   Bit 9------14   Line B1        10   Bit 9------14   Line B1
    11   Bit 10-----15   Line B2        11   Bit 10-----15   Line B2
    12   Bit 11-----16   Line B3        12   Bit 11-----16   Line B3
    13   Bit 12-----17   Line B4        13   Bit 12-----17   Line B4
    14   Bit 13-----18   Line B5        14   Bit 13-----18   Line B5
    15   Bit 14-----19   Line B6        15   Bit 14-----19   Line B6
    16   Bit 15-----20   Line B7        16   Bit 15-----20   Line B7
    23   Strobe------9   Line C4 (Strobe)    23   Strobe------9   Line C4
    24   +5V--------38   +5V        25   Dig Gnd----40   Ground
    25   Dig Gnd----40   Ground        


Table of Contents