opiPresent_for_MAIA: Implementation of opiPresent for the MAIA machine.

View source: R/MAIA.r

opiPresent_for_MAIAR Documentation

Implementation of opiPresent for the MAIA 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 MAIA, 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 MAIA (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 X location in image of presentation (pixels, integer)

  • loc_y Y location in image of presentation (pixels, integer)

Examples

## Not run: 
  # Set up the MAIA
  chooseOpi("MAIA")
  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)


OPI documentation built on April 12, 2025, 1:24 a.m.