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

kunzaatko / TransferFunctions.jl / 17332886172

29 Aug 2025 07:45PM UTC coverage: 0.0% (-81.0%) from 81.048%
17332886172

push

github

kunzaatko
test: Add the JET function filter again

0 of 732 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 [`LinearShiftInvariantTransferFunction`](@ref), [`ImpulseResponseMapping`](@ref)
14
"""
15
abstract type TransferFunction{N} end
16

17
# TODO: When it is possible to mark the non-first argument as the interfacing type, it should be done with interfaces
18
# again <27-08-25> 
19
"""
20
    transfer(A::SpatialMatrix, t::TransferFunction)
21
The forward pass of the transfer function operator `t` on the image `A`.
22

23
See also [`restore`](@ref)
24
"""
25
function transfer(::SpatialMatrix{<:Real}, ::TransferFunction) end
×
26

27
# TODO: When it is possible to mark the non-first argument as the interfacing type, it should be done with interfaces
28
# again <27-08-25> 
29
"""
30
    restore(A::SpatialMatrix, t::TransferFunction)
31
The reverse pass of the transfer function operator `t` on the image `A`.
32

33
It is always inherently an estimation because `A` is always noisy and `t` is often not well conditioned (especially in
34
the non-linear case).
35

36
See also [`transfer`](@ref)
37
"""
38
function restore(::SpatialMatrix{<:Real}, t::TransferFunction) end
×
39

40
# NOTE: Taken from Distributions.jl <kunzaatko> 
41
for func in (:(==), :isequal, :isapprox)
42
    @eval function Base.$func(tf1::A, tf2::B; kwargs...) where {A<:TransferFunction,B<:TransferFunction}
×
43
        nameof(A) === nameof(B) || return false
×
44
        fields = fieldnames(A)
×
45
        fields === fieldnames(B) || return false
×
46

47
        for f in fields
×
48
            isdefined(tf1, f) && isdefined(tf2, f) || return false
×
49
            # perform equivalence check to support types that have no defined equality, such
50
            # as `missing`
51
            getfield(tf1, f) === getfield(tf2, f) || $func(getfield(tf1, f), getfield(tf2, f); kwargs...) || return false
×
52
        end
×
53

54
        return true
×
55
    end
56
end
57

58
# NOTE: Taken from Distributions.jl <kunzaatko> 
59
function Base.hash(tf::TransferFunction, h::UInt)
×
60
    hashed = hash(TransferFunction, h)
×
61
    hashed = hash(nameof(typeof(tf)), hashed)
×
62

63
    for f in fieldnames(typeof(tf))
×
64
        hashed = hash(getfield(tf, f), hashed)
×
65
    end
×
66

67
    return hashed
×
68
end
69

70
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