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

kunzaatko / TransferFunctions.jl / 16873766683

11 Aug 2025 07:29AM UTC coverage: 0.0% (-70.9%) from 70.933%
16873766683

push

github

kunzaatko
feat: Add `ReflectedArray` type

0 of 8 new or added lines in 1 file covered. (0.0%)

319 existing lines in 13 files now uncovered.

0 of 459 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/src/transfer-function-interface.jl
1
using InterfaceFunctions
2

3
"""
4
    TransferFunction
5
Super type for all transfer functions
6

7
A transfer function in microscopy is an object specifying the response in the image plane to the light coming from the
8
object plane.
9
There are several characteristics of a transfer functions which can influence the character of the response. Most
10
commonly we are concerned with its spatial variance/invariance, i.e. whether the response is dependent of the objects
11
position in the object plane, and linearity (which is almost always satisfied).
12

13
See also [`LinearTransferFunction`](@ref), [`ImpulseResponseMapping`](@ref)
14
"""
15
abstract type TransferFunction end
16
@interface transfer(t::TransferFunction, ::SpatialMatrix{<:Real})
17
@interface restore(t::TransferFunction, ::SpatialMatrix{<:Real})
18

19
# NOTE: Taken from Distributions.jl <kunzaatko> 
20
for func in (:(==), :isequal, :isapprox)
UNCOV
21
    @eval function Base.$func(tf1::A, tf2::B; kwargs...) where {A<:TransferFunction,B<:TransferFunction}
×
UNCOV
22
        nameof(A) === nameof(B) || return false
×
UNCOV
23
        fields = fieldnames(A)
×
UNCOV
24
        fields === fieldnames(B) || return false
×
25

UNCOV
26
        for f in fields
×
UNCOV
27
            isdefined(tf1, f) && isdefined(tf2, f) || return false
×
28
            # perform equivalence check to support types that have no defined equality, such
29
            # as `missing`
UNCOV
30
            getfield(tf1, f) === getfield(tf2, f) || $func(getfield(tf1, f), getfield(tf2, f); kwargs...) || return false
×
UNCOV
31
        end
×
32

UNCOV
33
        return true
×
34
    end
35
end
36

37
# NOTE: Taken from Distributions.jl <kunzaatko> 
UNCOV
38
function Base.hash(tf::TransferFunction, h::UInt)
×
UNCOV
39
    hashed = hash(TransferFunction, h)
×
UNCOV
40
    hashed = hash(nameof(typeof(tf)), hashed)
×
41

UNCOV
42
    for f in fieldnames(typeof(tf))
×
UNCOV
43
        hashed = hash(getfield(tf, f), hashed)
×
UNCOV
44
    end
×
45

UNCOV
46
    return hashed
×
47
end
48

49
export transfer, restore
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