opiPresent_for_Compass {OPI} | R Documentation |
Implementation of opiPresent for the Compass machine.
Description
This is for internal use only. Use opiSetup()
with
these Arguments and you will get the Value back.
Arguments
stim |
A list of stimulus parameters (see Details). |
nextStim |
Unused - included for compliance with OPI standard. |
Details
If the chosen OPI implementation is Compass
, then nextStim
is ignored. Note that the dB level is rounded to the nearest integer.
If tracking is on, then this will block until the tracking is obtained, and the stimulus presented.
stim
is a list containing some or all of the following elements:
-
x
, x-coordinate in degrees (floating point) (range $[-30,30]$). -
y
, y-coordinate in degrees (floating point) (range $[-30,30]$). -
level
is luminance in cd/\mbox{m}^2
, and is rounded to the nearest whole dB for display (range 0 to 50). 0dB is 10000aps. -
responseWindow
is in milliseconds (range 0 to 2680).
Stimulus duration is assumed to be 200ms, and size is assumed to be Goldmann III (0.43 degrees diameter), color is assumed to be white. These cannot be changed.
Value
A list containing:
-
err
0 all clear, >= 1 some error codes (eg cannot track, etc) (integer) -
seen
FALSE
for not seen,TRUE
for seen (button pressed in response window) -
time
Response time in ms (integer) since stimulus onset, -1 for not seen -
time_rec
Time since epoch when command was received at Compass (integer ms) -
time_pres
Time since epoch that stimulus was presented (integer ms) -
num_track_events
Number of tracking events that occurred during presentation (integer) -
num_motor_fails
Number of times motor could not follow fixation movement during presentation (integer) -
pupil_diam
Pupil diameter in mm (float) -
loc_x
Pixels integer, location in image of presentation (integer) -
loc_y
Pixels integer, location in image of presentation (integer)
Examples
## Not run:
# Set up the Compass
chooseOpi("Compass")
result <- opiInitialize(ip = "192.168.1.7", port = 44965)
if (!is.null(result$err))
stop("Initialisation failed")
#' @param x X location of stim in degrees
#' @param y Y location of stim in degrees
#' @param size If 3, Goldmann III, else V
#' @param db Value in dB
#' @return stim object ready for opiPresent
makeStim <- function(x, y, size, db) {
s <- list(x = x, y = y, level = dbTocd(db, 10000 / pi),
size = ifelse(size == 3, 0.43, 1.77),
duration = 200, responseWindow = 1500)
class(s) <- "opiStaticStimulus"
return(s)
}
result <- opiPresent(makeStim(9, 9, 3, 10))
## End(Not run)