PyVisualFields 2.0.3__tar.gz → 2.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyvisualfields-2.0.4/LICENSE +29 -0
- pyvisualfields-2.0.4/PKG-INFO +240 -0
- pyvisualfields-2.0.4/README.md +203 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/setup.cfg +4 -4
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/setup.py +2 -1
- pyvisualfields-2.0.4/src/PyVisualFields/Deviation_Analysis.py +886 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/PyGlaucoMetrics.py +380 -111
- pyvisualfields-2.0.4/src/PyVisualFields/__init__.py +1 -0
- pyvisualfields-2.0.4/src/PyVisualFields/utils.py +963 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/vfprogression.py +73 -19
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/visualFields.py +360 -171
- pyvisualfields-2.0.4/src/PyVisualFields.egg-info/PKG-INFO +240 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields.egg-info/SOURCES.txt +1 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields.egg-info/requires.txt +1 -0
- pyvisualfields-2.0.3/PKG-INFO +0 -178
- pyvisualfields-2.0.3/README.md +0 -144
- pyvisualfields-2.0.3/src/PyVisualFields/Deviation_Analysis.py +0 -452
- pyvisualfields-2.0.3/src/PyVisualFields/__init__.py +0 -1
- pyvisualfields-2.0.3/src/PyVisualFields/utils.py +0 -118
- pyvisualfields-2.0.3/src/PyVisualFields.egg-info/PKG-INFO +0 -178
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/MANIFEST.in +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/pyproject.toml +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/locmaps.json +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/normvals.json +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/normvals_meta.json +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vf.cigts.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vf.plr.nouri.2012.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vf.schell2014.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vf.vfi.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vfctrIowaPC26.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vfctrIowaPeri.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vfctrSunyiu10d2.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vfctrSunyiu24d2.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vfpwgRetest24d2.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vfpwgSunyiu24d2.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields/pkl_files/vfseries.pkl +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields.egg-info/dependency_links.txt +0 -0
- {pyvisualfields-2.0.3 → pyvisualfields-2.0.4}/src/PyVisualFields.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Mohammad (Moha) Eslami
|
|
4
|
+
https://scholar.google.com/citations?user=uHe4lbYAAAAJ&hl=en
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyVisualFields
|
|
3
|
+
Version: 2.0.4
|
|
4
|
+
Summary: A python toolkit for visual field analysis
|
|
5
|
+
Home-page: https://github.com/mohaEs/PyVisualField
|
|
6
|
+
Author: Mohammad Eslami, Bharath Erusalagandi, Mousa Moradi
|
|
7
|
+
Author-email: Mohammad_eslami@meei.harvard.edu
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/mohaEs/PyVisualField/issues
|
|
9
|
+
Project-URL: Demo Normalization, https://github.com/mohaEs/PyVisualField/blob/main/demo_2_Deviation_Analysis.ipynb
|
|
10
|
+
Project-URL: Demo Plotting, https://github.com/mohaEs/PyVisualField/blob/main/demo_3_Plotting.ipynb
|
|
11
|
+
Project-URL: Demo Prorgression Analysis, https://github.com/mohaEs/PyVisualField/blob/main/demo_4_Analysis.ipynb
|
|
12
|
+
Project-URL: Demo Data, https://github.com/mohaEs/PyVisualField/blob/main/demo_1_Data.ipynb
|
|
13
|
+
Project-URL: Demo Glaucoma Detection, https://github.com/mohaEs/PyVisualField/blob/main/demo5_PyGlaucoMetrics.ipynb
|
|
14
|
+
Project-URL: Harvard Ophthalmology AI LAB, https://ophai.hms.harvard.edu/
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Requires-Python: >=3.6
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: scipy
|
|
24
|
+
Requires-Dist: matplotlib
|
|
25
|
+
Requires-Dist: PyMuPDF
|
|
26
|
+
Dynamic: author
|
|
27
|
+
Dynamic: author-email
|
|
28
|
+
Dynamic: classifier
|
|
29
|
+
Dynamic: description
|
|
30
|
+
Dynamic: description-content-type
|
|
31
|
+
Dynamic: home-page
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: project-url
|
|
34
|
+
Dynamic: requires-dist
|
|
35
|
+
Dynamic: requires-python
|
|
36
|
+
Dynamic: summary
|
|
37
|
+
|
|
38
|
+
# PyVisualFields
|
|
39
|
+
|
|
40
|
+
## A python tool collection for analyzing visual fields
|
|
41
|
+
|
|
42
|
+
This packages includes functions for visuald field analysis and display.
|
|
43
|
+
|
|
44
|
+
https://pypi.org/project/PyVisualFields/
|
|
45
|
+
|
|
46
|
+
Version 2 is R-independent while maintaining the original module organization. The modules are inspired by vfprogression (Elze et al. [1]) and visualFields (Marin-Franch et al. [2]).
|
|
47
|
+
Additionally, pyGlaucoMetric has been integrated to enable glaucoma classification based on visual field patterns.
|
|
48
|
+
|
|
49
|
+
These functions are implemented in Python, and their functionalities are demonstrated across four primary categories:
|
|
50
|
+
- Data Presentation
|
|
51
|
+
- Plotting
|
|
52
|
+
- Scoring and Progression Analysis
|
|
53
|
+
- Normalization Analysis
|
|
54
|
+
- Glaucoma Detection
|
|
55
|
+
|
|
56
|
+
For each category, we provide comprehensive Jupyter notebooks containing practical examples, detailed function descriptions, required inputs/dependencies, and expected outputs.
|
|
57
|
+
|
|
58
|
+
## Citation
|
|
59
|
+
If you found this package impactful for your research, please cite the following article:
|
|
60
|
+
- PyVisualFields v2
|
|
61
|
+
- Mohammad Eslami, Saber Kazeminasab, Vishal Sharma, Yangjiani Li, Mojtaba Fazli, Mengyu Wang, Nazlee Zebardast, Tobias Elze; PyVisualFields: A Python Package for Visual Field Analysis. Trans. Vis. Sci. Tech. 2023;12(2):6. https://doi.org/10.1167/tvst.12.2.6.
|
|
62
|
+
|
|
63
|
+
and of course the corresponding sub-package:
|
|
64
|
+
- vfprogression (by Elze et al. [1])
|
|
65
|
+
- visualFields (by Marin-Granch et al. [2])
|
|
66
|
+
- pyGlaucoMetrics (by Moradi et al. [3])
|
|
67
|
+
|
|
68
|
+
## Installation:
|
|
69
|
+
|
|
70
|
+
> pip install PyVisualFields
|
|
71
|
+
|
|
72
|
+
## Demo jupyter notebooks
|
|
73
|
+
|
|
74
|
+
The list and description of all functions are available at [All_Functions](#list-of-functions). They are all examined and introduced with examples in 4 different notebooks categorized: </br>
|
|
75
|
+
- Data [demo_1_Data.ipynb](demo_1_Data.ipynb)
|
|
76
|
+
- Normalization and deviation analysis [demo_2_Deviation_Analysis.ipynb](demo_2_Deviation_Analysis.ipynb)
|
|
77
|
+
- Plotting [demo_3_Plotting.ipynb](demo_3_Plotting.ipynb)
|
|
78
|
+
- Progression Analysis [demo_4_Analysis.ipynb](demo_4_Analysis.ipynb)
|
|
79
|
+
- Glaucoma Detection [demo5_PyGlaucoMetrics.ipynb](demo5_PyGlaucoMetrics.ipynb) </br>
|
|
80
|
+
|
|
81
|
+
__Notice:__ PyGlaucoMetric is also available as a seperatre PyPI package and GitHub repository (built upon PyVisualFields), which includes a graphical user interface (GUI) for progression analysis and glaucoma detection. Indeed PyVisualFields is designed as a developer-facing package library, while pyGlaucoMetric serves as an accessible GUI application implementing selected visual field analysis components.
|
|
82
|
+
https://github.com/Mousamoradi/PyGlaucoMetrics
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
## references:
|
|
86
|
+
[1] PyVisualFields v2
|
|
87
|
+
[2] Mohammad Eslami, Saber Kazeminasab, Vishal Sharma, Yangjiani Li, Mojtaba Fazli, Mengyu Wang, Nazlee Zebardast, Tobias Elze; PyVisualFields: A Python Package for Visual Field Analysis. Trans. Vis. Sci. Tech. 2023;12(2):6. https://doi.org/10.1167/tvst.12.2.6.
|
|
88
|
+
[3] https://cran.r-project.org/web/packages/vfprogression/index.html </br>
|
|
89
|
+
[4] https://cran.r-project.org/web/packages/visualFields/index.html </br>
|
|
90
|
+
[5] Moradi, Mousa, Saber Kazeminasab Hashemabad, Daniel M. Vu, Allison R. Soneru, Asahi Fujita, Mengyu Wang, Tobias Elze, Mohammad Eslami, and Nazlee Zebardast. 2025. "PyGlaucoMetrics: A Stacked Weight-Based Machine Learning Approach for Glaucoma Detection Using Visual Field Data" Medicina 61, no. 3: 541. https://doi.org/10.3390/medicina61030541
|
|
91
|
+
</br>
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## list of functions
|
|
95
|
+
The list and description of all functions are as follow. They are all examined and introduced with examples in 4 different notebooks. It is important to mention that, based on the background modules, the input VF dataframe needs to have columns with special column names. Make sure, to consider the data notebook. If further information is required, see the corresponding references: _vfprogression[1]_, _visualFields[2]_ </br>
|
|
96
|
+
- Data [demo_1_Data.ipynb](demo_1_Data.ipynb)
|
|
97
|
+
- Normalization and deviation analysis [demo_2_Deviation_Analysis.ipynb](demo_2_Deviation_Analysis.ipynb)
|
|
98
|
+
- Plotting [demo_3_Plotting.ipynb](demo_3_Plotting.ipynb)
|
|
99
|
+
- Progression Analysis [demo_4_ProgressionAnalysis.ipynb](demo_4_ProgressionAnalysis.ipynb)
|
|
100
|
+
- Glaucoma Detection [demo5_PyGlaucoMetrics.ipynb](demo5_PyGlaucoMetrics.ipynb)
|
|
101
|
+
</br>
|
|
102
|
+
|
|
103
|
+
### Notice:
|
|
104
|
+
Version 2 has been validated exclusively for the 24-2 format. Additionally, the system assumes all visual field measurements are provided in right eye (OD) format.
|
|
105
|
+
|
|
106
|
+
Functions based on _vfprogression_ package accept 24-2 or 30-2 visual field measurement while functions based on _visualFields_ also accept 10-2.
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# Function Reference
|
|
110
|
+
|
|
111
|
+
<details>
|
|
112
|
+
<summary><b>Data Utilities </b></summary>
|
|
113
|
+
## Data Utilities
|
|
114
|
+
|
|
115
|
+
| Function | Description | Reference |
|
|
116
|
+
|----------|-------------|--------|
|
|
117
|
+
| `utils.canonicalize_vf_df()` | Canonicalize VF data to PyVisualFields format | PyVisualFieldsV2 |
|
|
118
|
+
| `utils.canonicalize_vf_df(, sort_byDateAge=True)` | Canonicalize and sort VFs by date/age within each patient | PyVisualFieldsV2 |
|
|
119
|
+
| `utils.print_vf_summary()` | Print a summary of available VF information | PyVisualFieldsV2 |
|
|
120
|
+
| `utils.investigate_vf_df()` | Return a summary of available VF information | PyVisualFieldsV2 |
|
|
121
|
+
| `utils.vf_blocks()` | Identify available VF blocks (`s`, `td`, `pd`, `tdp`, `pdp`) | PyVisualFieldsV2 |
|
|
122
|
+
| `utils.missing_blocks()` | Identify missing VF blocks | PyVisualFieldsV2 |
|
|
123
|
+
| `utils.compute_missing_blocks()` | Compute missing blocks using current normative setting NV | PyVisualFieldsV2 |
|
|
124
|
+
</details>
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
<details>
|
|
128
|
+
<summary><b>Example Datasets</b></summary>
|
|
129
|
+
## Example Datasets
|
|
130
|
+
|
|
131
|
+
| Function | Description | Reference |
|
|
132
|
+
|----------|-------------|--------|
|
|
133
|
+
| `visualFields.data_vfpwgRetest24d2()` | Humphrey 24-2 retest dataset | visualFields |
|
|
134
|
+
| `visualFields.data_vfctrSunyiu24d2()` | SUNY-IU control dataset | visualFields |
|
|
135
|
+
| `visualFields.data_vfpwgSunyiu24d2()` | SUNY-IU glaucoma dataset | visualFields |
|
|
136
|
+
| `visualFields.data_vfctrSunyiu10d2()` | SUNY-IU 10-2 control dataset | visualFields |
|
|
137
|
+
| `visualFields.data_vfctrIowaPC26()` | Iowa PC26 dataset | visualFields |
|
|
138
|
+
| `visualFields.data_vfctrIowaPeri()` | Iowa Peri dataset | visualFields |
|
|
139
|
+
| `vfprogression.data_vfseries()` | Longitudinal VF series dataset | vfprogression |
|
|
140
|
+
| `vfprogression.data_vfi()` | VFI dataset | vfprogression |
|
|
141
|
+
| `vfprogression.data_cigts()` | CIGTS dataset | vfprogression |
|
|
142
|
+
| `vfprogression.data_plrnouri2012()` | | vfprogression |
|
|
143
|
+
| `vfprogression.data_schell2014()` | | vfprogression |
|
|
144
|
+
</details>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<details>
|
|
148
|
+
<summary><b>Deviation Analysis </b></summary>
|
|
149
|
+
## Deviation Analysis
|
|
150
|
+
|
|
151
|
+
| Function | Description | Reference |
|
|
152
|
+
|----------|-------------|--------|
|
|
153
|
+
| `visualFields.getnv()` | Get current normative environment/setting | visualFields |
|
|
154
|
+
| `visualFields.setnv()` | change/set normalization environment based on a predefined NV | visualFields |
|
|
155
|
+
| `visualFields.get_info_normvals()` | all avialbale predefined normalization environments/settings | visualFields |
|
|
156
|
+
| `visualFields.nvgenerate()` |generate a normalization environment based new data | visualFields |
|
|
157
|
+
| `utils.compute_missing_blocks()` | Compute missing blocks ( `td`, `pd`, `tdp`, `pdp`) using current normative setting NV | PyVisualFieldsV2 |
|
|
158
|
+
| `visualFields.gettd()` | compute td using current normative setting NV | visualFields |
|
|
159
|
+
| `visualFields.gettdp()` | compute tdp using current normative setting NV | visualFields |
|
|
160
|
+
| `visualFields.getpd()` | compute pd using current normative setting NV | visualFields |
|
|
161
|
+
| `visualFields.getpdp()` | compute pdp using current normative setting NV | visualFields |
|
|
162
|
+
| `visualFields.getgh()` | compute general heigh using current normative setting NV | visualFields |
|
|
163
|
+
| `visualFields.getgl()` | compute gl (global incices, e.g. msens (MS), tmd (i.e. MD, but weighted mean of TD values), pmd (i.e. weighted mean of PD values) psd, vfi, gh ) using current normative setting NV | visualFields |
|
|
164
|
+
| `visualFields.getglp()` | compute gl's probabilities (e.g. mdprob, psdprob) using current normative setting NV | visualFields |
|
|
165
|
+
</details>
|
|
166
|
+
|
|
167
|
+
<details>
|
|
168
|
+
<summary><b>Progression Analysis </b></summary>
|
|
169
|
+
## Progression Analysis
|
|
170
|
+
|
|
171
|
+
| Function | Description |Reference |
|
|
172
|
+
|----------|-------------|--------|
|
|
173
|
+
| `vfprogression.get_score_AGIS()` | Compute AGIS score | vfprogression |
|
|
174
|
+
| `vfprogression.get_score_CIGTS()` | Compute CIGTS score | vfprogression |
|
|
175
|
+
| `vfprogression.progression_agis()` | AGIS progression analysis | vfprogression |
|
|
176
|
+
| `vfprogression.progression_cigts()` | CIGTS progression analysis | vfprogression |
|
|
177
|
+
| `vfprogression.progression_vfi()` | VFI progression analysis | vfprogression |
|
|
178
|
+
| `vfprogression.progression_plrnouri2012()` | Nouri et al. progression analysis | vfprogression |
|
|
179
|
+
| `vfprogression.progression_schell2014()` | Schell et al. progression analysis | vfprogression |
|
|
180
|
+
| `visualFields.glr()` | Linear regression with global indices | visualFields |
|
|
181
|
+
| `visualFields.plr()` | Pointwise linear regression (PLR) | visualFields |
|
|
182
|
+
| `visualFields.poplr()` | PoPLR regression analysis | visualFields |
|
|
183
|
+
</details>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
<details>
|
|
187
|
+
<summary><b>Glaucoma Diagnostic</b></summary>
|
|
188
|
+
|
|
189
|
+
## Glaucoma Diagnostic Criteria (PyGlaucoMetrics)
|
|
190
|
+
|
|
191
|
+
| Function | Description | Reference |
|
|
192
|
+
|----------|-------------|-----------|
|
|
193
|
+
| `PyGlaucoMetrics.Fn_HAP2()` | HAP2 glaucoma diagnosis | PyGlaucoMetrics[1,5] |
|
|
194
|
+
| `PyGlaucoMetrics.Fn_HAP2_part2()` | HAP2 severity classification | PyGlaucoMetrics[1,5] |
|
|
195
|
+
| `PyGlaucoMetrics.Fn_UKGTS()` | UKGTS criteria |PyGlaucoMetrics[1,5] |
|
|
196
|
+
| `PyGlaucoMetrics.Fn_LoGTS()` | LoGTS criteria |PyGlaucoMetrics[1,5] |
|
|
197
|
+
| `PyGlaucoMetrics.Fn_Foster()` | Foster criteria |PyGlaucoMetrics[1,5] |
|
|
198
|
+
| `PyGlaucoMetrics.Fn_Kangs()` | Kang's criteria |PyGlaucoMetrics[1,5] |
|
|
199
|
+
|
|
200
|
+
</details>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
<details>
|
|
204
|
+
<summary><b>Visualization Functions</b></summary>
|
|
205
|
+
## Visualization
|
|
206
|
+
|
|
207
|
+
| Function | Description |
|
|
208
|
+
|----------|-------------|
|
|
209
|
+
| `vfprogression.plotValues()` | Plot sensitivity, TD, or PD values |
|
|
210
|
+
| `vfprogression.plotProbabilities()` | Plot TDP or PDP probability maps |
|
|
211
|
+
| `visualFields.vfplot()` | Generic VF plotting function |
|
|
212
|
+
| `visualFields.vfplot_s()` | Sensitivity plot |
|
|
213
|
+
| `visualFields.vfplot_td()` | Total deviation plot |
|
|
214
|
+
| `visualFields.vfplot_pd()` | Pattern deviation plot |
|
|
215
|
+
| `visualFields.vfplotsparklines()` | Sparkline visualization |
|
|
216
|
+
| `visualFields.vflegoplot()` | Lego plot visualization |
|
|
217
|
+
| `visualFields.plotProbColormap()` | Probability colormap legend |
|
|
218
|
+
| `visualFields.vfplotplr()` | |
|
|
219
|
+
| `utils.Fn_report()` | Make a report of an eye | PyVisualFieldsV2 |
|
|
220
|
+
</details>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
## Snapshots
|
|
226
|
+
|
|
227
|
+
[See Github Repository](https://github.com/mohaEs/PyVisualField)
|
|
228
|
+
|
|
229
|
+
<img src="./imgs/1_(12).png" width="50%">
|
|
230
|
+
<img src="./imgs/1_(13).png" width="50%">
|
|
231
|
+
<img src="./imgs/1_(1).png" width="50%">
|
|
232
|
+
<img src="./imgs/1_(2).png" width="50%">
|
|
233
|
+
<img src="./imgs/1_(3).png" width="50%">
|
|
234
|
+
<img src="./imgs/1_(4).png" width="50%">
|
|
235
|
+
<img src="./imgs/1_(5).png" width="50%">
|
|
236
|
+
<img src="./imgs/1_(6).png" width="50%">
|
|
237
|
+
<img src="./imgs/1_(8).png" width="50%">
|
|
238
|
+
<img src="./imgs/1_(7).png" width="50%">
|
|
239
|
+
<img src="./imgs/1_(9).png" width="50%">
|
|
240
|
+
<img src="./imgs/1_(10).png" width="50%">
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# PyVisualFields
|
|
2
|
+
|
|
3
|
+
## A python tool collection for analyzing visual fields
|
|
4
|
+
|
|
5
|
+
This packages includes functions for visuald field analysis and display.
|
|
6
|
+
|
|
7
|
+
https://pypi.org/project/PyVisualFields/
|
|
8
|
+
|
|
9
|
+
Version 2 is R-independent while maintaining the original module organization. The modules are inspired by vfprogression (Elze et al. [1]) and visualFields (Marin-Franch et al. [2]).
|
|
10
|
+
Additionally, pyGlaucoMetric has been integrated to enable glaucoma classification based on visual field patterns.
|
|
11
|
+
|
|
12
|
+
These functions are implemented in Python, and their functionalities are demonstrated across four primary categories:
|
|
13
|
+
- Data Presentation
|
|
14
|
+
- Plotting
|
|
15
|
+
- Scoring and Progression Analysis
|
|
16
|
+
- Normalization Analysis
|
|
17
|
+
- Glaucoma Detection
|
|
18
|
+
|
|
19
|
+
For each category, we provide comprehensive Jupyter notebooks containing practical examples, detailed function descriptions, required inputs/dependencies, and expected outputs.
|
|
20
|
+
|
|
21
|
+
## Citation
|
|
22
|
+
If you found this package impactful for your research, please cite the following article:
|
|
23
|
+
- PyVisualFields v2
|
|
24
|
+
- Mohammad Eslami, Saber Kazeminasab, Vishal Sharma, Yangjiani Li, Mojtaba Fazli, Mengyu Wang, Nazlee Zebardast, Tobias Elze; PyVisualFields: A Python Package for Visual Field Analysis. Trans. Vis. Sci. Tech. 2023;12(2):6. https://doi.org/10.1167/tvst.12.2.6.
|
|
25
|
+
|
|
26
|
+
and of course the corresponding sub-package:
|
|
27
|
+
- vfprogression (by Elze et al. [1])
|
|
28
|
+
- visualFields (by Marin-Granch et al. [2])
|
|
29
|
+
- pyGlaucoMetrics (by Moradi et al. [3])
|
|
30
|
+
|
|
31
|
+
## Installation:
|
|
32
|
+
|
|
33
|
+
> pip install PyVisualFields
|
|
34
|
+
|
|
35
|
+
## Demo jupyter notebooks
|
|
36
|
+
|
|
37
|
+
The list and description of all functions are available at [All_Functions](#list-of-functions). They are all examined and introduced with examples in 4 different notebooks categorized: </br>
|
|
38
|
+
- Data [demo_1_Data.ipynb](demo_1_Data.ipynb)
|
|
39
|
+
- Normalization and deviation analysis [demo_2_Deviation_Analysis.ipynb](demo_2_Deviation_Analysis.ipynb)
|
|
40
|
+
- Plotting [demo_3_Plotting.ipynb](demo_3_Plotting.ipynb)
|
|
41
|
+
- Progression Analysis [demo_4_Analysis.ipynb](demo_4_Analysis.ipynb)
|
|
42
|
+
- Glaucoma Detection [demo5_PyGlaucoMetrics.ipynb](demo5_PyGlaucoMetrics.ipynb) </br>
|
|
43
|
+
|
|
44
|
+
__Notice:__ PyGlaucoMetric is also available as a seperatre PyPI package and GitHub repository (built upon PyVisualFields), which includes a graphical user interface (GUI) for progression analysis and glaucoma detection. Indeed PyVisualFields is designed as a developer-facing package library, while pyGlaucoMetric serves as an accessible GUI application implementing selected visual field analysis components.
|
|
45
|
+
https://github.com/Mousamoradi/PyGlaucoMetrics
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## references:
|
|
49
|
+
[1] PyVisualFields v2
|
|
50
|
+
[2] Mohammad Eslami, Saber Kazeminasab, Vishal Sharma, Yangjiani Li, Mojtaba Fazli, Mengyu Wang, Nazlee Zebardast, Tobias Elze; PyVisualFields: A Python Package for Visual Field Analysis. Trans. Vis. Sci. Tech. 2023;12(2):6. https://doi.org/10.1167/tvst.12.2.6.
|
|
51
|
+
[3] https://cran.r-project.org/web/packages/vfprogression/index.html </br>
|
|
52
|
+
[4] https://cran.r-project.org/web/packages/visualFields/index.html </br>
|
|
53
|
+
[5] Moradi, Mousa, Saber Kazeminasab Hashemabad, Daniel M. Vu, Allison R. Soneru, Asahi Fujita, Mengyu Wang, Tobias Elze, Mohammad Eslami, and Nazlee Zebardast. 2025. "PyGlaucoMetrics: A Stacked Weight-Based Machine Learning Approach for Glaucoma Detection Using Visual Field Data" Medicina 61, no. 3: 541. https://doi.org/10.3390/medicina61030541
|
|
54
|
+
</br>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## list of functions
|
|
58
|
+
The list and description of all functions are as follow. They are all examined and introduced with examples in 4 different notebooks. It is important to mention that, based on the background modules, the input VF dataframe needs to have columns with special column names. Make sure, to consider the data notebook. If further information is required, see the corresponding references: _vfprogression[1]_, _visualFields[2]_ </br>
|
|
59
|
+
- Data [demo_1_Data.ipynb](demo_1_Data.ipynb)
|
|
60
|
+
- Normalization and deviation analysis [demo_2_Deviation_Analysis.ipynb](demo_2_Deviation_Analysis.ipynb)
|
|
61
|
+
- Plotting [demo_3_Plotting.ipynb](demo_3_Plotting.ipynb)
|
|
62
|
+
- Progression Analysis [demo_4_ProgressionAnalysis.ipynb](demo_4_ProgressionAnalysis.ipynb)
|
|
63
|
+
- Glaucoma Detection [demo5_PyGlaucoMetrics.ipynb](demo5_PyGlaucoMetrics.ipynb)
|
|
64
|
+
</br>
|
|
65
|
+
|
|
66
|
+
### Notice:
|
|
67
|
+
Version 2 has been validated exclusively for the 24-2 format. Additionally, the system assumes all visual field measurements are provided in right eye (OD) format.
|
|
68
|
+
|
|
69
|
+
Functions based on _vfprogression_ package accept 24-2 or 30-2 visual field measurement while functions based on _visualFields_ also accept 10-2.
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# Function Reference
|
|
73
|
+
|
|
74
|
+
<details>
|
|
75
|
+
<summary><b>Data Utilities </b></summary>
|
|
76
|
+
## Data Utilities
|
|
77
|
+
|
|
78
|
+
| Function | Description | Reference |
|
|
79
|
+
|----------|-------------|--------|
|
|
80
|
+
| `utils.canonicalize_vf_df()` | Canonicalize VF data to PyVisualFields format | PyVisualFieldsV2 |
|
|
81
|
+
| `utils.canonicalize_vf_df(, sort_byDateAge=True)` | Canonicalize and sort VFs by date/age within each patient | PyVisualFieldsV2 |
|
|
82
|
+
| `utils.print_vf_summary()` | Print a summary of available VF information | PyVisualFieldsV2 |
|
|
83
|
+
| `utils.investigate_vf_df()` | Return a summary of available VF information | PyVisualFieldsV2 |
|
|
84
|
+
| `utils.vf_blocks()` | Identify available VF blocks (`s`, `td`, `pd`, `tdp`, `pdp`) | PyVisualFieldsV2 |
|
|
85
|
+
| `utils.missing_blocks()` | Identify missing VF blocks | PyVisualFieldsV2 |
|
|
86
|
+
| `utils.compute_missing_blocks()` | Compute missing blocks using current normative setting NV | PyVisualFieldsV2 |
|
|
87
|
+
</details>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary><b>Example Datasets</b></summary>
|
|
92
|
+
## Example Datasets
|
|
93
|
+
|
|
94
|
+
| Function | Description | Reference |
|
|
95
|
+
|----------|-------------|--------|
|
|
96
|
+
| `visualFields.data_vfpwgRetest24d2()` | Humphrey 24-2 retest dataset | visualFields |
|
|
97
|
+
| `visualFields.data_vfctrSunyiu24d2()` | SUNY-IU control dataset | visualFields |
|
|
98
|
+
| `visualFields.data_vfpwgSunyiu24d2()` | SUNY-IU glaucoma dataset | visualFields |
|
|
99
|
+
| `visualFields.data_vfctrSunyiu10d2()` | SUNY-IU 10-2 control dataset | visualFields |
|
|
100
|
+
| `visualFields.data_vfctrIowaPC26()` | Iowa PC26 dataset | visualFields |
|
|
101
|
+
| `visualFields.data_vfctrIowaPeri()` | Iowa Peri dataset | visualFields |
|
|
102
|
+
| `vfprogression.data_vfseries()` | Longitudinal VF series dataset | vfprogression |
|
|
103
|
+
| `vfprogression.data_vfi()` | VFI dataset | vfprogression |
|
|
104
|
+
| `vfprogression.data_cigts()` | CIGTS dataset | vfprogression |
|
|
105
|
+
| `vfprogression.data_plrnouri2012()` | | vfprogression |
|
|
106
|
+
| `vfprogression.data_schell2014()` | | vfprogression |
|
|
107
|
+
</details>
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<details>
|
|
111
|
+
<summary><b>Deviation Analysis </b></summary>
|
|
112
|
+
## Deviation Analysis
|
|
113
|
+
|
|
114
|
+
| Function | Description | Reference |
|
|
115
|
+
|----------|-------------|--------|
|
|
116
|
+
| `visualFields.getnv()` | Get current normative environment/setting | visualFields |
|
|
117
|
+
| `visualFields.setnv()` | change/set normalization environment based on a predefined NV | visualFields |
|
|
118
|
+
| `visualFields.get_info_normvals()` | all avialbale predefined normalization environments/settings | visualFields |
|
|
119
|
+
| `visualFields.nvgenerate()` |generate a normalization environment based new data | visualFields |
|
|
120
|
+
| `utils.compute_missing_blocks()` | Compute missing blocks ( `td`, `pd`, `tdp`, `pdp`) using current normative setting NV | PyVisualFieldsV2 |
|
|
121
|
+
| `visualFields.gettd()` | compute td using current normative setting NV | visualFields |
|
|
122
|
+
| `visualFields.gettdp()` | compute tdp using current normative setting NV | visualFields |
|
|
123
|
+
| `visualFields.getpd()` | compute pd using current normative setting NV | visualFields |
|
|
124
|
+
| `visualFields.getpdp()` | compute pdp using current normative setting NV | visualFields |
|
|
125
|
+
| `visualFields.getgh()` | compute general heigh using current normative setting NV | visualFields |
|
|
126
|
+
| `visualFields.getgl()` | compute gl (global incices, e.g. msens (MS), tmd (i.e. MD, but weighted mean of TD values), pmd (i.e. weighted mean of PD values) psd, vfi, gh ) using current normative setting NV | visualFields |
|
|
127
|
+
| `visualFields.getglp()` | compute gl's probabilities (e.g. mdprob, psdprob) using current normative setting NV | visualFields |
|
|
128
|
+
</details>
|
|
129
|
+
|
|
130
|
+
<details>
|
|
131
|
+
<summary><b>Progression Analysis </b></summary>
|
|
132
|
+
## Progression Analysis
|
|
133
|
+
|
|
134
|
+
| Function | Description |Reference |
|
|
135
|
+
|----------|-------------|--------|
|
|
136
|
+
| `vfprogression.get_score_AGIS()` | Compute AGIS score | vfprogression |
|
|
137
|
+
| `vfprogression.get_score_CIGTS()` | Compute CIGTS score | vfprogression |
|
|
138
|
+
| `vfprogression.progression_agis()` | AGIS progression analysis | vfprogression |
|
|
139
|
+
| `vfprogression.progression_cigts()` | CIGTS progression analysis | vfprogression |
|
|
140
|
+
| `vfprogression.progression_vfi()` | VFI progression analysis | vfprogression |
|
|
141
|
+
| `vfprogression.progression_plrnouri2012()` | Nouri et al. progression analysis | vfprogression |
|
|
142
|
+
| `vfprogression.progression_schell2014()` | Schell et al. progression analysis | vfprogression |
|
|
143
|
+
| `visualFields.glr()` | Linear regression with global indices | visualFields |
|
|
144
|
+
| `visualFields.plr()` | Pointwise linear regression (PLR) | visualFields |
|
|
145
|
+
| `visualFields.poplr()` | PoPLR regression analysis | visualFields |
|
|
146
|
+
</details>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
<details>
|
|
150
|
+
<summary><b>Glaucoma Diagnostic</b></summary>
|
|
151
|
+
|
|
152
|
+
## Glaucoma Diagnostic Criteria (PyGlaucoMetrics)
|
|
153
|
+
|
|
154
|
+
| Function | Description | Reference |
|
|
155
|
+
|----------|-------------|-----------|
|
|
156
|
+
| `PyGlaucoMetrics.Fn_HAP2()` | HAP2 glaucoma diagnosis | PyGlaucoMetrics[1,5] |
|
|
157
|
+
| `PyGlaucoMetrics.Fn_HAP2_part2()` | HAP2 severity classification | PyGlaucoMetrics[1,5] |
|
|
158
|
+
| `PyGlaucoMetrics.Fn_UKGTS()` | UKGTS criteria |PyGlaucoMetrics[1,5] |
|
|
159
|
+
| `PyGlaucoMetrics.Fn_LoGTS()` | LoGTS criteria |PyGlaucoMetrics[1,5] |
|
|
160
|
+
| `PyGlaucoMetrics.Fn_Foster()` | Foster criteria |PyGlaucoMetrics[1,5] |
|
|
161
|
+
| `PyGlaucoMetrics.Fn_Kangs()` | Kang's criteria |PyGlaucoMetrics[1,5] |
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<details>
|
|
167
|
+
<summary><b>Visualization Functions</b></summary>
|
|
168
|
+
## Visualization
|
|
169
|
+
|
|
170
|
+
| Function | Description |
|
|
171
|
+
|----------|-------------|
|
|
172
|
+
| `vfprogression.plotValues()` | Plot sensitivity, TD, or PD values |
|
|
173
|
+
| `vfprogression.plotProbabilities()` | Plot TDP or PDP probability maps |
|
|
174
|
+
| `visualFields.vfplot()` | Generic VF plotting function |
|
|
175
|
+
| `visualFields.vfplot_s()` | Sensitivity plot |
|
|
176
|
+
| `visualFields.vfplot_td()` | Total deviation plot |
|
|
177
|
+
| `visualFields.vfplot_pd()` | Pattern deviation plot |
|
|
178
|
+
| `visualFields.vfplotsparklines()` | Sparkline visualization |
|
|
179
|
+
| `visualFields.vflegoplot()` | Lego plot visualization |
|
|
180
|
+
| `visualFields.plotProbColormap()` | Probability colormap legend |
|
|
181
|
+
| `visualFields.vfplotplr()` | |
|
|
182
|
+
| `utils.Fn_report()` | Make a report of an eye | PyVisualFieldsV2 |
|
|
183
|
+
</details>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
## Snapshots
|
|
189
|
+
|
|
190
|
+
[See Github Repository](https://github.com/mohaEs/PyVisualField)
|
|
191
|
+
|
|
192
|
+
<img src="./imgs/1_(12).png" width="50%">
|
|
193
|
+
<img src="./imgs/1_(13).png" width="50%">
|
|
194
|
+
<img src="./imgs/1_(1).png" width="50%">
|
|
195
|
+
<img src="./imgs/1_(2).png" width="50%">
|
|
196
|
+
<img src="./imgs/1_(3).png" width="50%">
|
|
197
|
+
<img src="./imgs/1_(4).png" width="50%">
|
|
198
|
+
<img src="./imgs/1_(5).png" width="50%">
|
|
199
|
+
<img src="./imgs/1_(6).png" width="50%">
|
|
200
|
+
<img src="./imgs/1_(8).png" width="50%">
|
|
201
|
+
<img src="./imgs/1_(7).png" width="50%">
|
|
202
|
+
<img src="./imgs/1_(9).png" width="50%">
|
|
203
|
+
<img src="./imgs/1_(10).png" width="50%">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="PyVisualFields",
|
|
8
|
-
version="2.0.
|
|
8
|
+
version="2.0.4",
|
|
9
9
|
author="Mohammad Eslami, Bharath Erusalagandi, Mousa Moradi",
|
|
10
10
|
author_email="Mohammad_eslami@meei.harvard.edu",
|
|
11
11
|
description="A python toolkit for visual field analysis",
|
|
@@ -40,6 +40,7 @@ setuptools.setup(
|
|
|
40
40
|
"pandas",
|
|
41
41
|
"scipy",
|
|
42
42
|
"matplotlib",
|
|
43
|
+
"PyMuPDF",
|
|
43
44
|
],
|
|
44
45
|
python_requires=">=3.6",
|
|
45
46
|
)
|