• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kunzaatko / TransferFunctions.jl / 17101643433

20 Aug 2025 02:36PM UTC coverage: 77.484% (+77.5%) from 0.0%
17101643433

push

github

kunzaatko
fix(tests): Correct the error types thrown and fix the unbound args

0 of 4 new or added lines in 2 files covered. (0.0%)

499 of 644 relevant lines covered (77.48%)

40779.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.0
/src/psf/point-spread-function.jl
1
using InterfaceFunctions
2

3
"""
4
    PointSpreadFunction{N} <: LinearShiftInvariantTransferFunction{N}
5
A point spread function is a description of a transfer functions specifying the intensity transfer of a single point
6
source in the object plane into a region of the image plane.
7

8
# Implementation
9
To create a new Point spread function (PSF) `A <: PointSpreadFunction`, you must define the __intensity__ at a given
10
[length](@extref Unitful `Length`) coordinate `intensity(psf::A, x::Length, y::Length)`.
11
"""
12
abstract type PointSpreadFunction{N} <: LinearShiftInvariantTransferFunction{N} end
13
Broadcast.broadcastable(tf::PointSpreadFunction) = Ref(tf)
20✔
14

15
"""
16
    PointSpreadFunctionSymmetry
17
A marker type that indicates the symmetries of a `PointSpreadFunction` which may lead to optimized methods.
18

19
Subtypes thus far include [`ZAxisRadialSymmetry`](@ref) and [`NoSymmetry`](@ref).
20
"""
21
abstract type PointSpreadFunctionSymmetry end
22
Broadcast.broadcastable(s::PointSpreadFunctionSymmetry) = Ref(s)
×
23

24
"""
25
    ZAxisRadialSymmetry <: PointSpreadFunctionSymmetry
26
``z`` axis radial symmetry of a `PointSpreadFunction` indicates that the PSF is symmetric in the radially around the
27
z-axis.
28
"""
29
struct ZAxisRadialSymmetry <: PointSpreadFunctionSymmetry end
89,354✔
30

31
"""
32
    NoSymmetry <: PointSpreadFunctionSymmetry
33
`NoSymmetry` marks a `PointSpreadFunction` that is not symmetric in any way. You need to compute every ``x``, ``y``,
34
``z`` coordinate separately. 
35
"""
36
struct NoSymmetry <: PointSpreadFunctionSymmetry end
2✔
37

38
"""
39
    symmtery(psf::PointSpreadFunction)
40
Marks the symmetries of a `PointSpreadFunction`.
41
"""
42
@interface symmetry(::PointSpreadFunction) = NoSymmetry()
×
43

44
"""
45
    intensity(psf::PointSpreadFunction, x::Length, y::Length)
46
The intensity of a `PSF` at a given location.
47
"""
48
@interface response(psf::PointSpreadFunction, args...) = response(symmetry(psf), psf, args...)
×
49
@inline response(::ZAxisRadialSymmetry, psf::PointSpreadFunction, x::Length, y::Length) = intensity(psf, hypot(x, y))
1,470✔
NEW
50
@inline response(::ZAxisRadialSymmetry, psf::PointSpreadFunction{3}, x::Length, y::Length, z::Length) = intensity(psf, hypot(x, y), z)
87,880✔
51
@inline response(::NoSymmetry, psf::PointSpreadFunction, x::Length, y::Length) = intensity(psf, x, y)
2✔
NEW
52
@inline response(::NoSymmetry, psf::PointSpreadFunction{3}, x::Length, y::Length, z::Length) = intensity(psf, x, y, z)
×
53

54
"""
55
    PSFModel <: PointSpreadFunction 
56
`PointSpreadFunction` subtype for PSF models. A `PSF` model is a `PointSpreadFunction` that has parameters accessible
57
through [`params`](@ref) and can be fitted to data.
58
"""
59
abstract type PSFModel{N} <: PointSpreadFunction{N} end
60

61
include("methods.jl")
62

63
# Augmentations
64
include("./rotated-psf.jl")
65
include("./scaled-psf.jl")
66

67
include("./psf-array.jl")
68

69
# Models
70
include("./models/airy-disc.jl")
71
include("./models/gaussian.jl")
72

73
include("./models/gibson-lanni.jl")
74
include("./models/born-wolf.jl")
75

76

77
include("./estimation.jl")
78

79
export response, psf
80
export BornWolf, GibsonLanni, PSFArray
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc