Docs: Acquisition

Introduction


Fig. 1 - Acquisition "Splash Screen"

Acquisition is a program used to record electroencephalographic (EEG) data, stimulus events, and subject responses in real-time. The user supplies configuration information via the Acquisition graphical user interface (GUI), specifying such things as the number of EEG channels to use, the sampling rate, experiment descriptions, EEG display window-specifics, behavioral "watches", and so on. Once configured, the Acquisition program is ready to record data into ERPSS-format log and raw files, using simple "buttons" to Record, Pause, Resume, and Stop data collection. In addition, Pause and Resume functions can be activated via event codes, further simplifying the user interaction required during data collection.

 

Usage

Acquisition follows the standard Windows interface protocol, providing a Desktop icon which executes the Acquisition.exe program under a multithreaded Windows OS (Windows 2000 Professional, Windows XP Professional, etc.). The user may start Acquisition by double-clicking this icon, executing "Acquisition.exe" from a Cmd window, or by entering "Acquisition.exe" into the Start->Run program launcher. Acquisition will not run on any Windows OS that does not support multiple threads!


Options

There are many options available to the user when configuring Acquisition for use. Those of main interest are:

  (1)  ability to "record" data to both log and raw files, only to a log file, or only to a raw file
  (2)  assign Pause and Resume functionality to event codes (AUTO mode), or just to the Controls panel (MANUAL)
  (3)  track behavioral stats in real-time, and if desired log those stats to a behavioral stats file
  (4)  complete control over EEG displays: size, position, colors, # of channels, etc. Multiple windows possible.

Program Requirements

The minimum requirements to use the Acquisition program are as follows:

    a Pentium-class or better PC, with (2) available PCI slots
    Windows multi-threaded operating system (Win2K Pro, WinXP Pro, Windows Vista)
    512MB of system RAM
    National Instruments PCI-6071e digital acquisition (DAQ) card (or similar)
    National Instruments PCI-6533 digital I/O card
    VGA-resolution (640x480) display

The recommended setup to use the Acquisition program are as follows:

    a dual-processor or dual-core Pentium IV or better CPU, with at least (2) available PCI slots
    recent Windows multi-threaded operating system (WinXP Pro, Windows Vista)
    2GB of system RAM or more
    National Instruments PCI-6071e digital acquisition (DAQ) card (or similar)
    National Instruments PCI-6533 digital I/O card
    (2) SXGA-resolution (1280x1024) or better color monitor displays, in shared desktop configuration
    dual-head color graphics card, with dual-DVI outputs, 1280x1024 resolution each


Operation

Acquisition allows the user to configure the size, number, and position of EEG display windows, event code windows, etc., so theoretically the program could be run on any PC with at least one VGA display. Ideally, the user would have enough screen area to configure the displays such that multiple EEG windows, event codes, behavioral watches, and the Controls panel could all be viewed concurrently, without windows overlapping. This normally requires at least 1600x1200 display resolution. For that reason, either a single high-end monitor or multiple monitors are recommended for display purposes.

There are three main operational states in Acquisition: Ready, Paused and Recording. In the Ready state (Fig. 2), Acquisition is awaiting direction from the user - either to change the program configuration parameters or request a data recording session. When Recording (Fig. 4), the incoming EEG and experimental events are being written to the raw and/or log files. EEG and event codes are displayed for the user for experimental monitoring. When Paused (Fig. 3), although the program continues to display incoming EEG and experimental events, none of the information is recorded on disk. This enables the experiment to be divided into a series of runs, pausing to allow the subject a brief rest, and the experimenter an opportunity to tend to stimulus presentation, change the condition code, etc.


Fig. 2 - Controls window in the Ready state

On startup, Acquisition loads the default configuration file, initializes the National Instruments DAQ and DIO cards, configures the display windows as indicated in the default configuration, and then enters the Ready state. At this point the Configuration, Load Config and Save Config buttons are all enabled, and the Controls panel shows the Record button enabled (Fig. 2). The user may either reconfigure Acquisition now by manually tinkering with the config settings or by loading a previously saved config file, or the user can start the data collection process by pressing the Record button. Once the Record button is pressed, the user is prompted for log and/or raw file names, and perhaps a behavioral log filename (if Behavioral Stats are enabled, and Log Behav Stats is requested). Then, upon receipt of valid filenames, the Acquisition program enters the Paused state.


Fig. 3 - Controls window in the Paused state

When the program is in the Paused state, the only buttons enabled are Resume and Stop, with focus on the Resume button (Fig. 3). The experimenter can then request Acquisition enter the Recording state by either pressing the spacebar, or clicking on the Resume button. Notice that the Configure, Load Config, and Save Config buttons are disabled in this Paused state (same for the Recording state)- those buttons are only available in the Ready state, when Acquisition is not acquiring data!


Fig. 4 - Controls window in the Recording state

Once Acquisition enters the Recording state, the only buttons enabled are Pause and Stop, with focus on the Pause button (Fig. 4). The experimenter may then pause Acquisition by either pressing the spacebar, or clicking on the Pause button. If at any time the experimenter presses the Stop button, Acquisition immediately attempts to stop all processing threads, finishes writing data out to the log and/or raw files and then closes the files, and then switches back to the Ready state, with only the Record button enabled. The experimenter should only press Stop when they wish to finish writing to the current data files, to reset all processes within Acquisition, and to re-enter the Ready state where they can adjust the configuration of hardware, channels recorded, begin recording data to new raw and/or log files, or exit the program.


Configuration

The first thing you'll want to do when you start Acquisition is to configure the settings for the current experiment. You begin this process by clicking the Configure Acquisition button on the Controls panel. Since Acquisition starts in the Ready state, the Configure Acquisition button should be enabled and ready for use. Click this button...

Voila! The Experiment Configuration window (Fig. 5) appears on the screen. This is where we can input important information about this experiment, such as the Lab Name, Experiment Name, a Subject Description, the base names for our log and/or raw data files (the base name gets appended by a sequential number, starting from "1", and if the "Use filename extensions" box is checked, a corresponding ".log" or ".raw" is appended as well), the Sample Rate (the number of times each second that we sample our EEG data), and whether we want to enable "Automatic Control" via specific event codes.


Fig. 5 - Experiment Configuration window

By default, Acquisition is set-up to use specific hardware and communicate over specific ports according to the lab in which it is installed. If you want to make adjustments to these settings (normally this is not necessary and should only be done with the help of your system administrator...else you could render Acquisition useless!), click the Config I/O Devices button in the Experiment Configuration window. That opens the following window:


Fig. 6 - Configure I/O Devices window

This is the Configure I/O Devices window. Here you can make adjustments to the Analog Input Device(s), including renaming the EEG channels, or you can select different Digital Input Devices to receive event codes from external sources. If your hardware doesn't allow for certain configurations, some settings may be disabled. Again, only make changes here if you are familiar with the hardware and know what you are doing! Normally these settings will not be changed by the experimenter when starting a new experiment.

However, the experimenter may wish to change the number or position of EEG channels to be used in his/her experiment, and this can be done by clicking the Select Channels button on the Experiment Configuration window. This action opens the Select Channels dialog window (Fig. 7) shown below:


Fig. 7 - Select Channels window

The Available Channels list box shows all the available EEG channels that are not currently selected, and the Selected Channels list box shows all the currently selected EEG channels (when recording, only "selected" channels are sampled!) in the order in which they are to be sampled. So for the above figure, we have selected channel #61, "HEOG", as the first channel to be sampled, then channel #62, "VEOG", then channel #52, "F3", and so on. Later on when we examine the raw data files recorded with these settings, our channel samples will follow this ordering; 1: "HEOG", 2: "VEOG", 3: "F3", 4: "F4", etc.

Once you have selected the channels you wish to include in your data, the next step will likely be to organize the EEG display settings so that you will be able to monitor these channels during the experiment. Acquisition provides an extremely flexible display for EEG channels, allowing for multiple display windows, a variety of row/column style channel layouts adjustable on a per-window basis, complete control over display colors, text fonts, plot sweep times, visual scale, etc. There are two ways to access display settings in Acquisition, (1) you can click the Display Settings button on the Experiment Configuration window, or (2) you can click the EEG Display button on the Controls panel (see Fig. 2). Why two buttons? Simple. Display configuration is something that you might want to adjust after the experiment has begun and you are in the Recording or Paused states. Since the Configure Acquisition button is disabled in these two states, we provide additional access via a dedicated button on the Controls panel - allowing EEG display settings to be changed at any time! Below is the EEG Display Settings window:


Fig. 8 - EEG Display Settings window

Before modifying EEG Display Settings, you'll want to decide how many plot windows you'll want displayed. Then you will either Add Plot or Delete Plot windows until you have the desired number. Then you can either select individually, or in groups, the windows for which you want to adjust display characteristics, and then make your color, font, # of columns, and plot scale selections. Hint: If you want something to not show up in the display, choose it's display color to be the same as the Background Color!

In the above figure (Fig. 8), we have added three Plot Windows, named "HEOG", "VEOG", and "Whole Head". As you might have guessed, in the "HEOG" window we have selected (1) channel, namely "HEOG". We've chosen a plot sweep time of 20 seconds, allowing us to see what has occurred in that channel for the last 20 seconds of recording - this is usually sufficient to detect horizontal eye movements. Likewise, in the "VEOG" window we plot the VEOG channel by itself as well, so that we can more easily detect subtle vertical eye movements, blinks, muscle noise, etc. For the "Whole Head" window, we display all available channels in a front-to-back, left-to-right order so that we get a sort of topographical display. Channels are displayed in a single column, which helps make certain artifacts much easier to see (such as blinks, Alpha waves, etc). However, the experimenter could have chosen to display a truly topographical layout by creating separate windows with various channels and column widths corresponding to different "slices" of the head, with perhaps the top window consisiting of all frontal channels, then the window immediately below containing front-central channels, then the window below it containing central channels, and so on.

To add a plot window, click the Add Plot button. A new plot window is added to the Plot Windows list box. You can edit the name of this new plot window by selecting it in the list box - it's name then appears in the Plot Window Name edit box. There you can edit the window name. Once you've chosen the name for your newly-added plot window, you need to select the channels that you want displayed in the new window. Do this by clicking the Select Channels to Display button to the right of the Plot Window Name edit box. A Select Channels dialog opens and you can select the channels to display, in left-to-right, top-to-bottom fashion. If your window will contain a single column, then the order you select in this dialog will be the displayed channel order top-to-bottom. For a two-column window, the first channel selected will display top-left, the second top-right, the third on the second row-left, etc.

Once you've finished adding the desired plot windows, you are ready to adjust each window's plot colors, text font, sweep time, and so on. Simply highlight the window you wish to adjust in the Plot Windows list box, then adjust it's individual settings as desired.

In the sample below (Fig. 9), we show calibration pulses being recorded in a 64 rows x 1 columns window, with a 20 second sweep time, a y-scale of about 800, Plot Rainbow EEG checked, and Event Code Markers displayed. Note the vertical black line near the extreme right side of the image. That is the Cursor, drawn in black. Since the Cursor is drawn on top of the EEG, it can never be made completely invisible...it will always mask the plot underneath its current position.


Fig. 9 - Plot window example displaying calibration pulses in single-column, rainbow EEG mode with a 20 second plot sweep time.

Behavioral Stats Config (Fig. 10) is used when you want to examine the subject's behavioral performance in an experiment. To open this window, click the Behavior Settings button in the Experiment Configuration window.


Fig. 10 - Behavioral Stats Config window

Check Enable Behavioral Stats Monitoring if you want to examine behavior during the experiment. Check Log Behavioral Stats to Disk if you would like the results saved to a file. Then adjust the warning thresholds as you wish - if performance falls outside of the threshold values in a specific area, then a warning marker ('~') gets displayed next to that statistic in the Behav Stats display. These threshold values do not affect the performance calculations themselves in any way!

Saving a Configuration


Fig. 11 - Save Config button

 

It would be tedious to manually adjust all configuration settings every time you use Acquisition, so an option is provided to save configurations to a file. Click the button with the image of a floppy disk on it (see Fig. 11) on the Controls window to save a configuration to a file (.edg format). Experiment, hardware (I/O), window display and behavior settings, including current behavioral watch items, are saved in the configuration file. This option is only available in the Ready state.

Loading a Configuration


Fig. 12 - Load Config button

To load a saved configuration, click the button with the image of a folder on it (see Fig. 12) on the Controls window. This option is only available in the Ready state.

 

Event Codes

EEG data alone would be of little use to us if not for event codes. Acquisition accepts 8-bit digital codes via the Digital Input port (currently a National Instruments PCI-6533 card). These 8 bits represent integer values from 0-255. The value 0 is a special case, and is not recorded by Acquisition - however in some input modes (as with the PCI-6533 in change-of-state input mode) it is necessary to the proper function of our event code routines, as it demarcates the transition between codes. For example, when running calibration pulses it is standard practice in our lab to assign the event code '1' to each pulse. Without the transition to '0' after each '1', our PCI-6533 would not see a change-of-state, i.e. the same code '1' is coming in, so no new event would be assumed. However, this assumption would be in error - there is clearly a new event.

Some configurations get around this by using one of the eight data lines as an interrupt line, and strobing that line each time a code is sent. Unfortunately we only have 8-bit lines as it is, and that means only 255 usable codes! To give up half of them just to implement an interrupt function didn't seem worth it, so Acquisition currently uses a change-of-state detection method instead, thereby requiring each unique event to be followed by a '0' (all data lines low). It is important when using the PCI-6533 digital input card to make sure that your event codes are always followed by a '0', otherwise the PCI-6533 will not work correctly!

The event codes 1-255 are recognized as valid events by Acquisition, and are subsequently displayed and recorded as necessary. The Events window (Fig. 13) displays a scrolling list of incoming event codes, as well as the time (called DeltaT) between the current event and the most recent previous event. To toggle the Events window, click the Event Codes button on the Controls window.


Fig. 13 - Events window

Event codes can also be displayed on top of the EEG traces by checking the Draw Event Code Markers on EEG Display checkbox in the EEG Display Settings window (see Fig. 8).

 

Behavioral Statistics

The user can toggle the Behavioral Statistics window (Fig. 14)by clicking the Behav Stats button on the Controls window. The Behavioral Statistics window is both a display and control window, since it displays the behavioral performance for particular events as well as provides an interface for the user to add/modify/remove events to be tracked. Here is a sample of the window:


Fig. 14 - Behavioral Statistics window with sample data

Behavioral performance is tracked by defining a "watch" for each event sequence. A "watch" is a certain condition that provokes an expected response from the subject. Each line in the Behavioral Statistics window corresponds to a defined "watch" item - and the performance is tracked for that item in the form of "hits", "misses", "false alarms", etc.

Add Behavioral Watch

The user can add a new "watch" item by clicking the Add Watch button. This brings up a dialog window where the user can specify specifics of the "watch" (Fig. 15).


Fig. 15 - Add Behavioral Watch dialog window

The Watch Description is the name/description you want to give the specific event sequence. It should be descriptive enough for the user to identify the specific "watch" among a list of watches.

The Condition Code is the condition under which this "watch" is valid. If equal to 0, then the "watch" is valid for all conditions. Else the "watch" is valid (active) only under the condition specified by this value.

The Activate On Code and Terminate On Code options allow the "watch" to start and stop on specific event codes. If Activate On Code is checked and a valid code (1-255) is specified, then this "watch" will become valid upon receipt of that code, and not before. Likewise, if Terminate On Code is checked and a valid code is specified, then this "watch" will become invalid upon receipt of that code, i.e. stats will stop being calculated for the "watch".

The Reset On PAUSE checkbox specifies whether to reset the statistics for this "watch" after each PAUSE event. Useful for tallying stats on a run by run basis, for example. There is also a button on the Behavioral Statistics window that allows resetting of the stats for all watches at any time - but remember, that button resets ALL watches!

The Start Window (ms) and Stop Window (ms) values are the start and stop times for the response window following the event that is supposed to provoke the subject response (i.e. the "target" or "nontarget" event). Only responses matching the valid responses for this "watch" and falling within this specified window are counted toward the stats - all others are either matched with other events or discarded as "unmatched responses".

The Target and matching Response values are added to the Targets list. Targets are defined as events expected to evoke a certain behavioral response. If they are "detected", meaning the subject responded correctly to them, then they will produce a "hit". If they go by undetected, they produce a "miss". All target events must end up as either a "hit" or a "miss". The Response is the expected subject response to the paired Target. A matching Response within the time window defined by Start Time and Stop Time for an active watch is a "hit". The user must specify all Target-Response pairs that are valid for this "watch" in the Targets list.

The NonTarget and matching Response values are added to the NonTargets list. Nontargets are defined as events that may reasonably be assumed to be mistaken as target events, and thus evoke a behavioral response. Nontarget events are subjective, in that it is up to the user to decide what may "reasonably be mistaken as a target event". If the subject responds to a Nontarget event as if it were a Target event, then that is a "false alarm". If the subject does not, then that is a "correct rejection". All Nontarget events must end up as either a "false alarm" or a "correct rejection". The user must specify all NonTarget-Response pairs that are valid for this "watch" in the NonTargets list.

Each Target and NonTarget event defined in a "watch" must be unique - you can't assign the same code to any two Targets, NonTargets, or Target/NonTarget pairs in any one "watch"! Why? It would cause logical conflicts in our behavioral calculations if the same event code meant more than one thing. Of course, you can specify any valid Response code, and the same Response code can be paired with multiple Target and NonTarget events within any one "watch". You can also leave the Targets list or NonTargets list empty, however doing so may result in some calculations not being possible!

As for the Behavioral Statistics display window, it shows the "watch" descriptions, hits, misses, percent correct ( = hits / misses ), false alarms, correct rejections, d prime ( = hit rate / false alarm rate ), and the mean reaction time (MRT) for all responses within the valid response window. Each "watch" item uses one line of the display. A '~' next to a value means that the value exceeds the thresholds defined by the user for that specific value (see Behavior Settings under the Configuration section ). It is just a warning - it does not affect the statistical calculation!

Edit Behavioral Watch

The Edit Watch button allows the user to modify the selected "watch" in the "watch" list. Below is an example of an Edit Behavioral Watch dialog window (Fig. 16). Note the Watch Description is "HUL", the response window is defined to be 200-1000ms following a "1" (NonTarget) or a "101" (Target). Valid Responses are "200", and we want to Reset Stats on PAUSE.


Fig. 16 - Edit Behavioral Watch dialog with example config settings

Other Watch Buttons

The Remove Watch button removes the selected "watch" from the "watch" list.

The Remove All Watches button removes all watches - after the user confirms the action.

 

General Statistics

Acquisition has an additional facility which monitors some basic statistics about its current functional state. Dubbed the Statistics window (Fig. 17), it monitors such important stats such as the amount of free disk space, data rate of data streaming to disk, number of event codes received, number of event codes recorded to disk, and any missed data packets. There are no buttons (other than the window controls) - it is merely an informational display. The user can toggle this window by clicking the Statistics button on the Controls window.


Fig. 17 - Statistics window

 

Technical Specifications

Analog Input Device (National Instruments PCI-6071e):

Digital Input Device (National Instruments PCI-6533):

 

Known Bugs


Developers


© 2006 UCSD ERP Lab
Please send comments and suggestions to the ERPSS Webmaster