pyrot.eye_modelling.datamodels.models#
Data structures for interacting with RayOcular eye models.
Classes#
Abstract base class for RayOcular data models. |
|
Store measurements for an eye model. |
|
Store anterior chamber parameters for an eye model. |
|
Store ciliary body parameters for an eye model. |
|
Store cornea parameters for an eye model. |
|
Store eye positioning and scale parameters. |
|
Store iris parameters for an eye model. |
|
Store lens parameters for an eye model. |
|
Store macula parameters for an eye model. |
|
Store optical disc parameters for an eye model. |
|
Store optical nerve parameters for an eye model. |
|
Store retina parameters for an eye model. |
|
Store sclera parameters for an eye model. |
|
Store vitreous body parameters for an eye model. |
|
Store all parameters that define an eye model. |
|
Store a complete eye model with measurements and parameters. |
Module Contents#
- class pyrot.eye_modelling.datamodels.models.BaseModel#
Abstract base class for RayOcular data models.
For full functionality, all subclasses must be dataclasses and use the RayOcularField descriptor to define fields that correspond to RayOcular properties.
Methods#
- from_rayocular(cls, rayocular_object)
Converts a RayOcular object to an instance of the data model.
- to_rayocular(self)
Converts the data model instance to a RayOcular object.
- to_dict(self)
Converts the data model instance to a dictionary.
- from_dict(cls, data)
Creates an instance of the data model from a dictionary.
- classmethod from_rayocular(rayocular_object) _Self#
Convert a RayOcular object to an instance of the data model.
Parameters#
- rayocular_objectAny
The RayOcular object to convert.
Returns#
- BaseModel
An instance of the data model.
Raises#
- ValueError
If any field in the data model does not have a corresponding RayOcular name.
- to_rayocular() dict[str, Any]#
Convert the data model instance to a RayOcular dictionary.
Only parameters that can be used as input for RayOcular’s update functions are included in the output.
Returns#
- dict[str, Any]
A dictionary that can be used to update the model in RayOcular.
Raises#
- TypeError
If the data model instance is not a dataclass.
- ValueError
If any field in the data model has a RayOcular name that overlaps with another field, which causes conflicts when converting to a RayOcular dictionary.
- to_dict() dict[str, Any]#
Convert the data model instance to a dictionary.
This method is only implemented for dataclasses.
Returns#
- dict[str, Any]
A dictionary representation of the data model instance.
Raises#
- NotImplementedError
If the data model instance is not a dataclass.
- classmethod from_dict(data: dict[str, Any]) _Self#
Create an instance of the data model from a dictionary.
This method is only implemented for dataclasses.
Parameters#
- datadict[str, Any]
A dictionary representation of the data model instance.
Returns#
- BaseModel
An instance of the data model.
Raises#
- NotImplementedError
If the data model class is not a dataclass.
- TypeError
If the type of any field cannot be resolved.
- ValueError
If any required field is missing from the data.
- class pyrot.eye_modelling.datamodels.models.EyeModelMeasurements#
Bases:
BaseModelStore measurements for an eye model.
Attributes#
- cornea_lens_distancefloat
Distance from cornea to lens.
- eye_lengthfloat
Total length of the eye.
- eye_widthfloat
Width of the eye.
- lens_thicknessfloat
Thickness of the lens.
- limbus_diameterfloat
Diameter of the limbus.
- class pyrot.eye_modelling.datamodels.models.AnteriorChamber#
Bases:
BaseModelStore anterior chamber parameters for an eye model.
Attributes#
- local_rotationVector3[float]
Local rotation of the anterior chamber.
- local_scaleVector3[float]
Local scale of the anterior chamber.
- local_translationVector3[float]
Local translation of the anterior chamber.
- class pyrot.eye_modelling.datamodels.models.CiliaryBody#
Bases:
BaseModelStore ciliary body parameters for an eye model.
Attributes#
- base_curvaturefloat
Base curvature of the ciliary body.
- heightfloat
Height of the ciliary body.
- local_rotationVector3[float]
Local rotation of the ciliary body.
- local_scaleVector3[float]
Local scale of the ciliary body.
- local_translationVector3[float]
Local translation of the ciliary body.
- class pyrot.eye_modelling.datamodels.models.Cornea#
Bases:
BaseModelStore cornea parameters for an eye model.
Attributes#
- local_rotationVector3[float]
Local rotation of the cornea.
- local_scaleVector3[float]
Local scale of the cornea.
- local_translationVector3[float]
Local translation of the cornea.
- semi_axisVector3[float]
Semi-axes of the cornea.
- thicknessfloat
Thickness of the cornea.
- class pyrot.eye_modelling.datamodels.models.Eye#
Bases:
BaseModelStore eye positioning and scale parameters.
Attributes#
- pivotVector3[float]
Pivot point of the eye.
- rotationVector3[float]
Rotation of the eye.
- scaleVector3[float]
Scale of the eye.
- translationVector3[float]
Translation of the eye.
- class pyrot.eye_modelling.datamodels.models.Iris#
Bases:
BaseModelStore iris parameters for an eye model.
Attributes#
- inner_semi_axisVector3[float]
Inner semi-axes of the iris.
- outer_semi_axisVector3[float]
Outer semi-axes of the iris.
- local_rotationVector3[float]
Local rotation of the iris.
- local_scaleVector3[float]
Local scale of the iris.
- local_translationVector3[float]
Local translation of the iris.
- thicknessfloat
Thickness of the iris.
- class pyrot.eye_modelling.datamodels.models.Lens#
Bases:
BaseModelStore lens parameters for an eye model.
Attributes#
- curvaturefloat
Curvature of the lens.
- local_rotationVector3[float]
Local rotation of the lens.
- local_scaleVector3[float]
Local scale of the lens.
- local_translationVector3[float]
Local translation of the lens.
- semi_axisVector3[float]
Semi-axes of the lens.
- class pyrot.eye_modelling.datamodels.models.Macula#
Bases:
BaseModelStore macula parameters for an eye model.
Attributes#
- heightfloat
Height of the macula.
- local_rotationVector3[float]
Local rotation of the macula.
- local_scaleVector3[float]
Local scale of the macula.
- local_translationVector3[float]
Local translation of the macula.
- rotationVector3[float]
Rotation of the macula.
- semi_axisVector3[float]
Semi-axes of the macula.
- class pyrot.eye_modelling.datamodels.models.OpticalDisc#
Bases:
BaseModelStore optical disc parameters for an eye model.
Attributes#
- heightfloat
Height of the optical disc.
- local_rotationVector3[float]
Local rotation of the optical disc.
- local_scaleVector3[float]
Local scale of the optical disc.
- local_translationVector3[float]
Local translation of the optical disc.
- semi_axisVector3[float]
Semi-axes of the optical disc.
- class pyrot.eye_modelling.datamodels.models.OpticalNerve#
Bases:
BaseModelStore optical nerve parameters for an eye model.
Attributes#
- heightfloat
Height of the optical nerve.
- local_rotationVector3[float]
Local rotation of the optical nerve.
- local_scaleVector3[float]
Local scale of the optical nerve.
- local_translationVector3[float]
Local translation of the optical nerve.
- rotationVector3[float]
Rotation of the optical nerve.
- semi_axisVector3[float]
Semi-axes of the optical nerve.
- class pyrot.eye_modelling.datamodels.models.Retina#
Bases:
BaseModelStore retina parameters for an eye model.
Attributes#
- thicknessfloat
Thickness of the retina.
- local_rotationVector3[float]
Local rotation of the retina.
- local_scaleVector3[float]
Local scale of the retina.
- local_translationVector3[float]
Local translation of the retina.
- class pyrot.eye_modelling.datamodels.models.Sclera#
Bases:
BaseModelStore sclera parameters for an eye model.
Attributes#
- thicknessfloat
Thickness of the sclera.
- local_rotationVector3[float]
Local rotation of the sclera.
- local_scaleVector3[float]
Local scale of the sclera.
- local_translationVector3[float]
Local translation of the sclera.
- semi_axisVector3[float]
Semi-axes of the sclera.
- class pyrot.eye_modelling.datamodels.models.VitreousBody#
Bases:
BaseModelStore vitreous body parameters for an eye model.
Attributes#
- local_rotationVector3[float]
Local rotation of the vitreous body.
- local_scaleVector3[float]
Local scale of the vitreous body.
- local_translationVector3[float]
Local translation of the vitreous body.
- class pyrot.eye_modelling.datamodels.models.EyeModelParameters#
Bases:
BaseModelStore all parameters that define an eye model.
Attributes#
- eyeEye
Eye positioning and scale parameters.
- anterior_chamberAnteriorChamber
Anterior chamber parameters.
- ciliary_bodyCiliaryBody
Ciliary body parameters.
- corneaCornea
Cornea parameters.
- irisIris
Iris parameters.
- lensLens
Lens parameters.
- maculaMacula
Macula parameters.
- optical_discOpticalDisc
Optical disc parameters.
- optical_nerveOpticalNerve
Optical nerve parameters.
- retinaRetina
Retina parameters.
- scleraSclera
Sclera parameters.
- vitreous_bodyVitreousBody
Vitreous body parameters.
- lens_cornea_distancefloat
Distance from lens to cornea.
- level_of_detailint
Level of detail for geometry rendering.
- classmethod from_rayocular(parameters) EyeModelParameters#
Create eye model parameters from a RayOcular object.
Parameters#
- parametersobject
The RayOcular eye model parameters object.
Returns#
- EyeModelParameters
The created eye model parameters.
- class pyrot.eye_modelling.datamodels.models.EyeModel#
Bases:
BaseModelStore a complete eye model with measurements and parameters.
Attributes#
- measurementsValidatedField[EyeModelMeasurements]
Eye model measurements.
- parametersValidatedField[EyeModelParameters]
Eye model parameters.
- lateralityEyeLaterality
Eye laterality (Left or Right).
- descriptionstr
Description of the eye model.
- inter_pupillary_distanceOptional[float]
Inter-pupillary distance.
- namestr
Name of the eye model.
- classmethod from_rayocular(geometry_generator) EyeModel#
Create an eye model from a RayOcular geometry generator.
Parameters#
- geometry_generatorobject
The RayOcular geometry generator object.
Returns#
- EyeModel
The created eye model.
- abstract to_rayocular() dict[str, Any]#
Convert the eye model to a RayOcular dictionary.
Raises#
- NotImplementedError
This method is not implemented for EyeModel.