PyVisualFields 2.0.7__tar.gz → 2.0.9__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.7/src/PyVisualFields.egg-info → pyvisualfields-2.0.9}/PKG-INFO +375 -242
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/README.md +140 -7
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/setup.cfg +4 -4
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/setup.py +1 -1
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/PyGlaucoMetrics.py +20 -3
- pyvisualfields-2.0.9/src/PyVisualFields/__init__.py +1 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/utils.py +8 -4
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9/src/PyVisualFields.egg-info}/PKG-INFO +375 -242
- pyvisualfields-2.0.7/src/PyVisualFields/__init__.py +0 -1
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/LICENSE +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/MANIFEST.in +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/pyproject.toml +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/Deviation_Analysis.py +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/locmaps.json +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/normvals.json +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/normvals_meta.json +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vf.cigts.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vf.plr.nouri.2012.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vf.schell2014.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vf.vfi.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vfctrIowaPC26.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vfctrIowaPeri.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vfctrSunyiu10d2.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vfctrSunyiu24d2.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vfpwgRetest24d2.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vfpwgSunyiu24d2.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/pkl_files/vfseries.pkl +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/vfprogression.py +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields/visualFields.py +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields.egg-info/SOURCES.txt +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields.egg-info/dependency_links.txt +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields.egg-info/requires.txt +0 -0
- {pyvisualfields-2.0.7 → pyvisualfields-2.0.9}/src/PyVisualFields.egg-info/top_level.txt +0 -0
|
@@ -1,242 +1,375 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: PyVisualFields
|
|
3
|
-
Version: 2.0.
|
|
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
|
-
License: BSD-3-Clause
|
|
9
|
-
Project-URL: Bug Tracker, https://github.com/mohaEs/PyVisualField/issues
|
|
10
|
-
Project-URL: Demo Normalization, https://github.com/mohaEs/PyVisualField/blob/main/demo_2_Deviation_Analysis.ipynb
|
|
11
|
-
Project-URL: Demo Plotting, https://github.com/mohaEs/PyVisualField/blob/main/demo_3_Plotting.ipynb
|
|
12
|
-
Project-URL: Demo Progression Analysis, https://github.com/mohaEs/PyVisualField/blob/main/demo_4_ProgressionAnalysis.ipynb
|
|
13
|
-
Project-URL: Demo Data, https://github.com/mohaEs/PyVisualField/blob/main/demo_1_Data.ipynb
|
|
14
|
-
Project-URL: Demo Glaucoma Detection, https://github.com/mohaEs/PyVisualField/blob/main/demo5_PyGlaucoMetrics.ipynb
|
|
15
|
-
Project-URL: Harvard Ophthalmology AI LAB, https://ophai.hms.harvard.edu/
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
18
|
-
Classifier: Operating System :: OS Independent
|
|
19
|
-
Requires-Python: >=3.6
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
Requires-Dist: numpy
|
|
23
|
-
Requires-Dist: pandas
|
|
24
|
-
Requires-Dist: scipy
|
|
25
|
-
Requires-Dist: matplotlib
|
|
26
|
-
Requires-Dist: PyMuPDF
|
|
27
|
-
Dynamic: author
|
|
28
|
-
Dynamic: author-email
|
|
29
|
-
Dynamic: classifier
|
|
30
|
-
Dynamic: description
|
|
31
|
-
Dynamic: description-content-type
|
|
32
|
-
Dynamic: home-page
|
|
33
|
-
Dynamic: license
|
|
34
|
-
Dynamic: license-file
|
|
35
|
-
Dynamic: project-url
|
|
36
|
-
Dynamic: requires-dist
|
|
37
|
-
Dynamic: requires-python
|
|
38
|
-
Dynamic: summary
|
|
39
|
-
|
|
40
|
-
# PyVisualFields
|
|
41
|
-
|
|
42
|
-
## A python tool collection for analyzing visual fields
|
|
43
|
-
|
|
44
|
-
This packages includes functions for visuald field analysis and display.
|
|
45
|
-
|
|
46
|
-
https://pypi.org/project/PyVisualFields/
|
|
47
|
-
|
|
48
|
-
Version 2 is R-independent while maintaining the original module organization. The modules are inspired by vfprogression (Elze et al. [
|
|
49
|
-
Additionally,
|
|
50
|
-
|
|
51
|
-
These functions are implemented in Python, and their functionalities are demonstrated across four primary categories:
|
|
52
|
-
- Data Presentation
|
|
53
|
-
- Plotting
|
|
54
|
-
- Scoring and Progression Analysis
|
|
55
|
-
- Normalization Analysis
|
|
56
|
-
- Glaucoma Detection
|
|
57
|
-
|
|
58
|
-
For each category, we provide comprehensive Jupyter notebooks containing practical examples, detailed function descriptions, required inputs/dependencies, and expected outputs.
|
|
59
|
-
|
|
60
|
-
## Citation
|
|
61
|
-
If you found this package impactful for your research, please cite the following article:
|
|
62
|
-
- PyVisualFields v2
|
|
63
|
-
- 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.
|
|
64
|
-
|
|
65
|
-
and of course the corresponding sub-package:
|
|
66
|
-
- vfprogression (by Elze et al. [
|
|
67
|
-
- visualFields (by Marin-Granch et al. [
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
## Installation:
|
|
71
|
-
|
|
72
|
-
> pip install PyVisualFields
|
|
73
|
-
|
|
74
|
-
## Demo jupyter notebooks
|
|
75
|
-
|
|
76
|
-
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>
|
|
77
|
-
- Data [demo_1_Data.ipynb](demo_1_Data.ipynb)
|
|
78
|
-
- Normalization and deviation analysis [demo_2_Deviation_Analysis.ipynb](demo_2_Deviation_Analysis.ipynb)
|
|
79
|
-
- Plotting [demo_3_Plotting.ipynb](demo_3_Plotting.ipynb)
|
|
80
|
-
- Progression Analysis [
|
|
81
|
-
- Glaucoma Detection [demo5_PyGlaucoMetrics.ipynb](demo5_PyGlaucoMetrics.ipynb) </br>
|
|
82
|
-
|
|
83
|
-
__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
|
|
84
|
-
https://github.com/Mousamoradi/PyGlaucoMetrics
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## references:
|
|
88
|
-
[1] PyVisualFields v2
|
|
89
|
-
[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.
|
|
90
|
-
[3] https://cran.r-project.org/web/packages/vfprogression/index.html </br>
|
|
91
|
-
[4] https://cran.r-project.org/web/packages/visualFields/index.html </br>
|
|
92
|
-
[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
|
|
93
|
-
</br>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## list of functions
|
|
97
|
-
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>
|
|
98
|
-
- Data [demo_1_Data.ipynb](demo_1_Data.ipynb)
|
|
99
|
-
- Normalization and deviation analysis [demo_2_Deviation_Analysis.ipynb](demo_2_Deviation_Analysis.ipynb)
|
|
100
|
-
- Plotting [demo_3_Plotting.ipynb](demo_3_Plotting.ipynb)
|
|
101
|
-
- Progression Analysis [demo_4_ProgressionAnalysis.ipynb](demo_4_ProgressionAnalysis.ipynb)
|
|
102
|
-
- Glaucoma Detection [demo5_PyGlaucoMetrics.ipynb](demo5_PyGlaucoMetrics.ipynb)
|
|
103
|
-
</br>
|
|
104
|
-
|
|
105
|
-
### Notice:
|
|
106
|
-
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.
|
|
107
|
-
|
|
108
|
-
Functions based on _vfprogression_ package accept 24-2 or 30-2 visual field measurement while functions based on _visualFields_ also accept 10-2.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# Function Reference
|
|
112
|
-
|
|
113
|
-
<details>
|
|
114
|
-
<summary><b>Data Utilities </b></summary>
|
|
115
|
-
## Data Utilities
|
|
116
|
-
|
|
117
|
-
| Function | Description | Reference |
|
|
118
|
-
|----------|-------------|--------|
|
|
119
|
-
| `utils.canonicalize_vf_df()` | Canonicalize VF data to PyVisualFields format | PyVisualFieldsV2 |
|
|
120
|
-
| `utils.canonicalize_vf_df(, sort_byDateAge=True)` | Canonicalize and sort VFs by date/age within each patient | PyVisualFieldsV2 |
|
|
121
|
-
| `utils.print_vf_summary()` | Print a summary of available VF information | PyVisualFieldsV2 |
|
|
122
|
-
| `utils.investigate_vf_df()` | Return a summary of available VF information | PyVisualFieldsV2 |
|
|
123
|
-
| `utils.vf_blocks()` | Identify available VF blocks (`s`, `td`, `pd`, `tdp`, `pdp`) | PyVisualFieldsV2 |
|
|
124
|
-
| `utils.missing_blocks()` | Identify missing VF blocks | PyVisualFieldsV2 |
|
|
125
|
-
| `utils.compute_missing_blocks()` | Compute missing blocks using current normative setting NV | PyVisualFieldsV2 |
|
|
126
|
-
</details>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<details>
|
|
130
|
-
<summary><b>
|
|
131
|
-
##
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyVisualFields
|
|
3
|
+
Version: 2.0.9
|
|
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
|
+
License: BSD-3-Clause
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/mohaEs/PyVisualField/issues
|
|
10
|
+
Project-URL: Demo Normalization, https://github.com/mohaEs/PyVisualField/blob/main/demo_2_Deviation_Analysis.ipynb
|
|
11
|
+
Project-URL: Demo Plotting, https://github.com/mohaEs/PyVisualField/blob/main/demo_3_Plotting.ipynb
|
|
12
|
+
Project-URL: Demo Progression Analysis, https://github.com/mohaEs/PyVisualField/blob/main/demo_4_ProgressionAnalysis.ipynb
|
|
13
|
+
Project-URL: Demo Data, https://github.com/mohaEs/PyVisualField/blob/main/demo_1_Data.ipynb
|
|
14
|
+
Project-URL: Demo Glaucoma Detection, https://github.com/mohaEs/PyVisualField/blob/main/demo5_PyGlaucoMetrics.ipynb
|
|
15
|
+
Project-URL: Harvard Ophthalmology AI LAB, https://ophai.hms.harvard.edu/
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Requires-Python: >=3.6
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: numpy
|
|
23
|
+
Requires-Dist: pandas
|
|
24
|
+
Requires-Dist: scipy
|
|
25
|
+
Requires-Dist: matplotlib
|
|
26
|
+
Requires-Dist: PyMuPDF
|
|
27
|
+
Dynamic: author
|
|
28
|
+
Dynamic: author-email
|
|
29
|
+
Dynamic: classifier
|
|
30
|
+
Dynamic: description
|
|
31
|
+
Dynamic: description-content-type
|
|
32
|
+
Dynamic: home-page
|
|
33
|
+
Dynamic: license
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
Dynamic: project-url
|
|
36
|
+
Dynamic: requires-dist
|
|
37
|
+
Dynamic: requires-python
|
|
38
|
+
Dynamic: summary
|
|
39
|
+
|
|
40
|
+
# PyVisualFields
|
|
41
|
+
|
|
42
|
+
## A python tool collection for analyzing visual fields
|
|
43
|
+
|
|
44
|
+
This packages includes functions for visuald field analysis and display.
|
|
45
|
+
|
|
46
|
+
https://pypi.org/project/PyVisualFields/
|
|
47
|
+
|
|
48
|
+
Version 2 is R-independent while maintaining the original module organization. The modules are inspired by vfprogression (Elze et al. [3]) and visualFields (Marin-Franch et al. [4]).
|
|
49
|
+
Additionally, PyGlaucoMetric[5] has been integrated to enable glaucoma classification based on visual field patterns.
|
|
50
|
+
|
|
51
|
+
These functions are implemented in Python, and their functionalities are demonstrated across four primary categories:
|
|
52
|
+
- Data Presentation
|
|
53
|
+
- Plotting
|
|
54
|
+
- Scoring and Progression Analysis
|
|
55
|
+
- Normalization Analysis
|
|
56
|
+
- Glaucoma Detection
|
|
57
|
+
|
|
58
|
+
For each category, we provide comprehensive Jupyter notebooks containing practical examples, detailed function descriptions, required inputs/dependencies, and expected outputs.
|
|
59
|
+
|
|
60
|
+
## Citation
|
|
61
|
+
If you found this package impactful for your research, please cite the following article:
|
|
62
|
+
- PyVisualFields v2
|
|
63
|
+
- 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.
|
|
64
|
+
|
|
65
|
+
and of course the corresponding sub-package:
|
|
66
|
+
- vfprogression (by Elze et al. [3])
|
|
67
|
+
- visualFields (by Marin-Granch et al. [4])
|
|
68
|
+
- PyGlaucoMetrics (by Moradi et al. [5])
|
|
69
|
+
|
|
70
|
+
## Installation:
|
|
71
|
+
|
|
72
|
+
> pip install PyVisualFields
|
|
73
|
+
|
|
74
|
+
## Demo jupyter notebooks
|
|
75
|
+
|
|
76
|
+
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>
|
|
77
|
+
- Data [demo_1_Data.ipynb](demo_1_Data.ipynb)
|
|
78
|
+
- Normalization and deviation analysis [demo_2_Deviation_Analysis.ipynb](demo_2_Deviation_Analysis.ipynb)
|
|
79
|
+
- Plotting [demo_3_Plotting.ipynb](demo_3_Plotting.ipynb)
|
|
80
|
+
- Progression Analysis [demo_4_ProgressionAnalysis.ipynb](demo_4_ProgressionAnalysis.ipynb)
|
|
81
|
+
- Glaucoma Detection [demo5_PyGlaucoMetrics.ipynb](demo5_PyGlaucoMetrics.ipynb) </br>
|
|
82
|
+
|
|
83
|
+
__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.
|
|
84
|
+
https://github.com/Mousamoradi/PyGlaucoMetrics
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## references:
|
|
88
|
+
[1] PyVisualFields v2
|
|
89
|
+
[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.
|
|
90
|
+
[3] https://cran.r-project.org/web/packages/vfprogression/index.html </br>
|
|
91
|
+
[4] https://cran.r-project.org/web/packages/visualFields/index.html </br>
|
|
92
|
+
[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
|
|
93
|
+
</br>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## list of functions
|
|
97
|
+
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>
|
|
98
|
+
- Data [demo_1_Data.ipynb](demo_1_Data.ipynb)
|
|
99
|
+
- Normalization and deviation analysis [demo_2_Deviation_Analysis.ipynb](demo_2_Deviation_Analysis.ipynb)
|
|
100
|
+
- Plotting [demo_3_Plotting.ipynb](demo_3_Plotting.ipynb)
|
|
101
|
+
- Progression Analysis [demo_4_ProgressionAnalysis.ipynb](demo_4_ProgressionAnalysis.ipynb)
|
|
102
|
+
- Glaucoma Detection [demo5_PyGlaucoMetrics.ipynb](demo5_PyGlaucoMetrics.ipynb)
|
|
103
|
+
</br>
|
|
104
|
+
|
|
105
|
+
### Notice:
|
|
106
|
+
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.
|
|
107
|
+
|
|
108
|
+
Functions based on _vfprogression_ package accept 24-2 or 30-2 visual field measurement while functions based on _visualFields_ also accept 10-2.
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# Function Reference
|
|
112
|
+
|
|
113
|
+
<details>
|
|
114
|
+
<summary><b>Data Utilities </b></summary>
|
|
115
|
+
## Data Utilities
|
|
116
|
+
|
|
117
|
+
| Function | Description | Reference |
|
|
118
|
+
|----------|-------------|--------|
|
|
119
|
+
| `utils.canonicalize_vf_df()` | Canonicalize VF data to PyVisualFields format | PyVisualFieldsV2 |
|
|
120
|
+
| `utils.canonicalize_vf_df(, sort_byDateAge=True)` | Canonicalize and sort VFs by date/age within each patient | PyVisualFieldsV2 |
|
|
121
|
+
| `utils.print_vf_summary()` | Print a summary of available VF information | PyVisualFieldsV2 |
|
|
122
|
+
| `utils.investigate_vf_df()` | Return a summary of available VF information | PyVisualFieldsV2 |
|
|
123
|
+
| `utils.vf_blocks()` | Identify available VF blocks (`s`, `td`, `pd`, `tdp`, `pdp`) | PyVisualFieldsV2 |
|
|
124
|
+
| `utils.missing_blocks()` | Identify missing VF blocks | PyVisualFieldsV2 |
|
|
125
|
+
| `utils.compute_missing_blocks()` | Compute missing blocks using current normative setting NV | PyVisualFieldsV2 |
|
|
126
|
+
</details>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
<details>
|
|
130
|
+
<summary><b>Data Structures and Canonicalization </b></summary>
|
|
131
|
+
## Data Structures and Canonicalization
|
|
132
|
+
|
|
133
|
+
## Data Canonicalization
|
|
134
|
+
|
|
135
|
+
PyVisualFields provides two helper functions:
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
canonicalize_vf_df()
|
|
139
|
+
canonicalize_vf_row()
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
to standardize visual field data into a unified format compatible with all package functions.
|
|
143
|
+
|
|
144
|
+
The canonicalization functions standardize recognized visual field and metadata columns while preserving all other columns unchanged, allowing user-specific variables and auxiliary information to be retained throughout the analysis pipeline.
|
|
145
|
+
|
|
146
|
+
### Supported Pointwise Data
|
|
147
|
+
|
|
148
|
+
The following pointwise aliases are automatically recognized:
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
POINT_ALIASES = {
|
|
152
|
+
"sens": ["l", "s", "sen", "sens", "sensitivity"],
|
|
153
|
+
"td": ["td"],
|
|
154
|
+
"pd": ["pd"],
|
|
155
|
+
"tdp": ["tdp"],
|
|
156
|
+
"pdp": ["pdp"],
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The parser automatically handles:
|
|
161
|
+
|
|
162
|
+
* Different prefixes (e.g., `s`, `sen`, `sens`, `sensitivity`)
|
|
163
|
+
* Upper/lower-case variations (e.g., `TD1`, `td1`)
|
|
164
|
+
* Common separators (e.g., `td1`, `td_1`, `td-1`, `td 1`)
|
|
165
|
+
|
|
166
|
+
and converts them into the canonical format:
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
l1-l54 Raw sensitivity values
|
|
170
|
+
td1-td54 Total Deviation values
|
|
171
|
+
tdp1-tdp54 Total Deviation probability values
|
|
172
|
+
pd1-pd54 Pattern Deviation values
|
|
173
|
+
pdp1-pdp54 Pattern Deviation probability values
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Both 52-point and 54-point visual fields are supported automatically. For 52-point fields, the two blind-spot locations are inserted automatically.
|
|
177
|
+
|
|
178
|
+
### Supported Metadata
|
|
179
|
+
|
|
180
|
+
Common metadata fields are also standardized when possible, including:
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
patientid
|
|
184
|
+
eyeid
|
|
185
|
+
date
|
|
186
|
+
age
|
|
187
|
+
yearsfollowed
|
|
188
|
+
md
|
|
189
|
+
mdprob
|
|
190
|
+
psd
|
|
191
|
+
psdprob
|
|
192
|
+
ght
|
|
193
|
+
vfi
|
|
194
|
+
vfiprob
|
|
195
|
+
msens
|
|
196
|
+
msensprob
|
|
197
|
+
ssens
|
|
198
|
+
ssensprob
|
|
199
|
+
tmd
|
|
200
|
+
tmdprob
|
|
201
|
+
tsd
|
|
202
|
+
tsdprob
|
|
203
|
+
pmd
|
|
204
|
+
pmdprob
|
|
205
|
+
gh
|
|
206
|
+
ghprob
|
|
207
|
+
fpr
|
|
208
|
+
fnr
|
|
209
|
+
fl
|
|
210
|
+
duration
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
For example:
|
|
214
|
+
|
|
215
|
+
```text
|
|
216
|
+
patient_id -> patientid
|
|
217
|
+
subjectid -> patientid
|
|
218
|
+
mrn -> patientid
|
|
219
|
+
|
|
220
|
+
eye -> eyeid
|
|
221
|
+
laterality -> eyeid
|
|
222
|
+
|
|
223
|
+
examdate -> date
|
|
224
|
+
testdate -> date
|
|
225
|
+
|
|
226
|
+
mdp -> mdprob
|
|
227
|
+
psdp -> psdprob
|
|
228
|
+
vfip -> vfiprob
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
After canonicalization, all PyVisualFields functions can assume a consistent schema regardless of the original data source.
|
|
232
|
+
|
|
233
|
+
PyVisualFields supports both device-reported and computed global indices.
|
|
234
|
+
|
|
235
|
+
| Variable | Description |
|
|
236
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------- |
|
|
237
|
+
| **s** / **l1-l54** | Raw visual field sensitivities (dB) at each test location. |
|
|
238
|
+
| **msens** | Mean sensitivity (MS) across all visual field locations. |
|
|
239
|
+
| **ssens** | Standard deviation of sensitivity values across locations. |
|
|
240
|
+
| **td1-td54** | Total Deviation values (measured sensitivity − age-expected normal sensitivity). |
|
|
241
|
+
| **tdp1-tdp54** | Total Deviation probability values; statistical significance of each TD location. |
|
|
242
|
+
| **pdp1-pdp54** | Pattern Deviation probability values; statistical significance of each PD location. |
|
|
243
|
+
| **MD** | The Humphrey MD index. |
|
|
244
|
+
| **tmd** | Total Mean Deviation; weighted mean of Total Deviation values. Similar to the Humphrey MD index. |
|
|
245
|
+
| **tsd** | Total Standard Deviation; weighted standard deviation of Total Deviation values. |
|
|
246
|
+
| **pd1-pd54** | Pattern Deviation values (Total Deviation corrected for generalized depression). |
|
|
247
|
+
| **pmd** | Pattern Mean Deviation; weighted mean of Pattern Deviation values. |
|
|
248
|
+
| **psd** | Pattern Standard Deviation; weighted standard deviation of Pattern Deviation values. |
|
|
249
|
+
| **ght** | Glaucoma Hemifield Test result (Within Normal Limits, Borderline, Outside Normal Limits, etc.). |
|
|
250
|
+
| **gh** | General Height (generalized sensitivity adjustment used in Pattern Deviation calculations). |
|
|
251
|
+
| **vfi** | Visual Field Index (%), where 100 indicates a normal visual field and lower values indicate greater functional loss. |
|
|
252
|
+
| **fpr** | False Positive Rate (%). |
|
|
253
|
+
| **fnr** | False Negative Rate (%). |
|
|
254
|
+
| **fl** | Fixation Loss Rate (%). |
|
|
255
|
+
| **duration** | Test duration. |
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
</details>
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
<details>
|
|
263
|
+
<summary><b>Example Datasets</b></summary>
|
|
264
|
+
## Example Datasets
|
|
265
|
+
|
|
266
|
+
| Function | Description | Reference |
|
|
267
|
+
|----------|-------------|--------|
|
|
268
|
+
| `visualFields.data_vfpwgRetest24d2()` | Humphrey 24-2 retest dataset | visualFields |
|
|
269
|
+
| `visualFields.data_vfctrSunyiu24d2()` | SUNY-IU control dataset | visualFields |
|
|
270
|
+
| `visualFields.data_vfpwgSunyiu24d2()` | SUNY-IU glaucoma dataset | visualFields |
|
|
271
|
+
| `visualFields.data_vfctrSunyiu10d2()` | SUNY-IU 10-2 control dataset | visualFields |
|
|
272
|
+
| `visualFields.data_vfctrIowaPC26()` | Iowa PC26 dataset | visualFields |
|
|
273
|
+
| `visualFields.data_vfctrIowaPeri()` | Iowa Peri dataset | visualFields |
|
|
274
|
+
| `vfprogression.data_vfseries()` | Longitudinal VF series dataset | vfprogression |
|
|
275
|
+
| `vfprogression.data_vfi()` | VFI dataset | vfprogression |
|
|
276
|
+
| `vfprogression.data_cigts()` | CIGTS dataset | vfprogression |
|
|
277
|
+
| `vfprogression.data_plrnouri2012()` | | vfprogression |
|
|
278
|
+
| `vfprogression.data_schell2014()` | | vfprogression |
|
|
279
|
+
</details>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
<details>
|
|
283
|
+
<summary><b>Deviation Analysis </b></summary>
|
|
284
|
+
## Deviation Analysis
|
|
285
|
+
|
|
286
|
+
| Function | Description | Reference |
|
|
287
|
+
|----------|-------------|--------|
|
|
288
|
+
| `visualFields.getnv()` | Get current normative environment/setting | visualFields |
|
|
289
|
+
| `visualFields.setnv()` | change/set normalization environment based on a predefined NV | visualFields |
|
|
290
|
+
| `visualFields.get_info_normvals()` | all avialbale predefined normalization environments/settings | visualFields |
|
|
291
|
+
| `visualFields.nvgenerate()` |generate a normalization environment based new data | visualFields |
|
|
292
|
+
| `utils.compute_missing_blocks()` | Compute missing blocks ( `td`, `pd`, `tdp`, `pdp`) using current normative setting NV | PyVisualFieldsV2 |
|
|
293
|
+
| `visualFields.gettd()` | compute td using current normative setting NV | visualFields |
|
|
294
|
+
| `visualFields.gettdp()` | compute tdp using current normative setting NV | visualFields |
|
|
295
|
+
| `visualFields.getpd()` | compute pd using current normative setting NV | visualFields |
|
|
296
|
+
| `visualFields.getpdp()` | compute pdp using current normative setting NV | visualFields |
|
|
297
|
+
| `visualFields.getgh()` | compute general heigh using current normative setting NV | visualFields |
|
|
298
|
+
| `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 |
|
|
299
|
+
| `visualFields.getglp()` | compute gl's probabilities (e.g. mdprob, psdprob) using current normative setting NV | visualFields |
|
|
300
|
+
</details>
|
|
301
|
+
|
|
302
|
+
<details>
|
|
303
|
+
<summary><b>Progression Analysis </b></summary>
|
|
304
|
+
## Progression Analysis
|
|
305
|
+
|
|
306
|
+
| Function | Description |Reference |
|
|
307
|
+
|----------|-------------|--------|
|
|
308
|
+
| `vfprogression.get_score_AGIS()` | Compute AGIS score | vfprogression |
|
|
309
|
+
| `vfprogression.get_score_CIGTS()` | Compute CIGTS score | vfprogression |
|
|
310
|
+
| `vfprogression.progression_agis()` | AGIS progression analysis | vfprogression |
|
|
311
|
+
| `vfprogression.progression_cigts()` | CIGTS progression analysis | vfprogression |
|
|
312
|
+
| `vfprogression.progression_vfi()` | VFI progression analysis | vfprogression |
|
|
313
|
+
| `vfprogression.progression_plrnouri2012()` | Nouri et al. progression analysis | vfprogression |
|
|
314
|
+
| `vfprogression.progression_schell2014()` | Schell et al. progression analysis | vfprogression |
|
|
315
|
+
| `visualFields.glr()` | Linear regression with global indices | visualFields |
|
|
316
|
+
| `visualFields.plr()` | Pointwise linear regression (PLR) | visualFields |
|
|
317
|
+
| `visualFields.poplr()` | PoPLR regression analysis | visualFields |
|
|
318
|
+
</details>
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
<details>
|
|
322
|
+
<summary><b>Glaucoma Diagnostic</b></summary>
|
|
323
|
+
|
|
324
|
+
## Glaucoma Diagnostic Criteria (PyGlaucoMetrics)
|
|
325
|
+
|
|
326
|
+
| Function | Description | Reference |
|
|
327
|
+
|----------|-------------|-----------|
|
|
328
|
+
| `PyGlaucoMetrics.Fn_HAP2()` | HAP2 glaucoma diagnosis | PyGlaucoMetrics[1,5] |
|
|
329
|
+
| `PyGlaucoMetrics.Fn_HAP2_part2()` | HAP2 severity classification | PyGlaucoMetrics[1,5] |
|
|
330
|
+
| `PyGlaucoMetrics.Fn_UKGTS()` | UKGTS criteria |PyGlaucoMetrics[1,5] |
|
|
331
|
+
| `PyGlaucoMetrics.Fn_LoGTS()` | LoGTS criteria |PyGlaucoMetrics[1,5] |
|
|
332
|
+
| `PyGlaucoMetrics.Fn_Foster()` | Foster criteria |PyGlaucoMetrics[1,5] |
|
|
333
|
+
| `PyGlaucoMetrics.Fn_Kangs()` | Kang's criteria |PyGlaucoMetrics[1,5] |
|
|
334
|
+
|
|
335
|
+
</details>
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
<details>
|
|
339
|
+
<summary><b>Visualization Functions</b></summary>
|
|
340
|
+
## Visualization
|
|
341
|
+
|
|
342
|
+
| Function | Description |
|
|
343
|
+
|----------|-------------|
|
|
344
|
+
| `vfprogression.plotValues()` | Plot sensitivity, TD, or PD values |
|
|
345
|
+
| `vfprogression.plotProbabilities()` | Plot TDP or PDP probability maps |
|
|
346
|
+
| `visualFields.vfplot()` | Generic VF plotting function |
|
|
347
|
+
| `visualFields.vfplot_s()` | Sensitivity plot |
|
|
348
|
+
| `visualFields.vfplot_td()` | Total deviation plot |
|
|
349
|
+
| `visualFields.vfplot_pd()` | Pattern deviation plot |
|
|
350
|
+
| `visualFields.vfplotsparklines()` | Sparkline visualization |
|
|
351
|
+
| `visualFields.vflegoplot()` | Lego plot visualization |
|
|
352
|
+
| `visualFields.plotProbColormap()` | Probability colormap legend |
|
|
353
|
+
| `visualFields.vfplotplr()` | |
|
|
354
|
+
| `utils.Fn_report()` | Make a report of an eye | PyVisualFieldsV2 |
|
|
355
|
+
</details>
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
## Snapshots
|
|
361
|
+
|
|
362
|
+
[See Github Repository](https://github.com/mohaEs/PyVisualField)
|
|
363
|
+
|
|
364
|
+
<img src="./imgs/1_(12).png" width="50%">
|
|
365
|
+
<img src="./imgs/1_(13).png" width="50%">
|
|
366
|
+
<img src="./imgs/1_(1).png" width="50%">
|
|
367
|
+
<img src="./imgs/1_(2).png" width="50%">
|
|
368
|
+
<img src="./imgs/1_(3).png" width="50%">
|
|
369
|
+
<img src="./imgs/1_(4).png" width="50%">
|
|
370
|
+
<img src="./imgs/1_(5).png" width="50%">
|
|
371
|
+
<img src="./imgs/1_(6).png" width="50%">
|
|
372
|
+
<img src="./imgs/1_(8).png" width="50%">
|
|
373
|
+
<img src="./imgs/1_(7).png" width="50%">
|
|
374
|
+
<img src="./imgs/1_(9).png" width="50%">
|
|
375
|
+
<img src="./imgs/1_(10).png" width="50%">
|