Skip to main content

Accessible vision simulations in Python.

Project description

Visisipy: accessible vision simulations in Python

PyPI - Version Conda Version Python Version from PEP 621 TOML GitHub License GitHub Actions Workflow Status Documentation Status DOI

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.

Goals

  1. Provide a uniform interface to define, build and analyze various types of eye models, using abstractions that are relevant in a clinical context.
  2. Provide a collection of ready-to-use eye models, such as the Navarro model[^navarro], that can be customized as needed.
  3. Provide an accessible interface to clinically relevant analyses on these models, such as off-axis refraction calculations.
  4. Modular design with support for multiple backends, both open-source and commercial.

Contributing

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.

Installation

Visisipy can be installed through pip:

pip install visisipy

Visisipy is also available on Conda Forge:

conda install -c conda-forge visisipy

Example

import matplotlib.pyplot as plt
import seaborn as sns

import visisipy

# Uncomment the following line to use the open-source Optiland backend instead of OpticStudio
# visisipy.set_backend("optiland")

# Initialize the default Navarro model
model = visisipy.EyeModel()
model.geometry.pupil.thickness = 2.0

# 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)

sns.lineplot(raytrace, x="z", y="y", hue="field", ax=ax)

plt.show()

Documentation

Read the full documentation at visisipy.readthedocs.io.

[^navarro]: Escudero-Sanz, I., & Navarro, R. (1999). Off-axis aberrations of a wide-angle schematic eye model. JOSA A, 16(8), 1881–1891. https://doi.org/10.1364/JOSAA.16.001881

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

visisipy-0.4.0.tar.gz (7.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

visisipy-0.4.0-py3-none-any.whl (106.8 kB view details)

Uploaded Python 3

File details

Details for the file visisipy-0.4.0.tar.gz.

File metadata

  • Download URL: visisipy-0.4.0.tar.gz
  • Upload date:
  • Size: 7.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for visisipy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 47dea8e9098c8dd411dc5f1f1faa36f30f09e29f74553635e0a3606cbcd071e0
MD5 786481f80947f2a80a56c5d2a76aa896
BLAKE2b-256 d3f5ef4850cf0722270016af34f3b7e636ac00284fa647ee93c05566421a7466

See more details on using hashes here.

File details

Details for the file visisipy-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: visisipy-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 106.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for visisipy-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f49ea616aae62be5cd8f19a45084cf0a0221b3552e4e4662f8715198f94c417d
MD5 010d75cfe4a9ed86f9aa25b57a202ea5
BLAKE2b-256 2edc0ac03ee08bd0725c16cdaeb9f19a5919ac40ee2db05bef199ff68d86c397

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page