Learn R Programming

OPI (version 2.9)

opiSetBackground: Set background using OPI.

Description

Generic function for setting background of the chosen OPI implementation that is set with chooseOpi().

Usage

opiSetBackground(...)

Arguments

Implementation specific parameters. See details.

Value

Returns NULL if succeeded, otherwise an implementation dependant error as follows.

Octopus900

-1 indicates opiInitialize has not been called.

-2 indicates could not set the background color.

-3 indicates could not set the fixation marker.

-4 indicates that all input parameters were NA.

Details

Octopus900

opiSetBackground(lum=NA, color=NA, fixation=NA, fixIntensity=NA)

Allowable lum and color are defined in the .Octopus900Env environment.

  • lum is intensity of the background and can be one of

    • .Octopus900Env$BG_OFF, which turns background off.

    • .Octopus900Env$BG_1, background of 1.27 cd/\(\mbox{m}^2\).

    • .Octopus900Env$BG_10, background of 10 cd/\(\mbox{m}^2\).

    • .Octopus900Env$BG_100, background of 100 cd/\(\mbox{m}^2\).

  • color can be one of the following choices.

    • .Octopus900Env$MET_COL_WW for white-on-white

    • .Octopus900Env$MET_COL_RW for red-on-white

    • .Octopus900Env$MET_COL_BW for blue-on-white

    • .Octopus900Env$MET_COL_WY for white-on-yellow

    • .Octopus900Env$MET_COL_RY for red-on-yellow

    • .Octopus900Env$MET_COL_BY for blue-on-yellow

  • fixation is one of

    • .Octopus900Env$FIX_CENTRE or .Octopus900Env$FIX_CENTER

    • .Octopus900Env$FIX_CROSS

    • .Octopus900Env$FIX_RING

  • fixIntensity is a percentage between 0 and 100. 0 is off, 100 the brightest.

Note if you specify fixation you also have to specify fixIntensity.

SimHenson and SimGaussian

opiSetBackground(col, gridCol)

col is the background color of the plot area used for displaying stimuli, and gridCol the color of the gridlines. Note the plot area will only be displayed if opiInitialize is called with a valid display argument.

Octopus600

This function has no effect.

KowaAP7000

opiSetBackground(lum, color, fixation,)

lum and color are dependant for the Kowa AP-7000. A white background must be 10 cd/\(\mbox{m}^2\), and a yellow background must be. 100 cd/\(\mbox{m}^2\). If lum is 10 and color is not set, then .KowaAP7000Env$BACKGROUND_WHITE is assumed. If lum is 100 and color is not set, then .KowaAP7000Env$BACKGROUND_YELLOW is assumed. If both lum and color is set, then lum is ignored (a warning will be generated if lum is incompatible with color).

fixation is one of

  • .KowaAP7000Env$FIX_CENTER, fixation marker in the centre.

  • .KowaAP7000Env$FIX_CENTRE, fixation marker in the centre.

  • .KowaAP7000Env$FIX_AUX, fixation marker is ???.

  • .KowaAP7000Env$FIX_MACULA, fixation marker is a circle(?).

  • .KowaAP7000Env$FIX_AUX_LEFT, fixation marker is as for AUX but only lower left.

Compass

opiSetBackground(fixation=NA, tracking_on=NA)

  • fixation=c(x,y,t) where

    • x is one of -20, -6, -3, 0, 3, 6, 20 degrees.

    • y is 0 degrees.

    • t is 0 for a spot fixation marker at c(x,y), or 1 for a square centred on one of (-3,0), (0,0), (+3,0).

  • tracking_on is either 0 (tracking off) or 1 (tracking on).

Note: tracking will be relative to the PRL established with the fixation marker used at setup (call to OPI-OPEN), so when tracking is on you should use the same fixation location as in the setup.

Daydream

opiSetBackground(lum=NA, color=NA, fixation="Cross", fixation_size=21, fixation_color=c(0,128,0), eye="L")

  • lum in cd/\(\mbox{m}^2\) is set to nearest grey value in lut from opiInitialize.

  • color is ignored.

  • fixation can only be 'Cross' at the moment.

  • fixation_size is the number of pixels one cross-hair is in length.

  • fixation_color RGB value of coor of fixation cross. Values in range [0,255].

References

Please cite: A. Turpin, P.H. Artes and A.M. McKendrick "The Open Perimetry Interface: An enabling tool for clinical visual psychophysics", Journal of Vision 12(11) 2012.

http://people.eng.unimelb.edu.au/aturpin/opi/index.html

See Also

chooseOpi

Examples

Run this code
# NOT RUN {
chooseOpi("SimGaussian")
if (!is.null(opiInitialize(sd=2, display=c(-30,30,-30,30))))
    stop("opiInitialize failed")
if (!is.null(opiSetBackground(col="white",gridCol="grey")))
    stop("opiSetBackground failed, which is very surprising!")

# }
# NOT RUN {
chooseOpi("Octopus900")
oi <- opiInitialize(eyeSuiteJarLocation="c:/EyeSuite/",
        eyeSuiteSettingsLocation="c:/Documents and Settings/All Users/Haag-Streit/",
        eye="left")
if (!is.null(oi))
    stop("opiInitialize failed")
if (!is.null(opiSetBackground(fixation=.Octopus900Env$FIX_CENTRE)))
    stop("opiSetBackground failed")
if (!is.null(opiSetBackground(fixation=.Octopus900Env$FIX_RING, fixIntensity=0)))
    stop("opiSetBackground failed")
if (!is.null(opiSetBackground(color=.Octopus900Env$MET_COL_BY)))
    stop("opiSetBackground failed")
if (!is.null(opiSetBackground(lum=.Octopus900Env$BG_100, color=.Octopus900Env$MET_COL_RW)))
    stop("opiSetBackground failed")
opiClose()
# }

Run the code above in your browser using DataLab