visisipy.models.factory#
Factory functions for creating eye geometries.
Functions#
|
Create a geometry instance from clinically used parameters. |
Module Contents#
- visisipy.models.factory.create_geometry(base: type[GeometryType] = NavarroGeometry, *, estimate_cornea_back: bool = False, **parameters: visisipy.types.Unpack[GeometryParameters]) GeometryType#
Create a geometry instance from clinically used parameters.
All parameters are optional, and if not provided, the default values will be used. Sizes are specified in mm. If estimate_cornea_back is True, the posterior cornea radius will be estimated from the anterior cornea radius as cornea_back_radius = 0.81 * cornea_front_radius. The anterior chamber depth is defined as the distance from the posterior cornea surface to the anterior lens surface, and the pupil-lens distance is defined as the distance from the pupil to the anterior lens surface. The cornea back to pupil distance is calculated as cornea_back_to_pupil = anterior_chamber_depth - pupil_lens_distance. The retina can be specified either by its radius and asphericity or by its y and z ellipsoid radii. If both methods are specified, a ValueError will be raised.
- Parameters:
- basetype[GeometryType]
The base geometry class to use. Must be a subclass of EyeGeometry.
- axial_lengthfloat, optional
Axial length of the eye, measured from anterior cornea surface to the retina along the optical axis.
- cornea_thicknessfloat, optional
Central thickness of the cornea, measured from the anterior to the posterior cornea surface.
- cornea_front_radiusfloat, optional
Radius of curvature of the anterior cornea surface.
- cornea_front_asphericityfloat, optional
Asphericity of the anterior cornea surface.
- cornea_back_radiusfloat, optional
Radius of curvature of the posterior cornea surface.
- cornea_back_asphericityfloat, optional
Asphericity of the posterior cornea surface.
- anterior_chamber_depthfloat, optional
Depth of the anterior chamber, measured from the posterior cornea surface to the anterior lens surface.
- pupil_radiusfloat, optional
Radius of the pupil.
- pupil_lens_distancefloat, optional
Distance between the pupil and the lens.
- lens_thicknessfloat, optional
Thickness of the crystalline lens, measured from the anterior to the posterior lens surface.
- lens_front_radiusfloat, optional
Radius of curvature of the anterior lens surface.
- lens_front_asphericityfloat, optional
Asphericity of the anterior lens surface.
- lens_back_radiusfloat, optional
Radius of curvature of the posterior lens surface.
- lens_back_asphericityfloat, optional
Asphericity of the posterior lens surface.
- retina_radiusfloat, optional
Radius of curvature of the retina.
- retina_asphericityfloat, optional
Asphericity of the retina.
- retina_ellipsoid_z_radiusfloat, optional
Radius (semi-axis length) of the retina ellipsoid in the z-direction.
- retina_ellipsoid_y_radiusfloat, optional
Radius (semi-axis length) of the retina ellipsoid in the y-direction. For rotationally symmetric retinas, this is also the radius in the x-direction.
- estimate_cornea_backbool, optional
If True, the back cornea radius will be estimated from the front cornea radius. Default is False.
- Returns:
- EyeGeometry
An instance of the EyeGeometry class.
- Raises:
- TypeError
If the base geometry is not a class or if it is not a subclass of EyeGeometry.
- ValueError
If the pupil-lens distance is greater than the anterior chamber depth. If the sum of the cornea thickness, anterior chamber depth and lens thickness is greater than or equal to the axial length. If the retina radius/asphericity and y/z ellipsoid radii are both specified. If only one of the retina ellipsoid radii is specified.