Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 Feb 1;12(2):6.
doi: 10.1167/tvst.12.2.6.

PyVisualFields: A Python Package for Visual Field Analysis

Affiliations

PyVisualFields: A Python Package for Visual Field Analysis

Mohammad Eslami et al. Transl Vis Sci Technol. .

Abstract

Purpose: Artificial intelligence (AI) methods are changing all areas of research and have a variety of capabilities of analysis in ophthalmology, specifically in visual fields (VFs) to detect or predict vision loss progression. Whereas most of the AI algorithms are implemented in Python language, which offers numerous open-source functions and algorithms, the majority of algorithms in VF analysis are offered in the R language. This paper introduces PyVisualFields, a developed package to address this gap and make available VF analysis in the Python language.

Methods: For the first version, the R libraries for VF analysis provided by vfprogression and visualFields packages are analyzed to define the overlaps and distinct functions. Then, we defined and translated this functionality into Python with the help of the wrapper library rpy2. Besides maintaining, the subsequent versions' milestones are established, and the third version will be R-independent.

Results: The developed Python package is available as open-source software via the GitHub repository and is ready to be installed from PyPI. Several Jupyter notebooks are prepared to demonstrate and describe the capabilities of the PyVisualFields package in the categories of data presentation, normalization and deviation analysis, plotting, scoring, and progression analysis.

Conclusions: We developed a Python package and demonstrated its functionality for VF analysis and facilitating ophthalmic research in VF statistical analysis, illustration, and progression prediction.

Translational relevance: Using this software package, researchers working on VF analysis can more quickly create algorithms for clinical applications using cutting-edge AI techniques.

PubMed Disclaimer

Conflict of interest statement

Disclosure: M. Eslami, None; S. Kazeminasab, None; V. Sharma, None, Y. Li, None; M. Fazli, None; M. Wang, None; N. Zebardast, None; T. Elze, None

Figures

Figure 1.
Figure 1.
Two exemplary provided VF data.
Figure 2.
Figure 2.
(A) Compute the deviation values and probabilities. (B) Compute, create, and set a new normalization setting based on new data.
Figure 3.
Figure 3.
Plotting the values and probabilities using vfprogression sub-package.
Figure 4.
Figure 4.
Plotting based on visualFields sub-package. Up to bottom are sensitivity, total deviation, pattern deviation, and the colormap of the deviation probabilities.
Figure 5.
Figure 5.
(A) Getting the AGIS and CIGTS defect scores. (B) progression analysis of VF series by different criteria.
Figure 6.
Figure 6.
Printout of function glr(*args) from visualFields package that performs learn regression on the mean deviation of VF tests over 1 year.

Similar articles

Cited by

References

    1. Fankhauser F, Koch P, Roulier A.. On automation of perimetry. Albrecht Von Graefes Arch Klin Exp Ophthalmol. 1972; 184(2): 126–150. - PubMed
    1. Yohannan J, Boland MV.. The Evolving Role of the Relationship between Optic Nerve Structure and Function in Glaucoma. Ophthalmology. 2017; 124(12S): S66–S70. - PubMed
    1. Christopher M, Bowd C, Belghith A, et al. . Deep Learning Approaches Predict Glaucomatous Visual Field Damage from OCT Optic Nerve Head En Face Images and Retinal Nerve Fiber Layer Thickness Maps. Ophthalmology. 2020; 127(3): 346–356. - PMC - PubMed
    1. CRAN - Package vfprogression. https://cran.r-project.org/web/packages/vfprogression/index.html. Accessed February 14, 2022.
    1. CRAN - Package visualFields. https://cran.r-project.org/web/packages/visualFields/index.html. Accessed February 14, 2022.

Publication types