Skip to content

Commit 542c535

Browse files
committed
Update docs
1 parent 88fdf4e commit 542c535

15 files changed

+257
-19
lines changed

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ImageGeoms = "9ee76f2b-840d-4475-b6d6-e485c9297852"
77
ImagePhantoms = "71a99df6-f52c-4da1-bd2a-69d6f37f3252"
88
LinearOperatorCollection = "a4a2c56f-fead-462a-a3ab-85921a5f2575"
99
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
10+
Observables = "510215fc-4207-5dde-b226-833fc4488ee2"
1011
RadonKA = "86de8297-835b-47df-b249-c04e8db91db5"
1112
RegularizedLeastSquares = "1e9c538a-f78c-5de5-8ffb-0b6dbe892d23"
1213

docs/make.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ makedocs(
3636
"Iterative Reconstruction Result" => "generated/example/5_iterative_result.md",
3737
],
3838
"How to" => Any[
39-
#"Construct RecoPlan" => "generated/howto/reco_plan.md",
40-
#"Caching" => "generated/howto/caching.md",
41-
#"Listeners" => "generated/howto/listeners.md",
39+
"Serialization" => "generated/howto/serialization.md",
40+
"Caching" => "generated/howto/caching.md",
41+
"Observables" => "generated/howto/observables.md",
4242
],
4343
#"API Reference" => Any["Solvers" => "API/solvers.md",
4444
#"Regularization Terms" => "API/regularization.md"],

docs/src/example_intro.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ In this example we will implement a small image reconstruction package with the
33

44
Most of the desired functionality is already implemented in various Julia packages. Our reconstruction packages now needs to properly connect these packages and transform the data into the appropriate formats for each package.
55

6-
The example is intended for developers of reconstruction packages that use `AbstractImageReconstruction`. End-users of such a package can consult the result sections of the example to see the high-level interface of `AbstractImagerReconstruction` and should otherwise consult the documentation of the concrete reconstruction package itself.
6+
!!! note
7+
The example is intended for developers of reconstruction packages that use `AbstractImageReconstruction`. End-users of such a package can consult the result sections of the example to see the high-level interface of `AbstractImagerReconstruction` and should otherwise consult the documentation of the concrete reconstruction package itself.
78

89
## Installation
910
We can install `AbstractImageReconstruction` using the Julia package manager. Open a Julia REPL and run the following command:

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ AbstractImageReconstruction.jl is a Julia package that serves as the core API fo
88

99
## Features
1010

11-
* Variety of optimization algorithms optimized for least squares problems
1211
* Storing, loading and manipulating of reconstruction algorithms with (partially) set parameters
13-
* Attaching callback listeners to parameters
12+
* Attaching callbacks to parameters changes with Observables.jl
13+
* Transparent caching of intermediate reconstruction results
1414

1515
## Installation
1616

docs/src/literate/example/1_interface.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
# For our package we extend these abstract types with our own abstract subtypes:
1414
using AbstractImageReconstruction
15+
export AbstractRadonAlgorithm, AbstractRadonParameters, AbstractRadonPreprocessingParameters, AbstractRadonReconstructionParameters, AbstractDirectRadonAlgorithm, AbstractIterativeRadonAlgorithm, RadonPreprocessingParameters # hide
1516
abstract type AbstractRadonAlgorithm <: AbstractImageReconstructionAlgorithm end
1617
abstract type AbstractRadonParameters <: AbstractImageReconstructionParameters end
1718

docs/src/literate/example/2_direct.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include("../../literate/example/1_interface.jl") #hide
22
using RadonKA #hide
3+
export AbstractDirectRadonReconstructionParameters, RadonFilteredBackprojectionParameters, RadonBackprojectionParameters, DirectRadonParameters, DirectRadonAlgorithm #hide
34

45
# # Direct Reconstruction
56
# To implement our direct reconstruction algorithms we need to define a few more methods and types. We will start by defining the parameters for the backprojection and for the filtered backprojection. Afterwards we can implement the algorithm itself.
@@ -33,7 +34,7 @@ AbstractImageReconstruction.process(::Type{<:AbstractDirectRadonAlgorithm}, para
3334
# ## Algorithm
3435
# The direct reconstruction algorithm has essentially no state to store between reconstructions and thus only needs its parameters as fields. We want our algorithm to accept any combination of our preprocessing and direct reconstruction parameters.
3536
# This we encode in a new type:
36-
Base.@kwdef struct DirectRadonParameters{P, R} <: AbstractRadonParameters where {P<:AbstractRadonPreprocessingParameters, R<:AbstractDirectRadonReconstructionParameters}
37+
Base.@kwdef struct DirectRadonParameters{P <: AbstractRadonPreprocessingParameters, R <: AbstractDirectRadonReconstructionParameters} <: AbstractRadonParameters
3738
pre::P
3839
reco::R
3940
end
@@ -44,7 +45,7 @@ function AbstractImageReconstruction.process(algoT::Type{<:AbstractDirectRadonAl
4445
end
4546

4647
# Now we can define the algorithm type itself. Algorithms are usually constructed with one argument passing in the user parameters:
47-
mutable struct DirectRadonAlgorithm{D} <: AbstractDirectRadonAlgorithm where D <: DirectRadonParameters
48+
mutable struct DirectRadonAlgorithm{D <: DirectRadonParameters} <: AbstractDirectRadonAlgorithm
4849
parameter::D
4950
output::Channel{Any}
5051
DirectRadonAlgorithm(parameter::D) where D = new{D}(parameter, Channel{Any}(Inf))

docs/src/literate/example/3_direct_result.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include("../../literate/example/example_include.jl") #hide
1+
include("../../literate/example/example_include_all.jl") #hide
22

33
# # Direct Reconstruction Result
44
# Now that we have implemented our direct reconstruction algorithm, we can use it to reconstruct for example the first three images of our time series.

docs/src/literate/example/4_iterative.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include("../../literate/example/1_interface.jl") #hide
22
using RadonKA #hide
3+
export AbstractIterativeRadonReconstructionParameters, IterativeRadonReconstructionParameters, IterativeRadonParameters, IterativeRadonAlgorithm #hide
34

45
# # Iterative Reconstruction
56
# In this section we implement a more complex iterative reconstruction algorithm.
@@ -38,14 +39,14 @@ end
3839

3940
# ## Algorithm
4041
# Similar to the direct reconstruction algorithm, we want our iterative algorithm to accept both preprocessing and reconstruction parameters. We will encode this in a new type:
41-
Base.@kwdef struct IterativeRadonParameters{P, R} <: AbstractRadonParameters where {P<:AbstractRadonPreprocessingParameters, R<:AbstractIterativeRadonReconstructionParameters}
42+
Base.@kwdef struct IterativeRadonParameters{P<:AbstractRadonPreprocessingParameters, R<:AbstractIterativeRadonReconstructionParameters} <: AbstractRadonParameters
4243
pre::P
4344
reco::R
4445
end
4546
# Instead of defining essentially the same struct again, we could also define a more generic one and specify the supported reconstruction parameter as type constraints in the algorithm constructor.
4647

4748
# Unlike the direct reconstruction algorithm, the iterative algorithm has to store the linear operator. We will store it as a field in the algorithm type:
48-
mutable struct IterativeRadonAlgorithm{D} <: AbstractIterativeRadonAlgorithm where D <: IterativeRadonParameters
49+
mutable struct IterativeRadonAlgorithm{D <: IterativeRadonParameters} <: AbstractIterativeRadonAlgorithm
4950
parameter::D
5051
op::Union{Nothing, AbstractLinearOperator}
5152
output::Channel{Any}
@@ -69,7 +70,7 @@ function AbstractImageReconstruction.process(algo::IterativeRadonAlgorithm, para
6970
return process(AbstractIterativeRadonAlgorithm, params, op, data)
7071
end
7172

72-
# As it stands our algorithm is not type stable. To fix this, we would need to know the element type during construction. Which is possible with a different parameterization of the algorithm. We will not do this here.
73+
# Our algorithm is not type stable. To fix this, we would need to know the element type of the sinograms during construction. Which is possible with a different parameterization of the algorithm. We will not do this here.
7374
# Often times the performance impact of this is negligible as the critical sections are in the preprocessing or the iterative solver, especially since we still dispatch on the operator.
7475

7576
# To finish up the implementation we need to implement the `put!`, `take!` and `parameters` functions:
@@ -79,4 +80,4 @@ function Base.put!(algo::IterativeRadonAlgorithm, data::AbstractArray{T, 4}) whe
7980
put!(algo.output, process(algo, algo.parameter, data))
8081
end
8182
end
82-
AbstractImageReconstruction.parameter(algo::IterativeRadonAlgorithm) = algo.parameter
83+
AbstractImageReconstruction.parameter(algo::IterativeRadonAlgorithm) = algo.parameter

docs/src/literate/example/5_iterative_result.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include("../../literate/example/example_include.jl") #hide
1+
include("../../literate/example/example_include_all.jl") #hide
22

33
# # Iterative Reconstruction Result
44
# We can now use the iterative algorithms to reconstruct the first three images of our time series.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include("../../literate/example/example_include_module.jl")
2+
include("../../literate/example/example_include_data.jl")

0 commit comments

Comments
 (0)