|
1 | 1 | # AbstractImageReconstruction
|
2 | 2 |
|
3 | 3 | [](https://github.com/JuliaImageRecon/AbstractImageReconstruction.jl/actions/workflows/CI.yml?query=branch%3Amain)
|
| 4 | + |
| 5 | +This package contains an interface and type hierarchy for image reconstruction algorithms and their parameters, together with associated utiltiy tools. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +Within Julia, use the package manager: |
| 10 | +```julia |
| 11 | +using Pkg |
| 12 | +Pkg.add("AbstractImageReconstruction") |
| 13 | +``` |
| 14 | +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) |
| 15 | + |
| 16 | +## Usage |
| 17 | +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: |
| 18 | +```julia |
| 19 | +using AbstractImageReconstruction, MPIReco |
| 20 | + |
| 21 | +params = ... # Setup reconstruction paramter |
| 22 | +algo = ... # Setup chosen algorithm with params |
| 23 | +raw = ... # Setup raw data |
| 24 | + |
| 25 | +image = reconstruct(algo, raw) |
| 26 | +``` |
| 27 | +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. |
| 28 | + |
| 29 | +```julia |
| 30 | +plan = toPlan(algo) |
| 31 | +savePlan(MPIReco, "Example", plan) |
| 32 | +plan = loadPlan(MPIReco, "Example", [MPIReco, RegularizedLeastSquares, MPIFiles]) |
| 33 | + |
| 34 | +algo2 = build(plan) |
| 35 | +algo == algo2 # true |
| 36 | +``` |
| 37 | +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. |
| 38 | + |
| 39 | +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. |
0 commit comments