PyVisualFields 2.0.3__tar.gz → 2.0.5__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.
Files changed (38) hide show
  1. pyvisualfields-2.0.5/LICENSE +29 -0
  2. pyvisualfields-2.0.5/PKG-INFO +242 -0
  3. pyvisualfields-2.0.5/README.md +203 -0
  4. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/setup.cfg +4 -4
  5. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/setup.py +5 -3
  6. pyvisualfields-2.0.5/src/PyVisualFields/Deviation_Analysis.py +886 -0
  7. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/PyGlaucoMetrics.py +380 -111
  8. pyvisualfields-2.0.5/src/PyVisualFields/__init__.py +1 -0
  9. pyvisualfields-2.0.5/src/PyVisualFields/utils.py +963 -0
  10. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/vfprogression.py +73 -19
  11. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/visualFields.py +360 -171
  12. pyvisualfields-2.0.5/src/PyVisualFields.egg-info/PKG-INFO +242 -0
  13. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields.egg-info/SOURCES.txt +1 -0
  14. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields.egg-info/requires.txt +1 -0
  15. pyvisualfields-2.0.3/PKG-INFO +0 -178
  16. pyvisualfields-2.0.3/README.md +0 -144
  17. pyvisualfields-2.0.3/src/PyVisualFields/Deviation_Analysis.py +0 -452
  18. pyvisualfields-2.0.3/src/PyVisualFields/__init__.py +0 -1
  19. pyvisualfields-2.0.3/src/PyVisualFields/utils.py +0 -118
  20. pyvisualfields-2.0.3/src/PyVisualFields.egg-info/PKG-INFO +0 -178
  21. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/MANIFEST.in +0 -0
  22. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/pyproject.toml +0 -0
  23. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/locmaps.json +0 -0
  24. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/normvals.json +0 -0
  25. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/normvals_meta.json +0 -0
  26. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vf.cigts.pkl +0 -0
  27. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vf.plr.nouri.2012.pkl +0 -0
  28. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vf.schell2014.pkl +0 -0
  29. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vf.vfi.pkl +0 -0
  30. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vfctrIowaPC26.pkl +0 -0
  31. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vfctrIowaPeri.pkl +0 -0
  32. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vfctrSunyiu10d2.pkl +0 -0
  33. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vfctrSunyiu24d2.pkl +0 -0
  34. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vfpwgRetest24d2.pkl +0 -0
  35. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vfpwgSunyiu24d2.pkl +0 -0
  36. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields/pkl_files/vfseries.pkl +0 -0
  37. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/src/PyVisualFields.egg-info/dependency_links.txt +0 -0
  38. {pyvisualfields-2.0.3 → pyvisualfields-2.0.5}/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,242 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyVisualFields
3
+ Version: 2.0.5
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. [1]) and visualFields (Marin-Franch et al. [2]).
49
+ Additionally, pyGlaucoMetric 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. [1])
67
+ - visualFields (by Marin-Granch et al. [2])
68
+ - pyGlaucoMetrics (by Moradi et al. [3])
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_Analysis.ipynb](demo_4_Analysis.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>Example Datasets</b></summary>
131
+ ## Example Datasets
132
+
133
+ | Function | Description | Reference |
134
+ |----------|-------------|--------|
135
+ | `visualFields.data_vfpwgRetest24d2()` | Humphrey 24-2 retest dataset | visualFields |
136
+ | `visualFields.data_vfctrSunyiu24d2()` | SUNY-IU control dataset | visualFields |
137
+ | `visualFields.data_vfpwgSunyiu24d2()` | SUNY-IU glaucoma dataset | visualFields |
138
+ | `visualFields.data_vfctrSunyiu10d2()` | SUNY-IU 10-2 control dataset | visualFields |
139
+ | `visualFields.data_vfctrIowaPC26()` | Iowa PC26 dataset | visualFields |
140
+ | `visualFields.data_vfctrIowaPeri()` | Iowa Peri dataset | visualFields |
141
+ | `vfprogression.data_vfseries()` | Longitudinal VF series dataset | vfprogression |
142
+ | `vfprogression.data_vfi()` | VFI dataset | vfprogression |
143
+ | `vfprogression.data_cigts()` | CIGTS dataset | vfprogression |
144
+ | `vfprogression.data_plrnouri2012()` | | vfprogression |
145
+ | `vfprogression.data_schell2014()` | | vfprogression |
146
+ </details>
147
+
148
+
149
+ <details>
150
+ <summary><b>Deviation Analysis </b></summary>
151
+ ## Deviation Analysis
152
+
153
+ | Function | Description | Reference |
154
+ |----------|-------------|--------|
155
+ | `visualFields.getnv()` | Get current normative environment/setting | visualFields |
156
+ | `visualFields.setnv()` | change/set normalization environment based on a predefined NV | visualFields |
157
+ | `visualFields.get_info_normvals()` | all avialbale predefined normalization environments/settings | visualFields |
158
+ | `visualFields.nvgenerate()` |generate a normalization environment based new data | visualFields |
159
+ | `utils.compute_missing_blocks()` | Compute missing blocks ( `td`, `pd`, `tdp`, `pdp`) using current normative setting NV | PyVisualFieldsV2 |
160
+ | `visualFields.gettd()` | compute td using current normative setting NV | visualFields |
161
+ | `visualFields.gettdp()` | compute tdp using current normative setting NV | visualFields |
162
+ | `visualFields.getpd()` | compute pd using current normative setting NV | visualFields |
163
+ | `visualFields.getpdp()` | compute pdp using current normative setting NV | visualFields |
164
+ | `visualFields.getgh()` | compute general heigh using current normative setting NV | visualFields |
165
+ | `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 |
166
+ | `visualFields.getglp()` | compute gl's probabilities (e.g. mdprob, psdprob) using current normative setting NV | visualFields |
167
+ </details>
168
+
169
+ <details>
170
+ <summary><b>Progression Analysis </b></summary>
171
+ ## Progression Analysis
172
+
173
+ | Function | Description |Reference |
174
+ |----------|-------------|--------|
175
+ | `vfprogression.get_score_AGIS()` | Compute AGIS score | vfprogression |
176
+ | `vfprogression.get_score_CIGTS()` | Compute CIGTS score | vfprogression |
177
+ | `vfprogression.progression_agis()` | AGIS progression analysis | vfprogression |
178
+ | `vfprogression.progression_cigts()` | CIGTS progression analysis | vfprogression |
179
+ | `vfprogression.progression_vfi()` | VFI progression analysis | vfprogression |
180
+ | `vfprogression.progression_plrnouri2012()` | Nouri et al. progression analysis | vfprogression |
181
+ | `vfprogression.progression_schell2014()` | Schell et al. progression analysis | vfprogression |
182
+ | `visualFields.glr()` | Linear regression with global indices | visualFields |
183
+ | `visualFields.plr()` | Pointwise linear regression (PLR) | visualFields |
184
+ | `visualFields.poplr()` | PoPLR regression analysis | visualFields |
185
+ </details>
186
+
187
+
188
+ <details>
189
+ <summary><b>Glaucoma Diagnostic</b></summary>
190
+
191
+ ## Glaucoma Diagnostic Criteria (PyGlaucoMetrics)
192
+
193
+ | Function | Description | Reference |
194
+ |----------|-------------|-----------|
195
+ | `PyGlaucoMetrics.Fn_HAP2()` | HAP2 glaucoma diagnosis | PyGlaucoMetrics[1,5] |
196
+ | `PyGlaucoMetrics.Fn_HAP2_part2()` | HAP2 severity classification | PyGlaucoMetrics[1,5] |
197
+ | `PyGlaucoMetrics.Fn_UKGTS()` | UKGTS criteria |PyGlaucoMetrics[1,5] |
198
+ | `PyGlaucoMetrics.Fn_LoGTS()` | LoGTS criteria |PyGlaucoMetrics[1,5] |
199
+ | `PyGlaucoMetrics.Fn_Foster()` | Foster criteria |PyGlaucoMetrics[1,5] |
200
+ | `PyGlaucoMetrics.Fn_Kangs()` | Kang's criteria |PyGlaucoMetrics[1,5] |
201
+
202
+ </details>
203
+
204
+
205
+ <details>
206
+ <summary><b>Visualization Functions</b></summary>
207
+ ## Visualization
208
+
209
+ | Function | Description |
210
+ |----------|-------------|
211
+ | `vfprogression.plotValues()` | Plot sensitivity, TD, or PD values |
212
+ | `vfprogression.plotProbabilities()` | Plot TDP or PDP probability maps |
213
+ | `visualFields.vfplot()` | Generic VF plotting function |
214
+ | `visualFields.vfplot_s()` | Sensitivity plot |
215
+ | `visualFields.vfplot_td()` | Total deviation plot |
216
+ | `visualFields.vfplot_pd()` | Pattern deviation plot |
217
+ | `visualFields.vfplotsparklines()` | Sparkline visualization |
218
+ | `visualFields.vflegoplot()` | Lego plot visualization |
219
+ | `visualFields.plotProbColormap()` | Probability colormap legend |
220
+ | `visualFields.vfplotplr()` | |
221
+ | `utils.Fn_report()` | Make a report of an eye | PyVisualFieldsV2 |
222
+ </details>
223
+
224
+
225
+
226
+
227
+ ## Snapshots
228
+
229
+ [See Github Repository](https://github.com/mohaEs/PyVisualField)
230
+
231
+ <img src="./imgs/1_(12).png" width="50%">
232
+ <img src="./imgs/1_(13).png" width="50%">
233
+ <img src="./imgs/1_(1).png" width="50%">
234
+ <img src="./imgs/1_(2).png" width="50%">
235
+ <img src="./imgs/1_(3).png" width="50%">
236
+ <img src="./imgs/1_(4).png" width="50%">
237
+ <img src="./imgs/1_(5).png" width="50%">
238
+ <img src="./imgs/1_(6).png" width="50%">
239
+ <img src="./imgs/1_(8).png" width="50%">
240
+ <img src="./imgs/1_(7).png" width="50%">
241
+ <img src="./imgs/1_(9).png" width="50%">
242
+ <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.3",
8
+ version="2.0.5",
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",
@@ -16,14 +16,15 @@ setuptools.setup(
16
16
  "Bug Tracker": "https://github.com/mohaEs/PyVisualField/issues",
17
17
  "Demo Normalization": "https://github.com/mohaEs/PyVisualField/blob/main/demo_2_Deviation_Analysis.ipynb",
18
18
  "Demo Plotting": "https://github.com/mohaEs/PyVisualField/blob/main/demo_3_Plotting.ipynb",
19
- "Demo Prorgression Analysis": "https://github.com/mohaEs/PyVisualField/blob/main/demo_4_Analysis.ipynb",
19
+ "Demo Progression Analysis": "https://github.com/mohaEs/PyVisualField/blob/main/demo_4_ProgressionAnalysis.ipynb",
20
20
  "Demo Data": "https://github.com/mohaEs/PyVisualField/blob/main/demo_1_Data.ipynb",
21
21
  "Demo Glaucoma Detection": "https://github.com/mohaEs/PyVisualField/blob/main/demo5_PyGlaucoMetrics.ipynb",
22
22
  "Harvard Ophthalmology AI LAB": "https://ophai.hms.harvard.edu/"
23
23
  },
24
+ license="BSD-3-Clause",
24
25
  classifiers=[
25
26
  "Programming Language :: Python :: 3",
26
- "License :: OSI Approved :: MIT License",
27
+ "License :: OSI Approved :: BSD License",
27
28
  "Operating System :: OS Independent",
28
29
  ],
29
30
  package_dir={"": "src"},
@@ -40,6 +41,7 @@ setuptools.setup(
40
41
  "pandas",
41
42
  "scipy",
42
43
  "matplotlib",
44
+ "PyMuPDF",
43
45
  ],
44
46
  python_requires=">=3.6",
45
47
  )