PSF simulator


A plugin for simulations of the Point Spread Function, with aberrations

Image modality:
Fluorescence microscopyFluorescence

License PyPI Python Version tests codecov napari hub

A plugin for the simulation of the 3D Point Spread Function of an optical systen, particularly a microscope objective.

Calculates the PSF using scalar and vectorial models.
The following aberrations are included:

  • phase aberration described by a Zernike polynomials with n-m coefficients.
  • aberration induced by a slab, with a refractive index different from the one at the object.

This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.


You can install napari-psf-simulator via pip:

pip install napari-psf-simulator

To install latest development version :

pip install git+


  1. Lauch the plugin and select the parameters of the microscope: NA (numerical aperture), wavelenght, n (refractive index at the object), FOV xy (field of view in the transverse direction), FOV z (field of view in the axial direction), dxy (pixel size, transverse sampling), dz (voxel depth, axial sampling), lens radius (physical aperture of the lens, used in vectorial model)

  2. Select a propagation model between scalar and vectorial.

  3. Select an aberration type (if needed).

  4. Press Calculate PSF to run the simulator. This will create a new image layer with the 3D PSF.

    The option Show Airy disk creates 3 ellipses in a Shapes layer, showing the boundaries of the diffraction limited blob.

raw Napari viewer with the psf-simulator widget showing the in-focus plane of an aberrated PSF

raw Slicing through a PSF aberrated with Zernike polynomials of order N=3, M=1 (coma)

  1. Click on the Plot PSF Profile in Console checkbox to see the x and z profiles of the PSF. They will show up in the viewer console when Calculate PSF is executed.

raw Plot profile of the PSF, shown in the Console


Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request. The plugin has been concived to be modular allowing the insertion of new aberations and pupils. Please contact the developers on github for adding new propagations and aberrations types. Any suggestions or contributions are welcome.


Distributed under the terms of the BSD-3 license, "napari-psf-simulator" is free and open source software


If you encounter any problems, please file an issue along with a detailed description.


  • 0.2.1

Last updated:

  • 14 September 2023

First released:

  • 14 April 2022


  • BSD-3-Clause

Supported data:

  • Information not submitted

Plugin type:

GitHub activity:

  • Stars: 16
  • Forks: 1
  • Issues + PRs: 2

Python versions supported:

Operating system:


  • numpy
  • magicgui
  • qtpy
  • PyCustomFocus >=3.3.6
  • matplotlib
  • scikit-image
  • scipy

Sign up to receive updates