Table of Contents

Name

logrt - extract single trial reaction times (RTs) from an ERP log file

Synopsis

logrt logfile srate ccode targ_list resp_list wstart wstop [-r],

or

logrt logfile srate -p parameter_file [-r]

Description

logrt is a program used for extracting single trial reaction times from log files created during digitization. It can be invoked in one of 2 ways: either with all parameters specified on the command line or with a parameter file. Specifying all parameters on the command line is the most straightforward usage and suffices for most cases. For more complicated cases, the parameter file option is recommended as using this option allows calculation of reaction times for many different target/response pairs with a single run of the program.

If the -r option is specified, logrt ignores target events that have the data error or artifact rejection flag set. This works well in conjunction with the -x option of the avg program, which tells avg to set the data error flag in the log file for events that have a data error and to set the artifact rejection flag for events that are rejected with artifact rejection. The data error flag is defined to be 0100 (octal), and the artifact rejection flag is defined to be 040 (octal).

Running Without A Parameter File

In the invocation one must specify the log file (log_file), the sampling rate in Hz (sample_rate), and the condition code (cond_code). In addition, one must specify the target event(s) and response event(s). Since these may consist of more than one event, one can enter lists for either of these; this is accomplished by separating the event numbers with commas without any intervening tabs or spaces (note: on DOS there is a 128 character limit for a command line; on Linux the limit is 131072 characters). These lists are denoted targ_list and resp_list in the invocation line above. Finally, one must specify the upper and lower limits of the time interval following any of the target events in which the occurrence of a response event will be considered a "Hit", and the reaction time recorded. This is done by entering the start and stop times following a target event in milliseconds (wstart and wstop, above).

When logrt is used without the -p (parameter file) option, it outputs the reaction times as ASCII integers on the standard output; it is a simple matter to pipe them into another program, such as stats, or to redirect the output to a file (> filename).

Running Logrt With A Parameter File

To run logrt with a parameter file, you must first create an ascii file that includes one or more Reaction Time Blocks. Each Reaction Time Block includes the sequences of event codes that will be searched for in the log file, pairs of event codes within each sequence for which reaction times will be calculated, time windows, and names of files into which the calculated reaction times will be written and stored. Below is a description of the syntax for a Reaction Time Block; this is followed by a more readable description and a sample parameter file:

begin
cc condition_code
eventcode eventcode eventcode eventcode...
targ_pos resp_pos [targ_event resp_event] t<swin-ewin> file
targ_pos resp_pos [targ_event resp_event] t<swin-ewin> file
.
.
.
end

A parameter file can also have blank lines or comment lines which are ignored by logrt. A comment line is any line where the first character is not alphabetic, numeric, the asterisk character ’*’, or the tilde character ’~’ (the pound character, ’#’, is a good choice for comment lines).

The first line in a Reaction Time Block must be the word "begin".

The second line must be the letters "cc" followed by a condition code number.

The third line must contain a sequence of event codes that will have to be found in the log file for any of the following reaction times to be calculated. Event codes can be an integer number, a range of integer numbers specified by integer-integer (e.g. 105-115), a comma separated list of integers and/or ranges of integers (e.g. 105-115,120,125-135), or the asterisk character, ’*’, which matches any event code. Additionally, an event code specification can be preceded by the tilde character ’~’, which means NOT (matches any event code except the one(s) specified). Note that comma separated lists must not have any spaces.

The remaining lines in the Reaction Time Block up to the word "end" delineate the various pairs of events between which RTs are to be calculated. Targ_pos is the ordinal position of the target event in the list of events; note that the first event is in position 0. Resp_pos is the offset of the response event in the event list. The 2 parameters in brackets serve as a check to prevent user errors when calculating the positions. Targ_event is the actual event code that targ_pos refers to. Resp_event is the event code that resp_pos refers to. (Note that the Targ_event and Resp_event specifications must be simple integers. Specifically, ranges and comma separated lists are not allowed in the Targ_event and Resp_event specifications.) Swin and ewin define a time window within which the response event must follow the target event. These are given in milliseconds. Finally the file parameter is the name of the file that the reaction times will be recorded in. The last line of each Reacthin Time Block must be the word "end".

An example might be instructive. Suppose you have a log file called exp1.log. You know that some possible sequences of events are: 1, 1025, 2, 1024, 512; 1, 1024, 512, 2, 1024, 512; and 1, 1025, 2, 1025. Event codes 1 and 2 are stimulus codes. Event codes 1024 and 1025 are assigned to button responses. For each of these sequences you want the reaction time between stimulus code and the immediately following response code iff the response is within 200 - 800 milliseconds. Your parameter file would look like this:

# Example logrt Parameter File

# First Reaction Time Block
begin
cc 1
1 1025 2 1024 512
0 1 [1 1025] t<200-800> file1.rt
2 3 [2 1024] t<200-800> file2.rt
end

# Second Reaction Time Block
begin
cc 1
1 1024 512 2 1024 512
0 1 [1 1024] t<200-800> file3.rt
3 4 [2 1024] t<200-800> file4.rt
end

# Third Reaction Time Block
begin
1 1025 2 1025
0 1 [1 1025] t<200-800> file5.rt
2 3 [2 1025] t<200-800> file6.rt
end

After all of the reaction times are calculated, logrt prints a summary of the contents of each file, including number of calculated reaction times, their mean, standard deviation, and standard error to the standard output. This can be redirected to a file with > filename.

See Also

avg(1) , cdbl(1)


Table of Contents