etomo.operators.linear.base#

Base class for linear operators

class LinearBase(n_jobs=4, backend='threading', n_channels=1, verbose=False)[source]#

Bases: modopt.opt.linear.base.LinearParent

Creates a base class for all linear operators. Ensures that the operator is defined in a way that is compatible with modopt reconstruction algorithms and handles multithreading for multichannel reconstructions. Any linear operator in pysap-etomo inherits from this class. To create an operator based on this class, the direct and adjoint operators have to be implemented in the _op and _adj_op methods respectively.

_op(data)[source]#
_adj_op(coeffs)[source]#
op(data)[source]#

Direct operator

Parameters

data (numpy.ndarray) – 2D or 3D images to compute operator on.

Returns

coeffs – Linear coefficients of imput images

Return type

numpy.ndarray

adj_op(coeffs)[source]#

Adjoint operator

Parameters

coeffs (numpy.ndarray) – Linear coefficients

Returns

images – Reconstructed data from imput coefficients

Return type

numpy.ndarray

l2norm(shape)[source]#

Compute the L2 norm. Can be overwritten if an analytical formula exists.

Parameters

shape (tuple(int)) – the 2D or 3D data shape.

Returns

norm – the L2 norm.

Return type

float