As discussed in #5, a functor API could be used to accommodate multiple implementations of a specific function like radon. I hope to use this issue to discuss possible type hierarchies. For example, I keep thinking of something like,
abstract type Beam end
struct PencilBeam <: Beam end
struct FiniteBeam <: Beam end
abstract type Driver end
struct RayDriven <: Driver end
struct PixelDriven <: Driver end
abstract type Projector{<:Beam,<:Driver} end
struct MyMethod{T<:AbstractRange,V<:AbstractRange} <:
Projector{PencilBeam,RayDriven}
detectors::T
angles::V
end
function (m::MyMethod)(image::AbstractMatrix)
sinogram = zeros(eltype(image), length(m.detectors), length(m.angles))
# MyMethod algorithm
sinogram
end
which I thought of after looking through Distributions.jl/common.jl. Other than just I think it looks nice, I can't see from the example above, where the usefulness of the types I setup is.
As discussed in #5, a functor API could be used to accommodate multiple implementations of a specific function like
radon. I hope to use this issue to discuss possible type hierarchies. For example, I keep thinking of something like,which I thought of after looking through Distributions.jl/common.jl. Other than just I think it looks nice, I can't see from the example above, where the usefulness of the types I setup is.