psf

Point Spread Function calculations for fluorescence microscopy.

https://github.com/cgohlke/psf

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary

Keywords

fluorescence-microscopy-imaging point-spread-function python
Last synced: 6 months ago · JSON representation

Repository

Point Spread Function calculations for fluorescence microscopy.

Basic Info
  • Host: GitHub
  • Owner: cgohlke
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Homepage: https://pypi.org/project/psf
  • Size: 218 KB
Statistics
  • Stars: 38
  • Watchers: 4
  • Forks: 4
  • Open Issues: 1
  • Releases: 0
Topics
fluorescence-microscopy-imaging point-spread-function python
Created almost 6 years ago · Last pushed 7 months ago
Metadata Files
Readme License

README.rst

..
  This file is generated by setup.py

Point Spread Function calculations for fluorescence microscopy
==============================================================

Psf is a Python library to calculate Point Spread Functions (PSF) for
fluorescence microscopy.

The psf library is no longer actively developed.

:Author: `Christoph Gohlke `_
:License: BSD-3-Clause
:Version: 2025.8.1

Quickstart
----------

Install the psf package and all dependencies from the
`Python Package Index `_::

    python -m pip install -U "psf[all]"

See `Examples`_ for using the programming interface.

Source code and support are available on
`GitHub `_.

Requirements
------------

This revision was tested with the following requirements and dependencies
(other versions may work):

- `CPython `_ 3.11.9, 3.12.10, 3.13.5, 3.14.0rc 64-bit
- `NumPy `_ 2.3.2
- `Matplotlib `_  3.10.5
  (optional for plotting)

Revisions
---------

2025.8.1

- Drop support for Python 3.10, support Python 3.14.

2025.1.1

- Improve type hints.
- Drop support for Python 3.9, support Python 3.13.

2024.5.24

- Fix docstring examples not correctly rendered on GitHub.

2024.4.24

- Support NumPy 2.

2024.1.6

- Change PSF.TYPES from dict to set (breaking).

2023.4.26

- Use enums.
- Derive Dimensions from UserDict.
- Add type hints.
- Convert to Google style docstrings.
- Drop support for Python 3.8 and numpy < 1.21 (NEP29).

2022.9.26

- Fix setup.py.

2022.9.12

- Drop support for Python 3.7 (NEP 29).
- Update metadata.

2021.6.6

- Drop support for Python 3.6 (NEP 29).

2020.1.1

- Drop support for Python 2.7 and 3.5.
- Update copyright.

2019.10.14

- Support Python 3.8.

2019.4.22

- Fix setup requirements.
- Fix compiler warning.

References
----------

1. Electromagnetic diffraction in optical systems. II. Structure of the
   image field in an aplanatic system.
   B Richards and E Wolf. Proc R Soc Lond A, 253 (1274), 358-379, 1959.
2. Focal volume optics and experimental artifacts in confocal fluorescence
   correlation spectroscopy.
   S T Hess, W W Webb. Biophys J (83) 2300-17, 2002.
3. Electromagnetic description of image formation in confocal fluorescence
   microscopy.
   T D Viser, S H Wiersma. J Opt Soc Am A (11) 599-608, 1994.
4. Photon counting histogram: one-photon excitation.
   B Huang, T D Perroud, R N Zare. Chem Phys Chem (5), 1523-31, 2004.
   Supporting information: Calculation of the observation volume profile.
5. Gaussian approximations of fluorescence microscope point-spread function
   models.
   B Zhang, J Zerubia, J C Olivo-Marin. Appl. Optics (46) 1819-29, 2007.
6. The SVI-wiki on 3D microscopy, deconvolution, visualization and analysis.
   https://svi.nl/NyquistRate

Examples
--------

.. code-block:: python

    >>> import psf
    >>> args = dict(
    ...     shape=(32, 32),
    ...     dims=(4, 4),
    ...     ex_wavelen=488,
    ...     em_wavelen=520,
    ...     num_aperture=1.2,
    ...     refr_index=1.333,
    ...     pinhole_radius=0.55,
    ...     pinhole_shape='round',
    ... )
    >>> obsvol = psf.PSF(psf.GAUSSIAN | psf.CONFOCAL, **args)
    >>> obsvol.sigma.ou
    (2.588..., 1.370...)
    >>> obsvol = psf.PSF(psf.ISOTROPIC | psf.CONFOCAL, **args)
    >>> print(obsvol, end='')
    PSF
     ISOTROPIC|CONFOCAL
     shape: (32, 32) pixel
     dimensions: (4.00, 4.00) um, (55.64, 61.80) ou, (8.06, 8.06) au
     excitation wavelength: 488.0 nm
     emission wavelength: 520.0 nm
     numeric aperture: 1.20
     refractive index: 1.33
     half cone angle: 64.19 deg
     magnification: 1.00
     underfilling: 1.00
     pinhole radius: 0.550 um, 8.498 ou, 1.1086 au, 4.40 px
     computing time: ... ms
    >>> obsvol[0, :3]
    array([1.     , 0.51071, 0.04397])
    >>> # write the image plane to file
    >>> obsvol.slice(0).tofile('_test_slice.bin')
    >>> # write a full 3D PSF volume to file
    >>> obsvol.volume().tofile('_test_volume.bin')

Refer to `psf_example.py` in the source distribution for more examples.

Owner

  • Name: Christoph Gohlke
  • Login: cgohlke
  • Kind: user
  • Location: Irvine, California

GitHub Events

Total
  • Issues event: 3
  • Watch event: 6
  • Issue comment event: 1
  • Push event: 1
  • Create event: 2
Last Year
  • Issues event: 3
  • Watch event: 6
  • Issue comment event: 1
  • Push event: 1
  • Create event: 2

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 77
  • Total Committers: 2
  • Avg Commits per committer: 38.5
  • Development Distribution Score (DDS): 0.468
Past Year
  • Commits: 19
  • Committers: 1
  • Avg Commits per committer: 19.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Christoph Gohlke c****e@u****u 41
Christoph Gohlke c****e@c****m 36
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 2
  • Total pull requests: 0
  • Average time to close issues: 9 days
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: 9 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • EvanYyf (2)
Pull Request Authors
Top Labels
Issue Labels
question (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,000 last-month
  • Total dependent packages: 3
  • Total dependent repositories: 3
  • Total versions: 15
  • Total maintainers: 1
pypi.org: psf

Point Spread Function calculations for fluorescence microscopy

  • Versions: 15
  • Dependent Packages: 3
  • Dependent Repositories: 3
  • Downloads: 1,000 Last month
Rankings
Dependent packages count: 3.1%
Dependent repos count: 9.0%
Average: 10.6%
Stargazers count: 12.3%
Downloads: 13.1%
Forks count: 15.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • numpy >=1.19.2
.github/workflows/wheel.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • pypa/cibuildwheel v2.18.1 composite
pyproject.toml pypi