Title: | Visual Field (VF) Progression Analysis and Plotting Methods |
---|---|
Description: | Realization of published methods to analyze visual field (VF) progression. Introduction to the plotting methods (designed by author TE) for VF output visualization. A sample dataset for two eyes, each with 10 follow-ups is included. The VF analysis methods could be found in -- Musch et al. (1999) <doi:10.1016/S0161-6420(99)90147-1>, Nouri-Mahdavi et at. (2012) <doi:10.1167/iovs.11-9021>, Schell et at. (2014) <doi:10.1016/j.ophtha.2014.02.021>, Aptel et al. (2015) <doi:10.1111/aos.12788>. |
Authors: | Tobias Elze, Dian Li (documentation), Eun Young Choi (QC) |
Maintainer: | Dian Li <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.7.1 |
Built: | 2024-11-14 06:41:21 UTC |
Source: | CRAN |
plotComponentMatrix
plots the following 24-2 or 30-2 visual field measurement: sensitivity, TD, TD prob, PD, and PD prob:
plotComponentMatrix(componentmatrix, ncomp = ncol(componentmatrix), plot.ncols = 5, plot.nrows = NULL, plot.annot.topleft.function = toString, plot.annot.bottomleft.function = function(i) NULL, globaltitle = sprintf("k = %i", ncol(componentmatrix)), globalannotright = NULL, zmin = -ceiling(max(abs(c(min(componentmatrix), max(componentmatrix))))), zmax = -zmin, color.pal = colorRampPalette(c("red", "white", "blue"), space = "Lab")(256), td.probabilities = FALSE, show.colorbar = !td.probabilities, titleheight = 0.2, ...)
plotComponentMatrix(componentmatrix, ncomp = ncol(componentmatrix), plot.ncols = 5, plot.nrows = NULL, plot.annot.topleft.function = toString, plot.annot.bottomleft.function = function(i) NULL, globaltitle = sprintf("k = %i", ncol(componentmatrix)), globalannotright = NULL, zmin = -ceiling(max(abs(c(min(componentmatrix), max(componentmatrix))))), zmax = -zmin, color.pal = colorRampPalette(c("red", "white", "blue"), space = "Lab")(256), td.probabilities = FALSE, show.colorbar = !td.probabilities, titleheight = 0.2, ...)
componentmatrix |
a matrix or data frame, column represents different eyes and rows are the VF measurements of the same type (sensitivity, TD, TD prob, PD, or PD prob). |
ncomp |
a numeric variable defines the number of components to be plotted (default: all). |
plot.ncols |
a numeric variable defines the number of columns to be plotted (default: 5). |
plot.nrows |
a numeric variable defines the number of rows to be plotted (default: NULL (automatically calculated)). |
plot.annot.topleft.function |
a function(i) that is given to any subplot i to create its top left annotation. |
plot.annot.bottomleft.function |
a function(i) that is given to any subplot i to create its bottom left annotation (default: returns NULL). |
globaltitle |
a string for global title (default: k = ncomp; set to NULL to suppress global title). |
globalannotright |
a string annotation to the right of the global title (default: NULL). |
zmin |
minimum value of the color scale (default: auto defined). |
zmax |
maximum value of the color scale (default: auto defined). |
color.pal |
an object that defines color scale theme (default: colorRampPalette(c("red", "white", "blue"), space = "Lab")(256)). |
td.probabilities |
a logic variable indicates whether to plot TD probability symbols instead of TD colors (default: FALSE). |
show.colorbar |
a logic variable indicates whether to show a global colorbar (default: !td.probabilities). |
titleheight |
a numeric variable defines the height of the title relative to height of row one. |
... |
other variables to be added. |
heatmap for sensitivity, TD and PD input. Value plot for TD prob and PD prob input.
data(vfseries) componentmatrix = t(vfseries[1:10, grepl('^s[0-9]+', colnames(vfseries))]) globaltitle = paste("Sensitivities, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle) componentmatrix = t(vfseries[1:10, grepl('^td[0-9]+', colnames(vfseries))]) globaltitle = paste("TDs, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle) componentmatrix = t(vfseries[1:10, grepl('^pd[0-9]+', colnames(vfseries))]) globaltitle = paste("PDs, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle) componentmatrix = t(vfseries[1:10, grepl('^tdp[0-9]+', colnames(vfseries))]) globaltitle = paste("TD Probs, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle, td.probabilities = TRUE) componentmatrix = t(vfseries[1:10, grepl('^pdp[0-9]+', colnames(vfseries))]) globaltitle = paste("PD Probs, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle, td.probabilities = TRUE)
data(vfseries) componentmatrix = t(vfseries[1:10, grepl('^s[0-9]+', colnames(vfseries))]) globaltitle = paste("Sensitivities, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle) componentmatrix = t(vfseries[1:10, grepl('^td[0-9]+', colnames(vfseries))]) globaltitle = paste("TDs, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle) componentmatrix = t(vfseries[1:10, grepl('^pd[0-9]+', colnames(vfseries))]) globaltitle = paste("PDs, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle) componentmatrix = t(vfseries[1:10, grepl('^tdp[0-9]+', colnames(vfseries))]) globaltitle = paste("TD Probs, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle, td.probabilities = TRUE) componentmatrix = t(vfseries[1:10, grepl('^pdp[0-9]+', colnames(vfseries))]) globaltitle = paste("PD Probs, k = ", ncol(componentmatrix), sep = '') plotComponentMatrix(componentmatrix, globaltitle = globaltitle, td.probabilities = TRUE)
plotfield.normalized
plots the following 24-2 or 30-2 visual field measurement: sensitivity, TD, TD prob, PD, and PD prob:
plotfield.normalized(eigenfields, component = 1, zmin = -max(abs(c(min(eigenfields), max(eigenfields)))), zmax = max(abs(c(min(eigenfields), max(eigenfields)))), color.pal = colorRampPalette(c("red", "white", "blue"), space = "Lab")(256), show.colorbar = TRUE, topleftannotation = NULL, bottomleftannotation = NULL, labelcex = 2, ...)
plotfield.normalized(eigenfields, component = 1, zmin = -max(abs(c(min(eigenfields), max(eigenfields)))), zmax = max(abs(c(min(eigenfields), max(eigenfields)))), color.pal = colorRampPalette(c("red", "white", "blue"), space = "Lab")(256), show.colorbar = TRUE, topleftannotation = NULL, bottomleftannotation = NULL, labelcex = 2, ...)
eigenfields |
a vector contains Sensitivity/TD/PD measurement. For 24-2 VF |
component |
Number of components to be plotted (default: 1). |
zmin |
minimum value of the color scale (default: auto defined). |
zmax |
maximum value of the color scale (default: auto defined). |
color.pal |
an object that defines color scale theme (default: colorRampPalette(c("red", "white", "blue"), space = "Lab")(256)). |
show.colorbar |
a logic value to show colorbar (default: TRUE). |
topleftannotation |
a string annotation shown on the top left side of the plot (default: NULL). |
bottomleftannotation |
a string annotation shown on the bottom left side of the plot (default: NULL). |
labelcex |
a numeric variable for label size (default: 2). |
... |
other variables to be added. |
heatmap for sensitivity, TD and PD input
data(vfseries) eigenfields = t(vfseries[1, grepl('^s[0-9]+', colnames(vfseries))]) plotfield.normalized(eigenfields) title(main = "Sensitivity", line = 3) eigenfields = t(vfseries[1, grepl('^td[0-9]+', colnames(vfseries))]) plotfield.normalized(eigenfields) title(main = "Total Deviation", line = 3) eigenfields = t(vfseries[1, grepl('^pd[0-9]+', colnames(vfseries))]) plotfield.normalized(eigenfields) title(main = "Pattern Deviation", line = 3)
data(vfseries) eigenfields = t(vfseries[1, grepl('^s[0-9]+', colnames(vfseries))]) plotfield.normalized(eigenfields) title(main = "Sensitivity", line = 3) eigenfields = t(vfseries[1, grepl('^td[0-9]+', colnames(vfseries))]) plotfield.normalized(eigenfields) title(main = "Total Deviation", line = 3) eigenfields = t(vfseries[1, grepl('^pd[0-9]+', colnames(vfseries))]) plotfield.normalized(eigenfields) title(main = "Pattern Deviation", line = 3)
plotTdProbabilities
plots the following 24-2 or 30-2 visual field measurement: TD probs, and PD probs:
plotTdProbabilities(tdprob, cex = 2, rectangle.color = "black", rectangle.width = 0.16, margins = c(2, 1, 2, 2) + 0.1, ...)
plotTdProbabilities(tdprob, cex = 2, rectangle.color = "black", rectangle.width = 0.16, margins = c(2, 1, 2, 2) + 0.1, ...)
tdprob |
a vector contains TD probs/PD probs measurement. For 24-2 VF |
cex |
a numeric variable for label size (default: 2). |
rectangle.color |
a string variable defines label color (default: 'black'). |
rectangle.width |
a numeric variable defines label width (default: '0.16'). |
margins |
a vector define the plot margins (default: c(2, 1, 2, 2)+0.1). |
... |
other variables to be added. |
value plot for TD prob and PD prob input.
data(vfseries) tdprob = t(vfseries[1, grepl('^tdp[0-9]+', colnames(vfseries))]) plotTdProbabilities(tdprob) title(main = "Total Deviation Probability", line = 3) tdprob = t(vfseries[1, grepl('^pdp[0-9]+', colnames(vfseries))]) plotTdProbabilities(tdprob) title(main = "Pattern Deviation Probability", line = 3)
data(vfseries) tdprob = t(vfseries[1, grepl('^tdp[0-9]+', colnames(vfseries))]) plotTdProbabilities(tdprob) title(main = "Total Deviation Probability", line = 3) tdprob = t(vfseries[1, grepl('^pdp[0-9]+', colnames(vfseries))]) plotTdProbabilities(tdprob) title(main = "Pattern Deviation Probability", line = 3)
plotTDvalues
plots the following 24-2 or 30-2 visual field measurement: sensitivity, TD, and PD:
plotTDvalues(tds, cex.tds = 1, textcolor = function(x) "black", show.lines = T, ...)
plotTDvalues(tds, cex.tds = 1, textcolor = function(x) "black", show.lines = T, ...)
tds |
a vector contains sensitivity/TD/PD measurement. For 24-2 VF |
cex.tds |
a numeric variable for label size (default: 1). |
textcolor |
a function defines the label color. |
show.lines |
a logical variable indicates whether to show the horizontal and vertical lines. |
... |
other variables to be added. |
value plot for sensitivity, TD and PD input.
data(vfseries) tds = t(vfseries[1, grepl('^s[0-9]+', colnames(vfseries))]) plotTDvalues(tds) title(main = "Sensitivity", line = 3) tds = t(vfseries[1, grepl('^td[0-9]+', colnames(vfseries))]) plotTDvalues(tds) title(main = "Total Dviation", line = 3) tds = t(vfseries[1, grepl('^pd[0-9]+', colnames(vfseries))]) plotTDvalues(tds) title(main = "Pattern Dviation", line = 3)
data(vfseries) tds = t(vfseries[1, grepl('^s[0-9]+', colnames(vfseries))]) plotTDvalues(tds) title(main = "Sensitivity", line = 3) tds = t(vfseries[1, grepl('^td[0-9]+', colnames(vfseries))]) plotTDvalues(tds) title(main = "Total Dviation", line = 3) tds = t(vfseries[1, grepl('^pd[0-9]+', colnames(vfseries))]) plotTDvalues(tds) title(main = "Pattern Dviation", line = 3)
progression
returns the progression criterion with four methods. plr.nouri.2012, vfi, schell2014, cigts
progression(vfseries, method = c("plr.nouri.2012", "vfi", "schell2014", "cigts"))
progression(vfseries, method = c("plr.nouri.2012", "vfi", "schell2014", "cigts"))
vfseries |
is a data frame. MUST contain the following columns: yearsfollowed', and 'eyeid'. Rows represent the single measurements. Other requirements, such as number of minimum measurements (rows), and necessary VF measurements could be found in each progression method's documentation |
method |
selected from one or more from: plr.nouri.2012, vfi, schell2014, cigts. Default it ... |
"stable", "worsening", or "improving" of measurements in measmatrix
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4495761/
data(vfseries) progression(vfseries) progression(vfseries[vfseries$eyeid == 1,]) progression(vfseries[vfseries$eyeid == 2,]) progression(vfseries, method=c("cigts"))
data(vfseries) progression(vfseries) progression(vfseries[vfseries$eyeid == 1,]) progression(vfseries[vfseries$eyeid == 2,]) progression(vfseries, method=c("cigts"))
progression.cigts
returns the progression of visual field test based on 52 or 54 total deviation probabilities (tdp). CIGTS VF progression (Musch et al., 1999).
progression.cigts(measmatrix)
progression.cigts(measmatrix)
measmatrix |
is a data frame. MUST contain the following columns: 52/54 TD probs (column names MUST be 'tdp1' ~ 'tdp52' or 'tdp1' ~ 'tdp54'), 'yearsfollowed', and 'eyeid'. Rows represent the single measurements. The minimum measurements (rows) is 5. |
"stable", "worsening", or "improving" of measurements in measmatrix
. Note: If a VF series is temporarily improving and temporarily worsening, it is assumed to be "stable" overall
http://www.aaojournal.org/article/S0161-6420(99)90147-1/abstract
data(vf.cigts) colnames(vf.cigts) progression.cigts(vf.cigts) progression.cigts(vf.cigts[vf.cigts$eyeid == 1,]) progression.cigts(vf.cigts[vf.cigts$eyeid == 2,])
data(vf.cigts) colnames(vf.cigts) progression.cigts(vf.cigts) progression.cigts(vf.cigts[vf.cigts$eyeid == 1,]) progression.cigts(vf.cigts[vf.cigts$eyeid == 2,])
progression.plr.nouri.2012
returns the progression criterion, using Pointwise Linear Regression (PLR) progression detection method according to Nouri-Mahdavi et al. (2012).
progression.plr.nouri.2012(measmatrix)
progression.plr.nouri.2012(measmatrix)
measmatrix |
is a data frame. MUST contain the following columns: 52/54 TD (column names MUST be 'td1' ~ 'td52' or 'td1' ~ 'td54'), 'yearsfollowed', and 'eyeid'. Rows represent the single measurements. The minimum measurements (rows) is 3. |
"stable", "worsening", or "improving" of measurements in measmatrix
https://www.ncbi.nlm.nih.gov/pubmed/22427560/
data(vf.plr.nouri.2012) colnames(vf.plr.nouri.2012) progression.plr.nouri.2012(vf.plr.nouri.2012) progression.plr.nouri.2012(vf.plr.nouri.2012[vf.plr.nouri.2012$eyeid == 1,]) progression.plr.nouri.2012(vf.plr.nouri.2012[vf.plr.nouri.2012$eyeid == 2,])
data(vf.plr.nouri.2012) colnames(vf.plr.nouri.2012) progression.plr.nouri.2012(vf.plr.nouri.2012) progression.plr.nouri.2012(vf.plr.nouri.2012[vf.plr.nouri.2012$eyeid == 1,]) progression.plr.nouri.2012(vf.plr.nouri.2012[vf.plr.nouri.2012$eyeid == 2,])
progression.schell2014
returns the progression criterion after Schell et al. 2014, which is essentially like CIGTS but with MD, and only one follow-up is enough to confirm progression.
progression.schell2014(measmatrix)
progression.schell2014(measmatrix)
measmatrix |
is a data frame. MUST contain the following columns: 'md' (mean deviation) and 'eyeid'. Rows represent the single measurements. The minimum measurements (rows) is 4. |
"stable", "worsening", or "improving" of measurements in measmatrix
. Note: If a VF series is temporarily improving and temporarily worsening, it is assumed to be "stable" overall
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4495761/
data(vf.schell2014) colnames(vf.schell2014) progression.schell2014(vf.schell2014) progression.schell2014(vf.schell2014[vf.schell2014$eyeid == 1,]) progression.schell2014(vf.schell2014[vf.schell2014$eyeid == 2,])
data(vf.schell2014) colnames(vf.schell2014) progression.schell2014(vf.schell2014) progression.schell2014(vf.schell2014[vf.schell2014$eyeid == 1,]) progression.schell2014(vf.schell2014[vf.schell2014$eyeid == 2,])
progression.vfi
returns the progression criterion used in Aptel et al. (2015).
progression.vfi(measmatrix)
progression.vfi(measmatrix)
measmatrix |
is a data frame. MUST contain the following columns: 'vfi' (visual field index), 'yearsfollowed', and 'eyeid'. Rows represent the single measurements. The minimum measurements (rows) is 3. |
"stable", "worsening", or "improving" of measurements in timepoints
https://www.ncbi.nlm.nih.gov/pubmed/26095771/
data(vf.vfi) colnames(vf.vfi) progression.vfi(vf.vfi) progression.vfi(vf.vfi[vf.vfi$eyeid == 1,]) progression.vfi(vf.vfi[vf.vfi$eyeid == 2,])
data(vf.vfi) colnames(vf.vfi) progression.vfi(vf.vfi) progression.vfi(vf.vfi[vf.vfi$eyeid == 1,]) progression.vfi(vf.vfi[vf.vfi$eyeid == 2,])
Data
data(vf.cigts)
data(vf.cigts)
A data frame sample for CIGTS progression method, which includes visual field related measurement for two eyes, each with 10 follow-ups. Rows represent the single measurements.
eyeid, labeled as 1,2... for different eyes.
follow-up years. The minimum measurements /rows for one eye is 5.
52 total deviation probability, or 'tdp' measurements. The minimum measurements, or rows for one eye is 5.
...
data(vf.cigts) colnames(vf.cigts) progression.cigts(vf.cigts) progression.cigts(vf.cigts[vf.cigts$eyeid == 1,]) progression.cigts(vf.cigts[vf.cigts$eyeid == 2,])
data(vf.cigts) colnames(vf.cigts) progression.cigts(vf.cigts) progression.cigts(vf.cigts[vf.cigts$eyeid == 1,]) progression.cigts(vf.cigts[vf.cigts$eyeid == 2,])
Data
data(vf.plr.nouri.2012)
data(vf.plr.nouri.2012)
A data frame sample for Pointwise Linear Regression (PLR) method according to Nouri-Mahdavi 2012 progression, which includes visual field related measurement for two eyes, each with 10 follow-ups. Rows represent the single measurements.
eyeid, labeled as 1,2... for different eyes
follow-up years. The minimum measurements, or rows, for one eye is 3
52 total deviation, or 'td' measurements. The minimum measurements, or rows, for one eye is 3
...
data(vf.plr.nouri.2012) colnames(vf.plr.nouri.2012) progression.plr.nouri.2012(vf.plr.nouri.2012) progression.plr.nouri.2012(vf.plr.nouri.2012[vf.plr.nouri.2012$eyeid == 1,]) progression.plr.nouri.2012(vf.plr.nouri.2012[vf.plr.nouri.2012$eyeid == 2,])
data(vf.plr.nouri.2012) colnames(vf.plr.nouri.2012) progression.plr.nouri.2012(vf.plr.nouri.2012) progression.plr.nouri.2012(vf.plr.nouri.2012[vf.plr.nouri.2012$eyeid == 1,]) progression.plr.nouri.2012(vf.plr.nouri.2012[vf.plr.nouri.2012$eyeid == 2,])
Data
data(vf.schell2014)
data(vf.schell2014)
A data frame sample for progression method by Schell et al. 2014, which includes visual field related measurement for two eyes, each with 10 follow-ups. Rows represent the single measurements.
eyeid, labeled as 1,2... for different eyes.
mean deviation measurements. The minimum measurements, or rows, for one eye is 4.
...
data(vf.schell2014) colnames(vf.schell2014) progression.schell2014(vf.schell2014) progression.schell2014(vf.schell2014[vf.schell2014$eyeid == 1,]) progression.schell2014(vf.schell2014[vf.schell2014$eyeid == 2,])
data(vf.schell2014) colnames(vf.schell2014) progression.schell2014(vf.schell2014) progression.schell2014(vf.schell2014[vf.schell2014$eyeid == 1,]) progression.schell2014(vf.schell2014[vf.schell2014$eyeid == 2,])
Data
data(vf.vfi)
data(vf.vfi)
A data frame for CIGTS progression example, which includes visual field related measurement for two eyes each with 10 follow-ups.
eyeid, labeled as 1,2... for different eye groups.
follow-up years. The minimum measurements, or rows, for one eye is 3.
visual field index. The minimum measurements, or rows, for one eye is 3.
...
data(vf.vfi) colnames(vf.vfi) progression.vfi(vf.vfi) progression.vfi(vf.vfi[vf.vfi$eyeid == 1,]) progression.vfi(vf.vfi[vf.vfi$eyeid == 2,])
data(vf.vfi) colnames(vf.vfi) progression.vfi(vf.vfi) progression.vfi(vf.vfi[vf.vfi$eyeid == 1,]) progression.vfi(vf.vfi[vf.vfi$eyeid == 2,])
Data
data(vfseries)
data(vfseries)
A data frame sample including the following visual field related measurement for two eyes, each with 10 follow-ups.
eyeid, labeled as 1,2... for different eyes.
number of visits.
follow-up years.
to be updated.
in years.
1 as right eye, 0 as left eye.
VF test malfixation rate.
glaucoma hemifield test result.
visual field index.
mean deviation.
mean deviation probability.
pattern standard deviation.
pattern standard deviation probability.
52 sensitivity measurements.
52 total deviation measurements.
52 total deviation probability measurements.
52 pattern deviation probability measurements.
...
data(vfseries) progression(vfseries) progression(vfseries[vfseries$eyeid == 1,]) progression(vfseries[vfseries$eyeid == 2,]) progression(vfseries, method=c("cigts")) progression.cigts(vfseries) progression(vfseries, method=c('plr.nouri.2012', 'schell2014', 'vfi'))
data(vfseries) progression(vfseries) progression(vfseries[vfseries$eyeid == 1,]) progression(vfseries[vfseries$eyeid == 2,]) progression(vfseries, method=c("cigts")) progression.cigts(vfseries) progression(vfseries, method=c('plr.nouri.2012', 'schell2014', 'vfi'))