Contenido principal

MTFChart

R2026b

Modulation transfer function chart

Since R2026b

Description

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

An MTFChart object plots modulation transfer function (MTF) curves for one or more MTF result objects.

Use an MTFChart chart to visualize sagittal and tangential contrast transfer curves for selected wavelengths and field points.

Creation

Create an MTFChart object by using the show object function of a GeometricMTF or HuygensMTF object. Create an MTF result object by using the mtf object function.

hmtf = show(mtfr)

You can specify chart properties when you call show.

hmtf = show(mtfr,WavelengthIndices=[1 3],Grid="major")

Properties

expand all

Chart title, specified as a string scalar or character vector.

Data Types: char | string

Modulation transfer function results to plot, specified as a GeometricMTF object, a HuygensMTF object, or an array of MTF result objects.

When you specify an array of MTF result objects, the chart displays one tile for each MTF object. All objects in the array must use the same wavelengths.

Wavelength channels to plot, specified as a vector of positive integers. Each index refers to an element of the Wavelengths property of the MTF result object. By default, the chart plots all wavelength channels.

Data Types: double

Line colors for wavelength channels, specified as a color name, RGB triplet, string vector of color names, or numeric matrix of RGB triplets. By default, line colors are computed from the wavelength values in the MTF result object.

Legend display, specified as "on" or "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Grid lines to display, specified as one of these options.

  • "major" — The chart displays only major grid lines.

  • "minor" — The chart displays major and minor grid lines.

  • "off" — The chart does not display any grid lines.

Data Types: char | string

Parent UI container, specified as a Figure object, Panel object, GridLayout object, Tab object, or TiledChartLayout object. If you do not specify this property, MATLAB creates a new figure. You can create these UI containers using their respective creation functions.

Examples

collapse all

Load the sample Double Gauss lens system using zmximport. Compute the Huygens MTF by setting the Method name-value argument to "Huygens". Limit the output curves to a spatial frequency of 150 cycles per millimeter using the MaximumFrequency argument, and specify an FFTLength of 512 to achieve higher frequency resolution.

opsys = zmximport("DoubleGaussLens.zmx");
mtfr = mtf(opsys, Method="Huygens", MaximumFrequency=150, FFTLength=512);

Visualize the tangential and sagittal contrast curves as a function of spatial frequency by passing the result object to the show function.

hmtf = show(mtfr)
hmtf = 
  MTFChart with properties:

               Legend: on
                 Grid: "off"
                Title: "Modulation Transfer Function"
                  MTF: [1×3 optics.result.HuygensMTF]
    WavelengthIndices: [1 2 3]
                Color: [3×3 double]
             Position: [0.0737 0.2521 0.8713 0.5977]
                Units: 'normalized'

  Show all properties

Visualize the tangential and sagittal contrast curves as a function of spatial frequency by passing the result object to the show function.

Load the sample Double Gauss lens system using zmximport. Compute the Huygens MTF across all preconfigured field points in the system. Set MaximumFrequency to 150 cycles/mm to restrict the evaluation domain, and specify an FFTLength of 512 to achieve denser, high-resolution frequency sampling for smoother curve rendering.

opsys = zmximport("DoubleGaussLens.zmx");
mtfr = mtf(opsys, Method="Huygens", MaximumFrequency=150, FFTLength=512);

Visualize the complete spatial frequency performance using the show method. Because mtfr contains data for multiple field points, the function automatically generates a tiled layout with linked axes, displaying one subplot per field point.

hMTF = show(mtfr);
hMTF.Title = "Double Gauss System: Huygens MTF Performance";
hMTF.Grid = "major";

Visualize the complete spatial frequency performance using the show method. Because mtfr contains data for multiple field points, the function automatically generates a tiled layout with linked axes, displaying one subplot per field point.

More About

expand all

Version History

Introduced in R2026b