vfgpar {visualFields} | R Documentation |
Plots for visual fields data
Description
Graphical tools for visualization and statistical analysis of visual fields.
Usage
vfgpar(
coord,
tess = vftess(coord),
probs = c(0, 0.005, 0.01, 0.02, 0.05, 0.95, 0.98, 0.99, 0.995, 1),
cols = c("#000000", colorRampPalette(c("#FF0000", "#FFFF00"))(4), "#F7F0EB",
colorRampPalette(c("#00FF00", "#008000"))(4)),
floor = 0,
ltprobs = c(0, 0.005, 0.01, 0.02, 0.05, 0.95, 1),
ltcols = c("#000000", colorRampPalette(c("#FF0000", "#FFFF00"))(4), "#F7F0EB",
"#008000"),
gtprobs = c(0, 0.05, 0.95, 0.98, 0.99, 0.995, 1),
gtcols = c("#000000", "#FF0000", "#F7F0EB", colorRampPalette(c("#00FF00",
"#008000"))(4)),
neprobs = c(0, 0.0025, 0.005, 0.01, 0.25, 0.975, 0.99, 0.995, 0.9975, 1),
necols = c("#000000", colorRampPalette(c("#FF0000", "#FFFF00"))(4), "#F7F0EB",
colorRampPalette(c("#FFFF00", "#FF0000"))(4)),
bprobs = c(0, 0.005, 0.01, 0.02, 0.05, 0.95, 0.98, 0.99, 0.995, 1),
bcols = c("#000000", colorRampPalette(c("#FF0000", "#FFFF00"))(4), "#F7F0EB",
colorRampPalette(c("#00FF00", "#008000"))(4))
)
vftess(coord, floor = 0, delta = 3)
vfcolscheme(
probs = c(0, 0.005, 0.01, 0.02, 0.05, 0.95, 0.98, 0.99, 0.995, 1),
cols = c("#000000", colorRampPalette(c("#FF0000", "#FFFF00"))(4), "#F7F0EB",
colorRampPalette(c("#00FF00", "#008000"))(4)),
floor = 0
)
vfprogcolscheme(
probs = c(0, 0.005, 0.01, 0.02, 0.05, 0.95, 1),
cols = c("#000000", colorRampPalette(c("#FF0000", "#FFFF00"))(4), "#F7F0EB",
"#008000")
)
vfplot(vf, type = "td", ...)
vfplotsens(gpar, vf, maxval, digits = 0, ...)
vfplotdev(gpar, vf, dev, devp, digits = 0, ...)
vfplotsdev(gpar, vf, maxval, dev, devp, digits = 0, ...)
vfplotplr(
vf,
type = "td",
alternative = "LT",
xoffs = 0,
yoffs = 0,
addSpark = FALSE,
thr = 2,
width = 4,
height = 2,
...
)
vflegoplot(vf, type = "td", grp = 3, ...)
vflegoplotsens(gpar, vfb, vfl, maxb, maxl, crad = 2, digits = 1, ...)
vflegoplotdev(
gpar,
vfb,
devb,
devpb,
vfl,
devl,
devpl,
crad = 2,
digits = 1,
...
)
vfsparklines(vf, type = "td", thr = 2, width = 4, height = 2, add = FALSE, ...)
Arguments
coord |
print x and y coordinates. Check section
|
tess |
tesselation for the visual field maps. Check section
|
probs |
probability scale to use for TD and PD values. It is a numeric vector of probabilities with values in [0,1]. The values 0 and 1 must be included. Although not technically necessary, it would be best if it is the same as for the normative values used |
cols |
corresponding colors for each of the probability levels |
floor |
Flooring value, typically in dB. Default is 0 |
ltprobs , ltcols |
color map for progression with the alternative hypothesis lower than (LT) |
gtprobs , gtcols |
color map for progression with the alternative hypothesis lower than (GT) |
neprobs , necols |
color map for progression with the alternative hypothesis not equal (NE) |
bprobs , bcols |
color map for progression with blth alternative hypotheses LT and GT (B for both) |
delta |
Distance over which the boundary should be shifted. See for |
vf |
the visual fields data to plot |
type |
the type of data to plot: sensitivities (' |
... |
other graphical arguments. See |
gpar |
graphical parameters |
maxval |
maximum value, typically in dB, for the generation of a grayscale |
digits |
digits to round values to plot. Default is 0 |
dev |
deviation (TD or PD) values |
devp |
deviation (TD or PD) probability values |
alternative |
alternative hypothesis used in progression analyses.
Allowed values are ' |
xoffs , yoffs |
offset x and y where to print the slope values. That is, the distance from the center of each Voronoy polygons in degrees of visual angle |
addSpark |
whether to overlay a sparkline graph in each visual field location.
The parameters |
thr |
threshold used for the median absolute deviation of residuals
from simple linear regression. If greater than the threshold, the
sparkline for that location is plotted in red and with a thicker line.
Default is ' |
width |
the width of each pointwise sparkline plot. Default is
' |
height |
the height of each pointwise sparkline plot. Default is
' |
grp |
number of baseline (first) and last visual fields to group.
Default is ' |
vfb |
baseline visual field data |
vfl |
last visual field data |
maxb |
maximum value for the grayscale at baseline visual field data |
maxl |
maximum value for the grayscale for last visual field data |
crad |
radius of the circle in the legoplot |
devb |
baseline visual field (TD or PD) deviation values |
devpb |
baseline visual field (TD or PD) deviation probability values |
devl |
last visual field (TD or PD) deviation values |
devpl |
last visual field (TD or PD) deviation probability values |
add |
whether to generate a new plot (' |
Details
The following functions generate plots using visual fields data
vfgpar
generates simple graphical parametersvftess
generates a structure to handle the visual field tessellation. Check sectionTesselation in visualFields
below for further detailsvfcolscheme
generates the structures to handle the color scheme Check sectionColor schemes in visualFields
below for further detailsvfprogcolscheme
generates the structures to handle the color scheme for progression analysis. Check sectionColor schemes in visualFields
below for further detailsvfplot
plots a single test for visual field datavfplotsens
plots a single test for visual field sensitivity data with a grayscale where darker means greater sensitivity lossvfplotdev
plots a single test for visual field total or pattern deviation data with probability scales represented in colorvfplotplr
plots the results of pointwise linear regression for a series of visual fields for an eye from a subjectvflegoplot
the legoplot shows the differences between the average values of visual field tests taken as baseline and those at the end of follow upvflegoplotsens
the legoplot for visual field sensitivity data with a grayscale where darker means greater sensitivity lossvflegoplotdev
the legoplot for visual field total or pattern deviation data with probability scales represented in colorvfsparklines
the sparklines graph shows spark lines for the series of visual field sensitivities, or total or pattern deviation data for each location
Value
vfgpar
returns a list with graphical parameters to be used for vfplots
vftess
returns a list with the xlim
, ylim
, tessellation tiles and an outer hull
to be used for vfplots
vfcolscheme
returns a list with a lookup table and a function that define the color scheme
to be used for vfplots
vfprogcolscheme
returns the default vfcolscheme
to be used for vfplots
vfplot
No return value
vfplotsens
No return value
vfplotdev
No return value
vfplotsdev
No return value
vfplotplr
No return value
vflegoplot
No return value
vflegoplotsens
No return value
vflegoplotdev
No return value
vfsparklines
No return value
Structure of graphical parameters
Graphical parameters for visualFields must be a list containing
coord
print x and y coordinates. They could be different from the the real visual field location testing coordinates in complex visual field grids to help readability and improve visualization of statistical resultstess
tesselation for the visual field maps. Check sectionTesselation in visualFields
colmap
color map representing the probability scale. Check sectionColor schemes in visualFields
A default graphical parameters can be generated with generategpar
Tesselation in visualFields
A tesselation in visualFields must be defined with a list containing
xlim
,ylim
2-dimensional vectors containing the minimum and maximum x and y valuesfloor
the value to be assinged to any sensitivity value lower thanfloor
tiles
a list of as many tiles defining the tesselation as visual field test locations. Each element of the list is a table with x and y coordinates defining a polygon containing the corresponding test location. Each polygon is thus the tile for each visual field test locationhull
a table with x and y coordinates defining the outer hull of the tessellation
A default tessellation can be generated with vftess
Color schemes in visualFields
A color scheme in visualFields must be defined with a list containing
map
a table mapping probabilities levels with colors defined in hexadecimal basefun
a function that takes sensitivity values and deviation probability levels and returns the corresponding color code.
A default color scheme can be generated with vfcolscheme
Examples
# generate a structure with default graphical parameters for the 30-2 map
vfgpar(locmaps$p30d2$coord)
# generate a structure with default tesselation for the 30-2 map
vftess(locmaps$p30d2$coord)
# default color scheme
vfcolscheme()
# default color scheme for progression
vfprogcolscheme()
# plot visual field values for the last field in the series for the first
# subject in the dataset vfpwgSunyiu24d2
# grayscale with sensitivity values
vfplot(vfselect(vffilter(vfpwgRetest24d2, id == 1), n = 1), type = "s")
# TD values
vfplot(vfselect(vffilter(vfpwgRetest24d2, id == 1), n = 1), type = "td")
# PD values
vfplot(vfselect(vffilter(vfpwgRetest24d2, id == 1), n = 1), type = "pd")
# hybrid sensitivities and TD values
vfplot(vfselect(vffilter(vfpwgRetest24d2, id == 1), n = 1), type = "tds")
# hybrid sensitivities and PD values
vfplot(vfselect(vffilter(vfpwgRetest24d2, id == 1), n = 1), type = "pds")
# plot results from pointwise linear regression for the series of
# visual fields for the right eye in the dataset vfpwgSunyiu24d2
# with sensitivity values
vfplotplr(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "s")
# TD values
vfplotplr(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "td")
# PD values
vfplotplr(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "pd")
# legoplot for the series of visual fields for the right eye
# of the subject in the dataset vfpwgSunyiu24d2
# with sensitivity values
vflegoplot(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "s")
# TD values
vflegoplot(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "td")
# PD values
vflegoplot(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "pd")
# sparklines for the series of visual fields for the right eye of
# the subject in the dataset vfpwgSunyiu24d2
# with sensitivity values
vfsparklines(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "s")
# TD values
vfsparklines(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "td")
# PD values
vfsparklines(vffilter(vfpwgSunyiu24d2, eye == "OD"), type = "pd")