Free software

About OpticalSetup

Copyright © 2026 Luca Genchi and contributors.

OpticalSetup is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

It is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

The numbers OpticalSetup reports come from models with stated limits; read each component's page in the wiki before relying on one.

If you use OpticalSetup in your research, teaching or publications, please cite the software:

Bertoncini, A., & Genchi, L. (2026). OpticalSetup - the optical workbench software [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.23191537

Calculators / Point-scanning resolution and field of view

Point-scanning resolution and field of view

Estimate the lateral and axial resolution of a point-scanning microscope from the excitation wavelength, the objective’s NA and the detection: a confocal pinhole for fluorescence, spontaneous Raman or scattered light, or two- and three-photon excitation without one. A second panel gives the field of view, how far the focus moves for a galvo angle, the pixel size and how the beam fills the objective.

1Point image across the focus
Signal from a point object as the focus scans across it, normalized to its peak. The FWHM is the lateral resolution.
Data table
2Point image along the axis
Signal from a point object as the focus scans along the optical axis; the FWHM is the axial resolution. With a pinhole, a dashed curve is the pinhole’s detection response alone. One-photon excitation without a pinhole has no axial resolution: its line is flat, the signal from a thin uniform layer, which is the same at every depth.
Data table

Field of view and galvo scanning

How far the focus moves in the sample when a galvanometer mirror turns, through a scan lens, a tube lens and the objective [12]; the field this covers, the pixel size, and how the beam fills the objective’s back aperture. The NA and the lateral resolution come from the panel above.

3Spot displacement against galvo angle
Position of the focus in the sample. The band is the scan range; the marker is the chosen angle. The dashed curve is the other scan-lens mapping.
Data table
4X and Y command voltages of a raster frame
Eight lines drawn for clarity, over a square field (the same range on both axes); amplitude from the scan range and the driver scale factor. A unidirectional flyback is drawn at 20 % of the line period, an illustrative value. The band is the slow mirror’s return to the first line.
Data table
    Model
    Scalar focus of a uniformly filled circular pupil, computed numerically; the confocal pinhole integrated over its area; N-photon point images as the N-th power of the excitation focus. Ideal thin-lens scan relay.
    Evidence
    Checked against an independent Python reference and against the closed forms of the Zeiss monograph [1] in their limits: validation table. Not compared with a measurement.
    Code
    psf.js (point images) and scanning-calculator.js; immersion indices and NA limits from the canvas’s objective.

    The scanned focus

    A point-scanning microscope focuses a laser to a spot, moves the spot over the sample and records one signal per position. The image of a point object is therefore the spot itself, weighted by what the detector accepts [1][4]. For a uniformly filled circular pupil, the scalar intensity near the focus depends on two dimensionless optical coordinates, one across and one along the axis [2][5]:

    v=2πλ NA r,u=4πλ(n−n2−NA2)z=8πnλsin⁡2 ⁣α2 zv=\frac{2\pi}{\lambda}\,\mathrm{NA}\,r,\qquad u=\frac{4\pi}{\lambda}\left(n-\sqrt{n^2-\mathrm{NA}^2}\right)z=\frac{8\pi n}{\lambda}\sin^2\!\frac{\alpha}{2}\,z
    So et al. write u = 4k sin²(α/2) z and v = k sin α r with k = 2πn/λ [2]; NA = n sin α.
    h(u,v)=∣ 2∫01J0(vρ) e−iuρ2/2 ρ dρ ∣2h(u,v)=\left|\,2\int_0^1 J_0(v\rho)\,e^{-iu\rho^2/2}\,\rho\,d\rho\,\right|^2
    So et al., Eq. 2 [2]; Born and Wolf derive the same field with Lommel functions [5].
    h(0,v)=[2J1(v)v]2,h(u,0)=[sin⁡(u/4)u/4]2h(0,v)=\left[\frac{2J_1(v)}{v}\right]^2,\qquad h(u,0)=\left[\frac{\sin(u/4)}{u/4}\right]^2
    In the focal plane the Airy pattern; on the axis a sinc². Their half-maximum points give the lateral and axial FWHM.

    Without a pinhole a one-photon signal is proportional to the excitation intensity at the object, so across the focus the point image is h at the excitation wavelength, with FWHM 0.5145 λexc/NA, which the Zeiss monograph rounds to 0.51 (its eq. 3) [1]. Along the axis the excitation focus has FWHM 0.8859 λexc/(n − √(n² − NA²)), the monograph’s 0.88 (eq. 2; 1.77 nλ/NA² for a small NA, eq. 2a), but without a pinhole that is not an axial resolution, as explained below. The page finds each FWHM by bisection on the computed profile and converts optical units to micrometres:

    FWHMlat=2v1/22π λexcNA,FWHMax=2u1/24π λexcn−n2−NA2\mathrm{FWHM}_{\text{lat}}=\frac{2v_{1/2}}{2\pi}\,\frac{\lambda_{\text{exc}}}{\mathrm{NA}},\qquad \mathrm{FWHM}_{\text{ax}}=\frac{2u_{1/2}}{4\pi}\,\frac{\lambda_{\text{exc}}}{n-\sqrt{n^2-\mathrm{NA}^2}}

    The FWHM is not the same as the two-point resolution: the Rayleigh criterion places two incoherent points at the Airy pattern’s first zero, 0.61 λ/NA apart.

    No axial resolution without a pinhole. A one-photon signal is excited in every plane the beam crosses, above and below the focus, and a large detector collects it all: a uniform fluorescent layer returns the same total signal at every depth, so the signal cannot be assigned to a depth [2]. The monograph likewise gives no optical slice thickness for conventional microscopy, where sectioning is not possible [1]. The page therefore reports no axial resolution for one-photon excitation without a pinhole. That is a choice of what to report, not the absence of an axial profile: an isolated point, such as a bead on a dark background, still gives one, the excitation focus’s axial FWHM above; but in a sample that fluoresces above and below the focus every plane adds the same total signal, so that width does not locate the signal in depth [2]. A confocal pinhole selects the focal plane in detection; multiphoton excitation confines the excitation itself to the focus (below).

    SymbolQuantityUnitMeaning
    λexcExcitation wavelengthnmVacuum wavelength of the scanning laser.
    λdetDetected wavelengthnmEmission peak, Raman Stokes line, or λexc for scattered light. It matters only with a pinhole.
    NANumerical aperture—n sin α of the objective; must be below n.
    nRefractive index—Immersion medium, taken to equal the sample’s.
    αAperture half-angle°asin(NA/n), the half-angle of the focused cone.
    PHPinhole diameterAUBack-projected to the sample, in Airy units of the detected light: 1 AU = 1.22 λdet/NA.
    NPhotons per event—2 for two-photon fluorescence and SHG, 3 for three-photon fluorescence and THG.

    The confocal pinhole

    A pinhole in a plane conjugate to the focus accepts light from a small region around it. The total point image is the product of the illumination and detection point images (Zeiss eq. 1) [1], and the detection point image is the detected-wavelength PSF summed over the back-projected pinhole of radius R [3]:

    PSFtot(r,z)=hexc(r,z)⋅D(r,z),D(r,z)=∬∣s∣≤Rhdet(∣r−s∣, z) d2s\mathrm{PSF}_{\text{tot}}(r,z)=h_{\text{exc}}(r,z)\cdot D(r,z),\qquad D(r,z)=\iint_{|\mathbf s|\le R} h_{\text{det}}\big(|\mathbf r-\mathbf s|,\,z\big)\,d^2s
    1 AU=1.22 λdetNA,R=PH2 ⟺ vR=1.22 π PH [AU]1\ \mathrm{AU}=\frac{1.22\,\lambda_{\text{det}}}{\mathrm{NA}},\qquad R=\frac{\mathrm{PH}}{2}\ \Longleftrightarrow\ v_R=1.22\,\pi\,\mathrm{PH}\,[\mathrm{AU}]
    The Zeiss monograph defines 1 AU as the Airy-disc diameter [1]; this page evaluates it at the detected wavelength, the light the pinhole passes.

    The two coordinates of hdet scale with λexc/λdet, so a Stokes shift widens the detection side. The page evaluates D numerically for any pinhole between 0 and 10 AU. In the two limits it reproduces the monograph’s closed forms, listed beside the result for comparison [1]:

    • Large pinhole (PH > 1 AU), “geometric-optical confocality”: the resolution is that of the excitation spot alone (eqs. 2, 3). The pinhole still rejects light from other planes; the monograph measures that by the optical slice thickness, the axial FWHM of the detection response D (eq. 4).
    • Point pinhole (PH < 0.25 AU), “wave-optical confocality”: the total PSF is hexc·hdet, which the monograph approximates with one mean wavelength λ̄ (eqs. 6–8). Below 1 AU it no longer distinguishes the optical slice thickness from the axial resolution: the axial FWHM of the total PSF is both.
    FWHMslice≈(0.88 λdetn−n2−NA2)2+(2 n PHNA)2(PH>1 AU, PH in μm at the sample)\mathrm{FWHM}_{\text{slice}}\approx\sqrt{\left(\frac{0.88\,\lambda_{\text{det}}}{n-\sqrt{n^2-\mathrm{NA}^2}}\right)^2+\left(\frac{\sqrt2\,n\,\mathrm{PH}}{\mathrm{NA}}\right)^2}\qquad(\mathrm{PH}>1\ \mathrm{AU},\ \mathrm{PH\ in\ \mu m\ at\ the\ sample})
    Zeiss eq. 4, for pinholes of 1 AU and more. The page reports the quantity it estimates, the axial FWHM of D(0, z), computed for the actual pinhole at every size; below 1 AU that is the detection response alone, wider than the optical section. The geometric term uses NA/n for the defocus blur, a small-angle estimate, so the two part at high NA.
    λˉ≈2 λexcλdetλexc2+λdet2,FWHMlat=0.37 λˉNA,FWHMax=0.64 λˉn−n2−NA2\bar\lambda\approx\sqrt2\,\frac{\lambda_{\text{exc}}\lambda_{\text{det}}}{\sqrt{\lambda_{\text{exc}}^2+\lambda_{\text{det}}^2}},\qquad \mathrm{FWHM}_{\text{lat}}=0.37\,\frac{\bar\lambda}{\mathrm{NA}},\qquad \mathrm{FWHM}_{\text{ax}}=0.64\,\frac{\bar\lambda}{n-\sqrt{n^2-\mathrm{NA}^2}}
    Zeiss eqs. 6, 8 and 7. With λdet = λexc the exact values are 0.3693 and 0.6378.

    Resolution and optical sectioning are different properties [4]. At 1 AU the computed lateral width is within a few per cent of the open-detector value, yet the pinhole already rejects light from other planes; the lateral gain appears only well below 1 AU, where the detected signal falls steeply [1]. The monograph recommends z steps of half the slice thickness.

    Spontaneous Raman is a linear, incoherent signal like fluorescence; the detected wavelength is the Stokes line of the chosen shift:

    1λdet=1λexc−Δν~107(λ in nm, Δν~ in cm−1)\frac{1}{\lambda_{\text{det}}}=\frac{1}{\lambda_{\text{exc}}}-\frac{\Delta\tilde\nu}{10^7}\qquad(\lambda\ \text{in nm},\ \Delta\tilde\nu\ \text{in cm}^{-1})

    Scattered or reflected light is treated as coming from point-like incoherent scatterers. Extended reflecting structures image coherently: the monograph notes, for example, a factor 0.45 instead of 0.64 in eq. 7 for a mirror [1]. In confocal Raman and reflection work an index mismatch between immersion and sample can make the real depth resolution much worse than these figures [11].

    Two- and three-photon excitation, SHG and THG

    An N-photon signal grows with the N-th power of the excitation intensity, so the point image is the excitation focus raised to that power [2][6][7]. Detection needs no pinhole: a large, non-descanned detector collects everything.

    PSFN(u,v)=hexc(u,v)N\mathrm{PSF}_N(u,v)=h_{\text{exc}}(u,v)^N
    So et al. write the two-photon case as I²(u/2, v/2), in the optical units of half the excitation wavelength [2].

    Raising the profile to a power narrows it: at the same wavelength the two-photon point image is laterally about 1.39 times narrower than the one-photon one (0.3693 against 0.5145 λ/NA), the three-photon image about 1.70 times. A two-photon process is, however, excited at roughly twice the wavelength a one-photon process needs for the same transition, so it is wider than one-photon excitation at λ/N [2][6]. For two- and three-photon fluorescence the page lists both lateral comparisons and adds one-photon confocal imaging of the same dye at λ/N through a pinhole, 1 AU unless changed: the monograph calls about 1 AU the typical setting and, for most fluorescence work, the best compromise between signal and depth discrimination [1]; along the axis, one-photon excitation without a pinhole is drawn as the flat signal of a thin uniform layer. The confocal point image is the narrower one: for the same emission wavelength, two-photon fluorescence does not resolve better than confocal microscopy [17]. Measured confocal resolution, however, often falls short of its theory while nonlinear microscopes come close to theirs, so in practice they show no resolution disadvantage [18]. The reasons to choose two-photon excitation lie elsewhere: excitation confined to the focus bleaches and damages the specimen less outside the imaged plane, the sectioning needs neither a pinhole nor descanning optics, and near-infrared light is scattered and absorbed less, so it reaches deeper into thick tissue [2]. SHG and THG have no one-photon counterpart, so the page compares them with nothing. Horton et al. used three-photon excitation at 1700 nm to image deep in the scattering mouse brain [8].

    What multiphoton excitation gains is sectioning without a pinhole: the total signal from a uniform plane falls away from the focus instead of staying constant [2]. That plane response sums hexcN over each plane, so its width is a different quantity from the axial FWHM of the point image, which is what the page reports. Second- and third-harmonic generation (SHG, THG) also follow the square and the cube of the intensity, and are emitted at exactly λ/2 and λ/3; from a point-like object they have the same point image; extended objects add coherent effects (phase matching, the Gouy phase) that are not modelled.

    Field of view and galvo scanning

    An infinity-corrected objective’s magnification is defined with its maker’s tube lens: 200 mm for Nikon and Leica, 180 mm for Olympus and 165 mm for Zeiss [13]. The objective’s focal length follows from it, and the field of view in the sample is the field number divided by the magnification [14]:

    fobj=frefM,FOV=FNMf_{\text{obj}}=\frac{f_{\text{ref}}}{M},\qquad \mathrm{FOV}=\frac{\mathrm{FN}}{M}

    In a laser-scanning microscope a galvanometer mirror tilts the beam, a scan lens turns the tilt into a position in an intermediate image, and the tube lens and the objective image that plane onto the sample [12]. A mirror turned by θmech deflects the beam by twice that angle. An ideal, distortion-free scan lens places the beam at fSL tan θ; an f-theta lens at fSL θ [12]:

    θopt=2 θmech,h=fSLtan⁡θopt  or  fSL θopt\theta_{\text{opt}}=2\,\theta_{\text{mech}},\qquad h=f_{\text{SL}}\tan\theta_{\text{opt}}\ \ \text{or}\ \ f_{\text{SL}}\,\theta_{\text{opt}}
    x=fobjfTL h,tan⁡θpupil=hfTL,x≈fobj fSLfTL θoptx=\frac{f_{\text{obj}}}{f_{\text{TL}}}\,h,\qquad \tan\theta_{\text{pupil}}=\frac{h}{f_{\text{TL}}},\qquad x\approx f_{\text{obj}}\,\frac{f_{\text{SL}}}{f_{\text{TL}}}\,\theta_{\text{opt}}
    x is the displacement of the focus in the sample and θpupil the beam angle at the back aperture. The field width is twice x at half the peak-to-peak range.

    Scan and tube lens form a telescope that images the galvo onto the objective’s back aperture and expands the beam by fTL/fSL [12]. The resolution panel assumes a uniformly filled aperture. The Zeiss monograph describes the fill by the truncation ratio T of the 1/e² beam diameter to the pupil diameter: below about 0.6 the focus is Gaussian, above about 1 it is close to the Airy pattern, and beyond 3 the resolution no longer improves while more power is clipped [1].

    Dpupil=2 fobj NA,T=dbeam fTL/fSLDpupilD_{\text{pupil}}=2\,f_{\text{obj}}\,\mathrm{NA},\qquad T=\frac{d_{\text{beam}}\,f_{\text{TL}}/f_{\text{SL}}}{D_{\text{pupil}}}
    dpix=field widthpixels per line ≤ FWHMlat2d_{\text{pix}}=\frac{\text{field width}}{\text{pixels per line}}\ \le\ \frac{\mathrm{FWHM}_{\text{lat}}}{2}
    The practical sampling the Zeiss monograph recommends: two pixels per lateral FWHM [1].
    dpix≤12fc,fc={2 NA/λexcone-photon, no pinhole2 NA/λexc+2 NA/λdetone-photon, pinhole2N NA/λexcN-photond_{\text{pix}}\le\frac{1}{2f_c},\qquad f_c=\begin{cases}2\,\mathrm{NA}/\lambda_{\text{exc}} & \text{one-photon, no pinhole}\\ 2\,\mathrm{NA}/\lambda_{\text{exc}}+2\,\mathrm{NA}/\lambda_{\text{det}} & \text{one-photon, pinhole}\\ 2N\,\mathrm{NA}/\lambda_{\text{exc}} & N\text{-photon}\end{cases}
    The sampling theorem applied to the point image: fc is the highest spatial frequency it passes, the cutoff of its transfer function. A product of PSFs has the convolution of their transfer functions, so the cutoffs add; the PSF width and the cutoff are different measures [7]. Near fc the contrast is weak, and with a large pinhole the detection part adds little, so the FWHM rule is the usual practical choice.

    Raster scanning with two galvos

    A frame is scanned line by line. The fast mirror (X) sweeps the focus across one line; the slow mirror (Y) then moves it to the next, and after the last line returns it to the first. Each mirror follows the command voltage from its servo driver, proportional to its rotation (volts per degree, the driver’s scale factor). The page draws both commands for the field set above.

    • Unidirectional. The fast command is a sawtooth: a linear ramp, then a quick flyback. Pixels are recorded only while the mirror moves at constant speed; the data taken during the turnaround and the flyback are discarded, so only part of each line period, the fill fraction, makes the image [15].
    • Bidirectional (serpentine). The fast command is a triangle and both sweeps record a line, every other one in reverse, so no time is spent on a flyback. A galvo’s inertia makes it lag its command, by about 7 % of the line period in the ScanImage example [15], and the lag grows into image distortion at higher line rates [16]. In a bidirectional image it shifts the forward and the return lines in opposite directions, so the two must be aligned by a delay or phase correction, or vertical edges look jagged.

    Here the slow mirror advances one line during each flyback or turnaround and holds still while a line is recorded. The graph shows the commands, not the mirror positions, which lag and round the corners.

    VX=± s Θmech2,VY(line k)=−V0+2V0 kN−1V_X=\pm\,s\,\frac{\Theta_{\text{mech}}}{2},\qquad V_Y(\text{line }k)=-V_0+2V_0\,\frac{k}{N-1}
    s is the driver scale factor (V per mechanical degree), Θmech the peak-to-peak mechanical scan range, V0 the slow axis’s amplitude (equal to the fast one for a square field) and N the number of lines.

    Precision and limits

    Numerics. Bessel functions use rational approximations accurate to about 10⁻⁸. The pinhole integral uses Gauss–Legendre quadrature (64 radial × 48 angular nodes across the pinhole, 128 nodes over the pupil for the defocused field), and each FWHM is bisected to round-off. An independent Python reference, using integral representations of the Bessel functions and a different quadrature, agrees with the page to 10⁻⁶ relative or better in every case of the validation table (the test tolerance is 10⁻⁵); the open and point-pinhole limits are also checked against their analytic half-maximum points.

    Scope. Scalar optics with a uniformly filled, aberration-free circular pupil; the axial coordinate uses n(1 − cos α), exact on the axis, and the defocused field off the axis is the paraxial form. Above about NA/n = 0.7 the vector nature of the focused field (Richards and Wolf [9]) widens the real focus along the polarization, which this page does not include. Emission is taken at a single wavelength; a broad band widens the detection side slightly. The sample is assumed index-matched to the immersion medium, non-scattering and free of aberrations; real foci deep in tissue or through a mismatched index are wider, and the depth scale itself changes [11]. Cole et al. describe how to measure the point image with sub-resolution beads and compare it with such limits [10].

    Scanning. Thin, ideal scan and tube lenses in a telescope that images the galvo onto the back aperture; an objective that maps the pupil angle to fobj tan θ; no distortion, field curvature or vignetting. The field number limits where the objective is corrected; the page flags a scanned field beyond it but does not model the loss.

    References

    1. S. Wilhelm, Confocal Laser Scanning Microscopy: Principles, Carl Zeiss Microscopy GmbH, publication 60-1-0030/e (2010); copy hosted by the Technion Biomedical Core Facility.
    2. P. T. C. So, C. Y. Dong, B. R. Masters and K. M. Berland, “Two-photon excitation fluorescence microscopy,” Annu. Rev. Biomed. Eng. 2, 399–429 (2000).
    3. T. Wilson and A. R. Carlini, “Size of the detector in confocal imaging systems,” Opt. Lett. 12, 227–229 (1987).
    4. T. Wilson, “Resolution and optical sectioning in the confocal microscope,” J. Microsc. 244, 113–121 (2011).
    5. M. Born and E. Wolf, Principles of Optics, 7th ed., Cambridge University Press (1999): Fraunhofer diffraction at a circular aperture and the three-dimensional light distribution near a focus.
    6. M. Gu and C. J. R. Sheppard, “Comparison of three-dimensional imaging properties between two-photon and single-photon fluorescence microscopy,” J. Microsc. 177, 128–137 (1995).
    7. C. J. R. Sheppard, “Image formation in three-photon fluorescence microscopy,” Bioimaging 4, 124–128 (1996).
    8. N. G. Horton, K. Wang, D. Kobat, C. G. Clark, F. W. Wise, C. B. Schaffer and C. Xu, “In vivo three-photon microscopy of subcortical structures within an intact mouse brain,” Nat. Photonics 7, 205–209 (2013).
    9. B. Richards and E. Wolf, “Electromagnetic diffraction in optical systems, II. Structure of the image field in an aplanatic system,” Proc. R. Soc. Lond. A 253, 358–379 (1959).
    10. R. W. Cole, T. Jinadasa and C. M. Brown, “Measuring and interpreting point spread functions to determine confocal microscope resolution and ensure quality control,” Nat. Protoc. 6, 1929–1941 (2011).
    11. N. J. Everall, “Confocal Raman microscopy: why the depth resolution and spatial accuracy can be much worse than you think,” Appl. Spectrosc. 54, 1515–1520 (2000).
    12. A. Negrean and H. D. Mansvelder, “Optimal lens design and use in laser-scanning microscopy,” Biomed. Opt. Express 5, 1588 (2014).
    13. K. R. Spring and M. W. Davidson, “Infinity optical systems,” Evident (Olympus) Microscopy Resource Center.
    14. Nikon, Microscopy glossary: field of view (field number divided by the objective magnification).
    15. T. A. Pologruto, B. L. Sabatini and K. Svoboda, “ScanImage: flexible software for operating laser scanning microscopes,” BioMed. Eng. OnLine 2, 13 (2003).
    16. W. Wang, Z. Wu and H. Zeng, “Image distortion and its correction in linear galvanometric mirrors–based laser-scanning microscopy,” J. Biomed. Opt. 20, 056001 (2015).
    17. C. J. R. Sheppard, “Multiphoton microscopy: a personal historical review, with some future predictions,” J. Biomed. Opt. 25, 014511 (2020).
    18. G. Cox and C. J. R. Sheppard, “Practical limits of resolution in confocal and non-linear microscopy,” Microsc. Res. Tech. 63, 18–22 (2004).