API for Solvers

This page contains documentation of the public API of the AbstractImageReconstruction. In the Julia REPL one can access this documentation by entering the help mode with ?

Algorithm and Parameters

AbstractImageReconstruction.reconstructFunction
reconstruct(algo::T, u) where {T<:AbstractImageReconstructionAlgorithm}

Reconstruct an image from input u using algorithm algo. The àlgo will be locked until the result is available or an error occurs.

source
Base.put!Method
put!(algo::AbstractImageReconstructionAlgorithm, inputs...)

Perform image reonstruction with algorithm algo on given ìnputs. Depending on the algorithm this might block. Result is stored and can be retrieved with take!.

source
Base.take!Method
take!(algo::AbstractImageReconstructionAlgorithm)

Remove and return a stored result from the algorithm algo. Blocks until a result is available.

source
Base.lockMethod
lock(algo::AbstractImageReconstructionAlgorithm)

Acquire a lock on the algorithm algo. If the lock is already acquired, wait until it is released.

Each lock must be matched with a unlock.

source
Base.unlockMethod
unlock(algo::AbstractImageReconstructionAlgorithm)

Release a lock on the algorithm algo.

source
Base.isreadyMethod
isready(algo::AbstractImageReconstructionAlgorithm)

Determine if the algorithm algo has a result available.

source
Base.waitMethod
wait(algo::AbstractImageReconstructionAlgorithm)

Wait for a result to be available from the specified algo.

source
AbstractImageReconstruction.processFunction
process(algo::Union{A, Type{A}}, param::AbstractImageReconstructionParameters, inputs...) where A <: AbstractImageReconstructionAlgorithm

Process inputs with algorithm algo and parameters param. Returns the result of the processing step. If not implemented for an instance of algo, the default implementation is called with the type of algo.

source
AbstractImageReconstruction.parameterFunction
parameter(algo::AbstractImageReconstructionAlgorithm)

Return the parameters of the algorithm algo.

source
parameter(param::AbstractUtilityReconstructionParameters)

Return the wrapped parameter. Can themselves be utility parameters again

source

RecoPlan

AbstractImageReconstruction.RecoPlanType
RecoPlan{T <: Union{AbstractImageReconstructionParameters, AbstractImageReconstructionAlgorithm}}

Configuration template for an image reconstruction algorithm or paremeters of type T. A RecoPlan{T} has the same properties with type checking as T with the exception that properties can be missing and nested algorithms and parameters can again be RecoPlans.

Plans can be nested and form a tree. A parent plan can be accessed with parent and set with parent!. Algorithms and parameters can be converted to a plan with toPlan.

Plans feature serialization with toTOML, toPlan and loadPlan and the ability to attach callbacks to property changes with Òbservables and on.

source
Base.propertynamesMethod
propertynames(plan::RecoPlan{T}) where {T}

Return a tupel of configurable properties of T. Unlike propertynames(T) this does not include properties starting with _.

source
Base.getpropertyMethod
getproperty(plan::RecoPlan{T}, name::Symbol) where {T}

Get the property name of plan. Equivalent to plan.name.

source
Base.getindexMethod
getindex(plan::RecoPlan{T}, name::Symbol) where {T}

Return the Observable for the name property of plan. Equivalent to plan[name].

source
Base.setproperty!Method
setproperty!(plan::RecoPlan{T}, name::Symbol, x::X) where {T, X}

Set the property name of plan to x. Equivalent to plan.name = x. Triggers callbacks attached to the property.

source
AbstractImageReconstruction.setAll!Function
setAll!(plan::RecoPlan{T}, name::Symbol, x) where {T<:AbstractImageReconstructionParameters}

Recursively set the property name of each nested RecoPlan of plan to x.

source
setAll!(plan::AbstractRecoPlan; kwargs...)

Call setAll! with each given keyword argument.

source
setAll!(plan::AbstractRecoPlan, dict::Union{Dict{Symbol, Any}, Dict{String, Any}})

Call setAll! with each entries of the dict.

source
AbstractImageReconstruction.clear!Function
clear!(plan::RecoPlan{T}, preserve::Bool = true) where {T<:AbstractImageReconstructionParameters}

Clear all properties of plan. If preserve is true, nested RecoPlans are preserved.

source
Base.ismissingMethod
ismissing(plan::RecoPlan, name::Symbol)

Indicate if the property name of plan is missing.

source
Observables.onMethod
on(f, plan::RecoPlan, property::Symbol; kwargs...)

Adds function f as listener to property of plan. The function is called whenever the property is changed with setproperty!.

source
Observables.offMethod
off(plan::RecoPlan, property::Symbol, f)

Remove f from the listeners of property of plan.

source
AbstractImageReconstruction.buildFunction
build(plan::RecoPlan{T}) where {T}

Recursively build a plan from a RecoPlan by converting all properties to their actual values using keyword argument constructors.

source
AbstractImageReconstruction.toPlanFunction
toPlan(param::Union{AbstractImageReconstructionParameters, AbstractImageReconstructionAlgorithm})

Convert an AbstractImageReconstructionParameters or AbstractImageReconstructionAlgorithm to a (nested) RecoPlan.

source
AbstractImageReconstruction.loadPlanFunction
loadPlan(filename::Union{AbstractString, IO}, modules::Vector{Module})

Load a RecoPlan from a TOML file. The modules argument is a vector of modules that contain the types used in the plan. After loading the plan, the listeners are attached to the properties using loadListener!.

source
AbstractImageReconstruction.parentpropertiesFunction
parentproperties(plan::RecoPlan)

Return a vector of property names of plan in its parent, s.t. getproperty(parent(plan), last(parentproperties(plan))) === plan. Return an empty vector if plan has no parent.

source

Miscellaneous

AbstractImageReconstruction.LinkedPropertyListenerType
LinkedPropertyListener(fn, target::RecoPlan, targetProp, source::RecoPlan, sourceProp)

Connect two properties of RecoPlans. Set target.targetProp to fn(source.sourceProp) whenever source.sourceProp changes and target.targetProp was not changed outside of the listener.

source
AbstractImageReconstruction.ProcessResultCacheType
ProcessResultCache(params::AbstractImageReconstructionParameters; maxsize = 1, kwargs...)

Cache of size maxsize for the result of process methods. The cache is based on the hash of the inputs of the process function. Cache is shared between all algorithms constructed from the same plan. The cache is transparent for properties of the underlying parameter. Cache can be invalidated by calling empty! on the cache.

source
Base.hashMethod
hash(parameter::AbstractImageReconstructionParameters, h)

Default hash function for image reconstruction paramters. Uses nameof the parameter and all fields not starting with _ to compute the hash.

source
AbstractImageReconstruction.toKwargsMethod
toKwargs(value::AbstractImageReconstructionParameters; kwargs...)

Convert a AbstractImageReconstructionParameters to a Dict{Symbol, Any} of each property.

Optional keyword arguments:

  • flatten::Vector{DataType}: Types to flatten, per default only AbstractImageReconstructionParameters are flattened.
  • ignore::Vector{Symbol}: Properties to ignore.
  • default::Dict{Symbol, Any}: Default values for properties that are missing.
  • overwrite::Dict{Symbol, Any}: Overwrite values for properties.
source
AbstractImageReconstruction.toDict!Function
toDict!(dict, value)

Extracts metadata such as the module and type name from value and adds it to dict. The value-representation of value is added using toDictValue!.

source
AbstractImageReconstruction.toDictValue!Function
toDictValue!(dict, value)

Extracts the value-representation of value and adds it to dict. The default implementation for structs with fields adds each field of the argument as a key-value pair with the value being provided by the toDictValue function.

source
toDictValue!(dict, plan::RecoPlan)

Adds the properties of plan to dict using toDictValue for each not missing field. Additionally, adds each listener::AbstractPlanListener to the dict.

source