主要内容

zmxinfo

Read metadata of ZMX file

Since R2026a

    Description

    Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

    info = zmxinfo(filename) reads the metadata of the ZMX file filename and returns the metadata in the structure info.

    example

    Examples

    collapse all

    Read the metadata of a ZMX file.

    info = zmxinfo("PhotographicLens.zmx");

    Display the mode of the optical system. Observe that the mode of the optical system is sequential, indicating that you can import the optical system using the zmximport function.

    info.Mode
    ans = 
    "SEQ"
    

    Inspect the surfaces of the optical system.

    info.Surfaces
    ans=30×1 struct array with fields:
        Type
        Radius
        DistanceToNext
        SemiDiameter
        Parameters
        ExtendedData
        ApertureStop
        Material
        ConicConstant
    
    

    Inspect the field points of the optical system.

    info.FieldPoints
    ans=4×1 heterogeneous FieldPoint (FieldPosition, FieldAngle) array with no properties.
    
    
    

    Count the number of preset configurations in the ZMX file.

    config = info.SurfaceConfigurations;
    configIndex = config.ConfigurationIndex;
    configIndex = unique(configIndex);
    numConfig = numel(configIndex)
    numConfig = 
    6
    

    Input Arguments

    collapse all

    Filename of the ZMX file, specified as a string scalar or character vector. You can specify the filename as an absolute or relative path of the ZMX file.

    Data Types: char | string

    Output Arguments

    collapse all

    Metadata of ZMX file, returned as a structure. The metadata structure contains these fields.

    FieldDetails
    Filename

    Absolute path and filename of the ZMX file, returned as a string scalar.

    Mode

    Mode of the optical system, returned as one of these options.

    • "SEQ" — Sequential mode.

      This mode traces rays sequentially through the surfaces of the optical system. Each ray interacts only once with each surface as the optical system traces it from the object plane to the image plane. This method is computationally efficient and useful for designing, optimizing, calculating tolerances for, and analyzing imaging systems such as photographic lenses, microscopes, and telescopes. The zmximport function supports only sequential mode optical systems.

    • "NSC" — Nonsequential mode.

      This mode traces rays through the components of the optical system in any sequence, enabling them to be split, scattered, or reflected back to an object they have previously interacted with. This method is useful for examining stray light, scattering, and illumination systems such as backlight, projector, and LED lights. The zmximport function does not support nonsequential mode optical systems.

    Name

    Name of the optical system, returned as a string scalar.

    Units

    Units of length, returned as a structure with these fields.

    • Dimension — Units of the dimensions, returned as a string scalar.

    • Wavelength — Units of the wavelength, returned as a string scalar.

    FieldPoints

    Field points specified in the ZMX file, returned as a vector of FieldPoint objects. The zmxinfo and zmximport functions support field points defined using field angles, object height, and image height. The functions do not support field points defined using paraxial image height.

    Wavelengths

    Wavelengths for analyzing the optical system specified in the ZMX file, returned as a numeric vector.

    PrimaryWavelength

    Primary wavelength specified in the ZMX file, returned as a numeric scalar. The primary wavelength is one of the wavelengths for analyzing the optical system.

    GlassCatalog

    Names of materials used in the optical system, returned as a string array. You can check if a material is present in the glass library by using the pickGlass or searchGlassLibrary function.

    Surfaces

    Details of surfaces in the optical system, returned as a structure with these fields.

    • Type — Type of surface, returned as a string scalar. The zmximport function does not support surfaces of types other than "STANDARD" (standard), "XOSPHERE" (extended odd asphere), "XASPHERE" (extended asphere), and "EVENASPH" (even asphere). The zmximport function does not support surfaces of type "XOSPHERE" with order greater than 20 and surfaces of type "XASPHERE" and "EVENASPH" with order greater than 10.

    • Radius — Radius of curvature of surface, returned as a numeric scalar.

    • DistanceToNext — Distance to next surface of optical system, returned as a numeric scalar. If the surface is the first surface of an optical component, this parameter represents the thickness of the component. If the surface is an intermediate surface of the component, this parameter represents the distance to the next surface of the component. If the surface is the terminating surface of the component, this parameter represents the distance to the next surface.

    • SemiDiameter — Semidiameter or height of surface, returned as a numeric scalar.

    • Parameters — Polynomial coefficients of surface, returned as a numeric vector.

    • ExtendedData — Additional coefficients required to define the surface, returned as a numeric vector.

    • ApertureStop — Whether the surface is an aperture stop, returned as true or false. An aperture stop is the optical component in the optical system that primarily limits the amount of light entering the optical system.

    • ConicConstant — Conic constant of surface, returned as a numeric scalar.

    • MechanicalSemiDiameter — Mechanical semidiameter of surface, returned as a numeric scalar.

    • Material — Material of surface, returned as a structure with these fields.

      • Name: Name of the material, returned as a string.

      • Nd: Refractive index of material, returned as a numeric scalar.

      • Vd: Abbe number of material, returned as a numeric scalar.

    ParaxialInfo

    Paraxial information of the optical system, returned as a structure with these fields.

    • FNumber — F-number of the optical system, returned as numeric scalar. F-number is defined as the ratio of the focal length of the optical system to its entrance pupil diameter. F-number is high when the entrance pupil diameter is smaller relative to the focal length and indicates smaller throughput of light and lower brightness but greater depth of field. F-number is low when the entrance pupil diameter is larger relative to the focal length and indicates larger throughput of light and higher brightness but lower depth of field.

    • EntrancePupilDiameter — Entrance pupil diameter of the optical system, returned as a numeric scalar. Entrance pupil diameter is the diameter of the image of the aperture stop as seen from the object plane i.e. the image of the aperture stop as traced through the elements preceding it. If the aperture stop is the first component of the optical system, the entrance pupil diameter is the same the physical diameter of the aperture stop.

    SurfaceConfigurations

    Preset configurations of variants of the optical system, returned as a table. Every configuration has changes to certain parameters of certain surfaces in the base optical system. One row of the table specifies the details of one such change.

    • The first column contains the configuration index.

    • The second column contains the index of the surface whose property is to be changed in the that configuration.

    • The third column contains the name of the property of the surface to changed.

    • The fourth column contains the updated value of the property to be changed.

    All rows having the same configuration index together contain details of all the surface properties to be varied to achieve that configuration.

    RawTagsRaw metadata tags and corresponding values in the ZMX file, returned as a structure.

    Data Types: struct

    Version History

    Introduced in R2026a