Skip to content

Commit aa9b060

Browse files
committed
Add docstrings
1 parent d5ce830 commit aa9b060

17 files changed

+328
-179
lines changed

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Documenter, Literate, AbstractImageReconstruction
1+
using Documenter, Literate, AbstractImageReconstruction, Observables
22

33
# Generate examples
44
OUTPUT_BASE = joinpath(@__DIR__(), "src/generated")
@@ -40,7 +40,7 @@ makedocs(
4040
"Caching" => "generated/howto/caching.md",
4141
"Observables" => "generated/howto/observables.md",
4242
],
43-
#"API Reference" => Any["Solvers" => "API/solvers.md",
43+
"API Reference" => "API/api.md",
4444
#"Regularization Terms" => "API/regularization.md"],
4545

4646
],

docs/src/API/algorithm.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

docs/src/API/api.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# API for Solvers
2+
This page contains documentation of the public API of the AbstractImageReconstruction. In the Julia
3+
REPL one can access this documentation by entering the help mode with `?`
4+
5+
## Algorithm and Parameters
6+
```@docs
7+
AbstractImageReconstruction.AbstractImageReconstructionAlgorithm
8+
AbstractImageReconstruction.reconstruct
9+
Base.put!(::AbstractImageReconstructionAlgorithm, ::Any)
10+
Base.take!(::AbstractImageReconstructionAlgorithm)
11+
AbstractImageReconstruction.AbstractImageReconstructionParameters
12+
AbstractImageReconstruction.process
13+
AbstractImageReconstruction.parameter
14+
```
15+
16+
## RecoPlan
17+
```@docs
18+
AbstractImageReconstruction.RecoPlan
19+
Base.propertynames(::RecoPlan)
20+
Base.getproperty(::RecoPlan, ::Symbol)
21+
Base.getindex(::RecoPlan, ::Symbol)
22+
Base.setproperty!(::RecoPlan, ::Symbol, ::Any)
23+
AbstractImageReconstruction.setAll!
24+
AbstractImageReconstruction.clear!
25+
Base.ismissing(::RecoPlan, ::Symbol)
26+
Observables.on(::Any, ::RecoPlan, ::Symbol)
27+
Observables.off(::RecoPlan, ::Symbol, ::Any)
28+
AbstractImageReconstruction.build
29+
AbstractImageReconstruction.toPlan
30+
AbstractImageReconstruction.savePlan
31+
AbstractImageReconstruction.loadPlan
32+
AbstractImageReconstruction.loadListener!
33+
AbstractImageReconstruction.parent(::RecoPlan)
34+
AbstractImageReconstruction.parent!(::RecoPlan, ::RecoPlan)
35+
AbstractImageReconstruction.parentproperty
36+
AbstractImageReconstruction.parentproperties
37+
```
38+
39+
## Miscellaneous
40+
```@docs
41+
AbstractImageReconstruction.LinkedPropertyListener
42+
AbstractImageReconstruction.ProcessResultCache
43+
Base.hash(::AbstractImageReconstructionParameters, ::UInt64)
44+
AbstractImageReconstruction.toKwargs(::AbstractImageReconstructionParameters)
45+
AbstractImageReconstruction.fromKwargs
46+
AbstractImageReconstruction.toDict
47+
AbstractImageReconstruction.toDict!
48+
AbstractImageReconstruction.toDictValue
49+
AbstractImageReconstruction.toDictValue!
50+
```

docs/src/API/plan.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

docs/src/example_intro.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Small Reconstruction Package for Radon projections
2-
In this example we will implement a small image reconstruction package with the help of `AbstractImageReconstruction.jl`. Our example reconstruction package aims to provide direct and iterative reconstruction algorithms for Radon projection data.
2+
In this example we will implement a small image reconstruction package using `AbstractImageReconstruction.jl`. Our reconstruction package `OurRadonreco` aims to provide direct and iterative reconstruction algorithms for Radon projection data.
33

4-
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.
4+
Most of the desired functionality is already implemented in various Julia packages. Our reconstruction package now needs to properly link these packages and transform the data into the appropriate formats for each package.
55

66
!!! note
77
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.
@@ -16,27 +16,27 @@ Pkg.add("AbstractImageReconstruction")
1616
This will download and install AbstractImageReconstruction.jl and its dependencies. To install a different version, please consult the [Pkg documentation](https://pkgdocs.julialang.org/dev/managing-packages/#Adding-packages). In addition to AbstractImageReconstruction.jl, we will need a few more packages to get started, which we can install the same way.
1717

1818

19-
[RadonKA.jl](https://github.com/roflmaostc/RadonKA.jl/tree/main) provides us with fast Radon forward and backprojections, which we can use for direct reconstructions and preparing example data for our package.
19+
[RadonKA.jl](https://github.com/roflmaostc/RadonKA.jl/tree/main) provides us with fast Radon forward and backward projections, which we can use for direct reconstructions and to prepare sample data for our package.
2020

21-
[LinearOperatorCollection.jl](https://github.com/JuliaImageRecon/LinearOperatorCollection.jl) wraps the functionality of RadonKA.jl in a matrix-free linear operator, which can be used in iterative solvers.
21+
[LinearOperatorCollection.jl](https://github.com/JuliaImageRecon/LinearOperatorCollection.jl) wraps the functionality of RadonKA.jl into a matrix-free linear operator, that can be used in iterative solvers.
2222

23-
[RegularizedLeastSquares.jl](https://github.com/JuliaImageRecon/RegularizedLeastSquares.jl) offers a variety of iterative solver and regularization options.
23+
[RegularizedLeastSquares.jl](https://github.com/JuliaImageRecon/RegularizedLeastSquares.jl) offers a variety of iterative solvers and regularization options.
2424

2525
[ImagePhantoms.jl](https://github.com/JuliaImageRecon/ImagePhantoms.jl) and [ImageGeoms.jl](https://github.com/JuliaImageRecon/ImageGeoms.jl) allow us to define digital software "phantoms", which we will use to test our reconstruction algorithms.
2626

2727
Lastly, we will use [CairoMakie.jl](https://docs.makie.org/stable/) to visualize our results.
2828

2929
## Outline
30-
[Radon Data](generated/example/0_radon_data.md): In this section we get familiar with RadonKA.jl and define a small dataformat for three-dimensional time-series sinograms. We also create the inverse problem, which we want to solve in the remainder of the example.
30+
[Radon Data](generated/example/0_radon_data.md): this section we will familiarise ourselves with RadonKA.jl and define a small data format for three-dimensional time series sinograms. We also create the inverse problem that we will solve in the rest of the example
3131

3232
[Interface](generated/example/1_interface.md): Here we define the abstract types we will use in our package and take a look at what we need to implement to interact with `AbstractImageReconstruction`. We also start with a first processing step of our algorithms.
3333

3434
[Direct Reconstruction](generated/example/2_direct.md): Now we extend our abstract types with a concrete implementation of reconstruction algorithms using the backprojection and filtered backprojection.
3535

36-
[Direct Reconstruction Result](generated/example/3_direct_result.md): This section shows how to use the algorithm we just implemented.
36+
[Direct Reconstruction Result](generated/example/3_direct_result.md): This section shows how to use the algorithm we have just implemented.
3737

3838
[Iterative Reconstruction](generated/example/4_iterative.md): We finish our small example package by implementing an iterative reconstruction algorithm. For this algorithm we require more complex parametrization and data processing.
3939

40-
[Iterative Reconstruction Result](generated/example/5_iterative_result.md): The last section again shows how to use the just implemented algorithm. But it also highlights `RecoPlans`, which are a core utility of `AbstractImageReconstruction`. These plans allow a user to easily configure, store and load algorithms as templates.
40+
[Iterative Reconstruction Result](generated/example/5_iterative_result.md): The last section shows again how to use the just implemented algorithm. But it also highlights `RecoPlans`, which are a core utility of `AbstractImageReconstruction`. These plans allow a user to easily configure, save and load algorithms as templates.
4141

42-
For an even more indepth reconstruction package we refer to the magnetic particle imaging reconstruction package [MPIReco.jl](https://github.com/MagneticParticleImaging/MPIReco.jl).
42+
For an even more detailed reconstruction package we refer to the magnetic particle imaging reconstruction package [MPIReco.jl](https://github.com/MagneticParticleImaging/MPIReco.jl).

docs/src/index.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
## Introduction
66

7-
AbstractImageReconstruction.jl is a Julia package that serves as the core API for medical imaging packages. It provides implementations an interface and type hierarchy with which one can represent and implement image reconstruction algorithms, their parameters and runtime behaviour. In particular, this package serves as the API of the Julia packages [MPIReco.jl](https://github.com/MagneticParticleImaging/MPIReco.jl).
7+
AbstractImageReconstruction.jl is a Julia package that serves as the core API for medical imaging packages. It provides implementations an interface and type hierarchy to represent and implement image reconstruction algorithms, their parameters and runtime behaviour. In particular, this package serves as the API of the Julia packages [MPIReco.jl](https://github.com/MagneticParticleImaging/MPIReco.jl).
88

99
## Features
10-
10+
11+
* Reconstruction control flow defined with multiple-dispatch on extensible and exchangable type hierarchies
1112
* Storing, loading and manipulating of reconstruction algorithms with (partially) set parameters
12-
* Attaching callbacks to parameters changes with Observables.jl
13-
* Transparent caching of intermediate reconstruction results
13+
* Attaching callbacks to parameter changes with Observables.jl
14+
* Various generic utilities such as transparent caching of intermediate reconstruction results
1415

1516
## Installation
1617

@@ -22,7 +23,8 @@ Pkg.add("AbstractImageReconstruction")
2223
AbstractImageReconstruction is not intended to be used alone, but together with an image reconstruction package that implements the provided interface, such as [MPIReco.jl](https://github.com/MagneticParticleImaging/MPIReco.jl).
2324

2425
## Usage
25-
Concrete construction of reconstruction algorithms depend on the implementation of the reconstruction package. Once an algorithms is constructed with the given paramters, images can be reconstructed as follows:
26+
The actual construction of reconstruction algorithms depends on the implementation of the reconstruction package. Once an algorithm is constructed with the given parameters, images can be reconstructed as follows:
27+
2628
```julia
2729
using AbstractImageReconstruction, MPIReco
2830

@@ -32,7 +34,7 @@ raw = ... # Setup raw data
3234

3335
image = reconstruct(algo, raw)
3436
```
35-
Once an algorithm is constructed it can be transformed into a `RecoPlan`. These are mutable and transparent wrappers around the nested types of the algorithm and its paramters, that can be stored and restored to and from TOML files.
37+
An algorithm can be transformed into a `RecoPlan`. These are mutable and transparent wrappers around the nested types of the algorithm and its parameters, which can be saved and restored to and from TOML files.
3638

3739
```julia
3840
plan = toPlan(algo)
@@ -42,6 +44,6 @@ plan = loadPlan(MPIReco, "Example", [MPIReco, RegularizedLeastSquares, MPIFiles]
4244
algo2 = build(plan)
4345
algo == algo2 # true
4446
```
45-
Unlike concrete algorithm instances, a `RecoPlan` may still be missing certain values of its fields and it can encode the structure of an image reconstruction algorithm without concrete parameterization.
47+
Unlike concrete algorithm instances, a `RecoPlan` may still be missing certain values of its properties. Futhermore, they can encode the structure of an image reconstruction algorithm without concrete parameterization.
4648

47-
It is also possible to attach `Listeners` to `RecoPlan` fields, that call user-specified functions if they are changed. This allows specific `RecoPlans` to provide smart default paramter choices or embedding a plan into a GUI.
49+
It is also possible to attach functions to `RecoPlan` properties, that call user-specified functions if they are changed using `Observables.jl`. This allows specific `RecoPlans` to provide smart default parameter choices or embedding a plan into a GUI.

docs/src/literate/example/0_radon_data.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# # Radon Data
22

3-
# In this example we will setup our Radon data using RadonKA.jl, ImagePhantoms.jl and ImageGeoms.jl. We will start with simple 2D images and their sinograms and move up to a time series of 3D images and sinograms.
3+
# In this example we will set up our radon data using RadonKA.jl, ImagePhantoms.jl and ImageGeoms.jl. We will start with simple 2D images and their sinograms and continue with a time series of 3D images and sinograms.
44

55
# ## Background
6-
# The Radon transform is a integral transform which projects the values of a function(/or a phantom) along straight lines onto a detector.
6+
# The Radon transform is an integral transform that projects the values of a function(or a phantom) along straight lines onto a detector.
77
# These projections are recorded for a number of different angles and form the so-called sinogram. The Radon transform and its adjoint form the mathematical basis
8-
# for Computed Tomography (CT) and other imaging modalities such as single photon emission computed tomography (SPECT) and positron emission tomography (PET).
8+
# for computed tomography (CT) and other imaging modalities such as single photon emission computed tomography (SPECT) and positron emission tomography (PET).
99

1010
# ## 2D Phantom
1111
# We will use a simple Shepp-Logan phantom to generate our Radon data. The phantom is a standard test image for medical imaging and consists of a number of ellipses with different intensities.
12-
# It can be generated with ImagePhantoms.jl and ImageGeoms.jl. as follows:
12+
# It can be generated using ImagePhantoms.jl and ImageGeoms.jl. as follows:
1313

1414
using ImagePhantoms, ImageGeoms
1515
N = 256
1616
image = shepp_logan(N, SheppLoganToft())
1717
size(image)
1818

1919
# This produces a 256x256 image of a Shepp-Logan phantom. Next, we will generate the Radon data using `radon` from RadonKA.jl.
20-
# The arguments of this function are image or phantom under transformation, the anlges at which the projections are taken, and the used geometry of the system. For this example we will use the default parallel circle geometry.
20+
# The arguments of this function are the image or phantom to be transformed, the angles at which the projections are taken, and the used geometry of the system. For this example we will use the default parallel circle geometry.
2121
# For more details, we refer to the RadonKA.jl documentation. We will use 256 angles for the projections, between 0 and π.
2222
using RadonKA
2323
angles = collect(range(0, π, 256))

0 commit comments

Comments
 (0)