Visisipy (pronounced /ˌvɪsəˈsɪpi/, like Mississippi but with a V) is a Python library for optical simulations of the eye.
It provides an easy-to-use interface to define and build eye models, and to perform common ophthalmic analyses on these models.
- Provide a uniform interface to define, build and analyze various types of eye models, using abstractions that are relevant in a clinical context.
- Provide a collection of ready-to-use eye models, such as the Navarro model1, that can be customized at need.
- Provide an accessible interface to clinically relevant analyses on these models, such as off-axis refraction calculations.
- Modular design with support for multiple backends, both open-source and commercial.
Visisipy aims to be a community-driven project and warmly accepts contributions. If you want to contribute, please email us (visisipy@mreye.nl) or open a new discussion.
Visisipy can be installed through pip:
pip install visisipyVisisipy is also available on Conda Forge:
conda install -c conda-forge visisipyimport visisipy
import matplotlib.pyplot as plt
import seaborn as sns
# Initialize the default Navarro model
model = visisipy.EyeModel()
# Build the model in OpticStudio
model.build()
# Perform a raytrace analysis
coordinates = [(0, 0), (0, 10), (0, 20), (0, 30), (0, 40)]
raytrace = visisipy.analysis.raytrace(coordinates=coordinates)
# Alternatively, the model can be built and analyzed in one go:
# raytrace = visisipy.analysis.raytrace(model, coordinates=zip([0] * 5, range(0, 60, 10)))
# Visualize the model
fig, ax = plt.subplots()
visisipy.plots.plot_eye(ax, model.geometry, lens_edge_thickness=0.5)
ax.set_xlim((-7, 23))
ax.set_ylim((-15, 15))
ax.set_aspect('equal')
sns.lineplot(raytrace, x="z", y="y", hue="field", ax=ax)
plt.show()Read the full documentation at visisipy.readthedocs.io.