Skip to content

type hierarchy for projectors #6

Description

@kczimm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions