Learn R Programming

OPI (version 1.6)

opiInitialize: Initialize OPI.

Description

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

Usage

opiInitialize(...)
opiInitialise(...)

Arguments

...
Implementation specific parameters. See details.

Value

  • Returns NULL if initialization succeeded, otherwise an implementation dependant error.

    Octopus900{ Returns NULL if successful, 1 if Octopus900 is already initialised by a previous call to opiInitialize, and 2 if some error occured that prevented ininitialisation.

    The default background and stimulus setup is to white-on-white perimetry. Use opiSetBackground to change the background and stimulus colors. }

Details

SimHenson{ opiInitialize(type="C", cap=6, display=NULL)

If the chosen OPI implementation is SimHenson, then type can be one of: "N", for normal patients; "G", for POAG patients; and "C", for a combination. See Table 1 in Henson et al (2000). cap is the maximum standard deviation value that the simulator will use for the slope/spread of the psychometric function.

If display is a vector of four numbers c(xlow, xhi, ylow, yhi), then a plot area is created of dimension xlim=range(xlow, xhi) and ylim=range(ylow, yhi) and each call to opiPresent will display a point on the area. The color of the plot area can be set with opiSetBackground, and the color of the displayed point is determined by the stimulus passed to opiPresent. } SimHensonRT{ opiInitialize(type="C", cap=6, display=NULL, rtData)

If the chosen OPI implementation is SimHensonRT, then the first three parameters are as in SimHenson, and rtData is a data frame with at least 2 columns: "Rt", reponse time; and "Dist", signifying that distance between assumed threshold and stimulus value in your units.

This package contains RtSigmaUnits or RtDbUnits that can be loaded with the commands data(RtSigmaUnits) or data(RtDbUnits), and are suitable to pass as values for rtData. } SimGaussian{ opiInitialize(sd, display=NULL)

If the chosen OPI implementation is SimGaussian, then sd is the standard deviation value that the simulator will use for the slope/spread of the psychometric function.

display is as for SimHenson. } Octopus900{ opiInitialize(eyeSuiteJarLocation, eyeSuiteSettingsLocation, eye, gazeFeed=0)

If the chosen OPI implementation is Octopus900, then you must specify two directory/folder names and the eye to be tested.

eyeSuiteJarLocation is the folder name containing the EyeSuite jar files, and should include the trailing slash.

eyeSuiteSettingsLocation is the folder name containing the EyeSuite setting files, and should include the trailing slash.

eye must be either "left" or "right".

gazeFeed is 0 for no gaze tracking infromation. If gazeFeed is 1, then a single frame is returned as part of the value from opiPresent which is the most recent frame captured. If gazeFeed is 2, then a all frames containing the asterix are returned as part of the value from opiPresent, which are the frames captured while a static stimulus is displayed. If gazeFeed is greater than zero, a Java driven window appears containing the live feed from the Octopus 900 gaze camera. }

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

David B. Henson, Shaila Chaudry, Paul H. Artes, E. Brian Faragher, and Alec Ansons. Response Variability in the Visual Field: Comparison of Optic Neuritis, Glaucoma, Ocular Hypertension, and Normal Eyes. Investigative Ophthalmology & Visual Science, February 2000, Vol. 41(2).

See Also

chooseOpi, opiSetBackground, opiClose, opiPresent

Examples

Run this code
# Set up a simple simulation for white-on-white perimetry
chooseOpi("SimHenson")
if (!is.null(opiInitialize(type="C", cap=6)))
    stop("opiInitialize failed")

    # Set up a simple simulation for white-on-white perimetry
    # and display the stimuli in a plot region
chooseOpi("SimHenson")
if (!is.null(opiInitialize(type="C", cap=6, display=c(-30,30,-30,30))))
    stop("opiInitialize failed")

    # Set up a simple simulation for white-on-white perimetry
    # and display the stimuli in a plot region and simulate response times
chooseOpi("SimHensonRT")
data(RtSigmaUnits)
oi <- opiInitialize(type="C", cap=6, 
        display=c(-30,30,-30,30), rtData=RtSigmaUnits, rtFP=1:100)
if (!is.null(oi))
    stop("opiInitialize failed")

    # Set up a simulation using a psychometric function that is
    # a cumulative gaussian of standard deviation 2
chooseOpi("SimGaussian")
if (!is.null(opiInitialize(sd=2)))
    stop("opiInitialize failed")

# Set up the Octopus 900
chooseOpi("Octopus900")
if (!is.null(opiInitialize(
        eyeSuiteJarLocation="C:/EyeSuite/", 
        eyeSuiteSettingsLocation="C:/Documents and Settings/All Users/HAAG-STREIT/EyeSuite/",
        eye="left")))
    stop("opiInitialize failed")

Run the code above in your browser using DataLab