LinearOperatorCollection.SamplingOp — Type
SamplingOp(::Type{T}; pattern, shape::Tuple=(), S = Vector{T})

builds a linear operator that samples a vector at the positions given by pattern.

Two modes are supported:

  • integer indices with shape: returns the entries of a vectorized array of size shape at the indices in pattern. A multidimensional pattern holds indices into the first dimension, one column per remaining index, and is converted with vectorizePattern. A one-dimensional pattern is used as is and not copied.
  • Boolean mask without shape: multiplies the input elementwise with a copy of pattern stored on the backend of S.

Adapt.adapt(to, op) rebuilds the operator for the storage type to from its effective pattern. Integer indices are copied and stay host arrays; the Boolean mask is copied to the target backend.

Arguments

  • pattern - integer indices or Boolean mask
  • shape::Tuple - size of the array to sample (integer indices only)
  • S - storage type of the operator
source
LinearOperatorCollection.WeightingOp — Type
WeightingOp(::Type{T}; weights::Vector{T}, rep::Int=1) where T

generates a LinearOperator which multiplies an input vector index-wise with weights

Arguments

  • weights::Vector{T} - weights vector
  • rep::Int=1 - number of sub-arrays that need to be multiplied with weights
source
LinearOperatorCollection.DiagOp — Type
DiagOp(ops...; scheduler = DynamicScheduler())
DiagOp(ops::Vector{...}; scheduler = DynamicScheduler())
DiagOp(ops::NTuple{N,...}; scheduler = DynamicScheduler())

create a bloc-diagonal operator out of the LinearOperators or Arrays contained in ops. Provide a OhMyThreads.Scheduler to change multi-tasking behaviour of the operator. Defaults to parallel execution

source
LinearOperatorCollection.RowBlockOp — Type
RowBlockOp(ops, rows; scheduler = DynamicScheduler())
RowBlockOp(ops; scheduler = DynamicScheduler())
RowBlockOp(A::AbstractMatrix, nblocks; mode = :interleaved, rng = Random.default_rng(), scheduler = DynamicScheduler())

create an operator out of the operators (or Arrays) in ops stacked vertically, [ops[1]; ops[2]; …], whose rows are scattered over the rows of the result: the rows of ops[k] are the rows rows[k] of the operator. All operators have the same number of columns, and rows is a partition of 1:nrow into index vectors or ranges, one per operator, of the length of that operator's number of rows. Without rows, the blocks are contiguous, in the order of ops.

Block-iterative solvers (e.g. ordered-subset methods) access the blocks with rowblocks. Applied as a whole, the operator multiplies every block and writes its result into its rows, and its adjoint sums the adjoints of the blocks applied to their rows. The products of the blocks run in parallel with scheduler (OhMyThreads.jl); the adjoint sums the blocks one after the other.

Blocks with contiguous rows (UnitRanges) work on views of the data; other rows are gathered into and scattered from a buffer per block (with index vectors on the device of the blocks, see Adapt.adapt). Reordering the data such that every block is contiguous avoids these copies.

The third form splits the rows of a matrix into nblocks blocks, as copies of the rows: :interleaved takes every nblocks-th row (k:nblocks:m), :contiguous consecutive rows, :random a random partition drawn with rng.

source
LinearOperatorCollection.GradientOp — Type

GradientOp(T::Type; shape::Tuple, dims=1:length(shape))

directional gradient operator along the dimensions dims for an array of size shape.

Required Argument

  • T - type of elements, .e.g. Float64 for ComplexF32

Required Keyword argument

  • shape::NTuple{N,Int} - shape of the array (e.g., image)

Optional Keyword argument

  • dims - dimension(s) along which the gradient is applied; default is 1:length(shape)
  • S - storage type of the operator, e.g. Vector{T} (default) or CuArray{T, 1}

Moving to another array backend

Adapt.adapt(CuArray, op)

returns a new gradient operator for the target backend, and copy(op) returns a new one with the same storage type. The target is the backing array type without element-type parameters (e.g. Array, JLArray, CuArray or ROCArray). Unlike S, which takes a parameterized type such as CuArray{T, 1}, an element-typed target such as Array{Float64} is not supported, even when its element type matches op. Adapting does not change the precision: choose T at construction. Both rebuild the operator and its temporary storage from shape and the directions taken from dims at construction; a later change of the vector passed as dims, or an iterator consumed by the construction, has no effect. op itself is not modified. The directions stay on the host. An element-typed target whose element type differs from op, such as CuArray{Float32} for a Float64 operator, throws an ArgumentError. An operator built with an S of another element type cannot be adapted to any target and throws an ArgumentError; copy keeps it as it is.

source
LinearOperatorCollection.ProdOp — Type
ProdOp(A,B)

composition/product of two Operators. Computes (A * (B * x)). Differs with composition via * since it can handle normal operator and allows for specialisation on A and B.

source
LinearOperatorCollection.NormalOp — Type
NormalOp(T::Type; parent, weights)

Lazy normal operator of parent with an optional weighting operator weights. Computes adjoint(parent) * weights * parent.

Required Argument

  • T - type of elements, .e.g. Float64 for ComplexF32

Required Keyword argument

  • parent - Base operator

Optional Keyword argument

  • weights - Optional weights for normal operator. Must already be of form weights = adjoint.(w) .* w
source
LinearOperatorCollection.normalOperator — Function
normalOperator(prod::ProdOp{T, <:WeightingOp, matT}; kwargs...)

Fuses weights of WeightingOp by computing adjoint.(weights) .* weights

source

normalOperator(parent (, weights); kwargs...)

Constructs a normal operator of the parent in an opinionated way, i.e. it tries to apply optimisations to the resulting operator.

source
normalOperator(op::RowBlockOp, W = nothing; kwargs...)

the normal operator adjoint(op) * W * op as the sum of the normal operators of the blocks (each with the part of the weights W that belongs to its rows), so that specialized normal operators of the blocks are used.

source
LinearOperatorCollection.WaveletOp — Type

WaveletOp(shape, wt=wavelet(WT.db2))

returns a ẀaveletOp <: AbstractLinearOperator, which performs a Wavelet transform on a given input array.

Arguments

  • shape - size of the Array to transform
  • (wt=wavelet(WT.db2)) - Wavelet to apply
source
LinearOperatorCollection.RadonOp — Type
RadonOp(::Type{T}; shape::NTuple{N, Int}, angles, geometry = RadonParallelCircle(shape[1], -(shape[1]-1)÷2:(shape[1]-1)÷2), μ = nothing, S = Vector{T}) where {T, N}

Generates a RadonOp which evaluates the Radon transform operator and its adjoint (backprojection) for a given geometry and projection angles.

Arguments:

  • T - element type for the operator (e.g., Float64, ComplexF32)
  • shape::NTuple{N, Int} - size of the image
  • angles - array of projection angles
  • geometry - Radon geometry descriptor (default: parallel beam circle)
  • μ - optional attenuation map (for attenuated Radon transform)
  • S - storage type for internal vectors (default: Vector{T})

Adapt.adapt(target, op) rebuilds the operator for target with the same shape and geometry; array angles and μ are adapted to target, ranges and scalars are kept.

source
LinearOperatorCollection.NFFTOp — Type
NFFTOpImpl(shape::Tuple, tr::Trajectory; kargs...)
NFFTOpImpl(shape::Tuple, tr::AbstractMatrix; kargs...)

generates a NFFTOpImpl which evaluates the MRI Fourier signal encoding operator using the NFFT.

Arguments:

  • shape::NTuple{D,Int64} - size of image to encode/reconstruct
  • nodes=nothing - Array containg the trajectory nodes
  • toeplitz=false -
  • oversamplingFactor=1.25
  • kernelSize=3
  • precompute = AbstractNFFTs.TENSOR Precompute flag for the NFFT backend
  • (kargs) - additional keyword arguments for the NFFT plan
  • (cache=true) - cache a defensive copy of the node matrix and plan-constructor arguments for Adapt.adapt; this uses additional memory. Set to false to avoid that retained state and opt out of reconstruction support

Adapt.adapt(target, op) preserves the node geometry, NFFT backend, plan settings, and toeplitz; it replays the cached constructor arguments with target-backed nodes and rebuilds plans, workspaces, and closures for the target. If cache=false, adapting the operator raises an explicit ArgumentError because the constructor arguments were not retained.

source
LinearOperatorCollection.FFTOp — Type

FFTOp(T::Type; shape::Tuple, shift=true, unitary=true)

returns an operator which performs an FFT on Arrays of type T

Arguments:

  • T::Type - type of the array to transform
  • shape::Tuple - size of the array to transform
  • (shift=true) - if true, fftshifts are performed
  • (unitary=true) - if true, FFT is normalized such that it is unitary
  • (S = Vector{T}) - type of temporary vector, change to use on GPU
  • (kwargs...) - keyword arguments given to fft plan
  • (cache=true) - cache the FFT plan kwargs for Adapt.adapt; set to false to opt out of that reconstruction support

Adapt.adapt(target, op) preserves the shape, shift, and normalization convention, planner options, and rebuilds the plans, workspaces, and closures for target. If cache=false, adapting the operator raises an explicit ArgumentError because the planner options were not retained.

source
LinearOperatorCollection.DCTOp — Type

DCTOpImpl(T::Type, shape::Tuple, dcttype=2)

returns a DCTOpImpl <: AbstractLinearOperator which performs a DCT on a given input array.

Arguments:

  • T::Type - type of the array to transform
  • shape::Tuple - size of the array to transform
  • dcttype - type of DCT (currently 2 and 4 are supported)
source
LinearOperatorCollection.DSTOp — Type

DSTOp(T::Type, shape::Tuple)

returns a LinearOperator which performs a DST on a given input array.

Arguments:

  • T::Type - type of the array to transform
  • shape::Tuple - size of the array to transform
source

Modules = [LinearOperatorCollection, isdefined(Base, :getextension) ? Base.getextension(LinearOperatorCollection, :LinearOperatorFFTWExt) : LinearOperatorCollection.LinearOperatorFFTWExt, isdefined(Base, :getextension) ? Base.getextension(LinearOperatorCollection, :LinearOperatorNFFTWExt) : LinearOperatorCollection.LinearOperatorNFFTWExt, isdefined(Base, :getextension) ? Base.getextension(LinearOperatorCollection, :LinearOperatoRadonWExt) : LinearOperatorCollection.LinearOperatorRadonExt, isdefined(Base, :getextension) ? Base.getextension(LinearOperatorCollection, :LinearOperatorWaveletExt) : LinearOperatorCollection.LinearOperatorWaveletExt, ]