Learn R Programming

OPI (version 1.6)

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. }

Details

Octopus900{ opiSetBackground(lum, color="white", background=NA, fixation=NA, fixIntensity=50)

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

  • lumis intensity of the background and must 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$.
  • colorcan be one of the following choices.
    • .Octopus900Env$MET_COL_WWfor white-on-white
    • .Octopus900Env$MET_COL_RWfor red-on-white
    • .Octopus900Env$MET_COL_BWfor blue-on-white
    • .Octopus900Env$MET_COL_WYfor white-on-yellow
    • .Octopus900Env$MET_COL_RYfor red-on-yellow
    • .Octopus900Env$MET_COL_BYfor blue-on-yellow
  • fixationis one of
    • .Octopus900Env$FIX_CENTREor.Octopus900Env$FIX_CENTER
    • .Octopus900Env$FIX_CROSS
    • .Octopus900Env$FIX_RING
  • fixIntensityis a percentage between 0 and 100. 0 is off, 100 the brightest.
} 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. }

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://perimetry.org/OPI

See Also

chooseOpi

Examples

Run this code
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!")

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