tomobar.methodsIR#

Reconstruction class for regularised iterative methods.

  • Regularised FISTA algorithm (A. Beck and M. Teboulle, A fast iterative

    shrinkage-thresholding algorithm for linear inverse problems, SIAM Journal on Imaging Sciences, vol. 2, no. 1, pp. 183–202, 2009.)

  • Regularised ADMM algorithm (Boyd, N. Parikh, E. Chu, B. Peleato, J. Eckstein, “Distributed optimization and

    statistical learning via the alternating direction method of multipliers”, Found. Trends Mach. Learn., vol. 3, no. 1, pp. 1-122, Jan. 2011)

  • SIRT, CGLS algorithms wrapped directly from the ASTRA package

class tomobar.methodsIR.RecToolsIR(DetectorsDimH, DetectorsDimV, CenterRotOffset, AnglesVec, ObjSize, datafidelity='LS', device_projector='gpu', cupyrun=False)[source]#

Bases: object

Iterative reconstruction algorithms (FISTA and ADMM) using ASTRA toolbox and CCPi-RGL toolkit. Parameters for reconstruction algorithms are extracted from three dictionaries: _data_, _algorithm_ and _regularisation_. See API for tomobar.supp.dicts function for all parameters that are accepted.

Parameters
  • DetectorsDimH (int) – Horizontal detector dimension.

  • DetectorsDimV (int) – Vertical detector dimension for 3D case, 0 or None for 2D case.

  • CenterRotOffset (float) – The Centre of Rotation (CoR) scalar or a vector for each angle.

  • AnglesVec (np.ndarray) – Vector of projection angles in radians.

  • ObjSize (int) – Reconstructed object dimensions (a scalar).

  • datafidelity (str) – Data fidelity, choose from LS, KL, PWLS or SWLS.

  • device_projector (str, int) – ‘cpu’ or ‘gpu’ device OR provide a GPU index (integer) of a specific GPU device.

  • cupyrun (bool, optional) – instantiate CuPy modules.

ADMM(_data_: dict, _algorithm_: Optional[dict] = None, _regularisation_: Optional[dict] = None) numpy.ndarray[source]#

Alternating Directions Method of Multipliers with various types of regularisation and data fidelity terms provided in three dictionaries. See tomobar.supp.dicts for all parameters to the dictionaries bellow.

Parameters
  • _data_ (dict) – Data dictionary, where input data is provided.

  • _algorithm_ (dict, optional) – Algorithm dictionary where algorithm parameters are provided.

  • _regularisation_ (dict, optional) – Regularisation dictionary.

Returns

ADMM-reconstructed numpy array

Return type

xp.ndarray

CGLS(_data_: dict, _algorithm_: Optional[dict] = None) numpy.ndarray[source]#
Conjugate Gradient Least Squares from ASTRA toolbox.

See tomobar.supp.dicts for all parameters to the dictionaries bellow.

Parameters
  • _data_ (dict) – Data dictionary, where input data is provided

  • _algorithm_ (dict, optional) – Algorithm dictionary where algorithm parameters are provided.

Returns

CGLS-reconstructed numpy array

Return type

xp.ndarray

FISTA(_data_: dict, _algorithm_: Optional[dict] = None, _regularisation_: Optional[dict] = None) numpy.ndarray[source]#

A Fast Iterative Shrinkage-Thresholding Algorithm with various types of regularisation and data fidelity terms provided in three dictionaries. See tomobar.supp.dicts for all parameters to the dictionaries bellow.

Parameters
  • _data_ (dict) – Data dictionary, where input data is provided.

  • _algorithm_ (dict, optional) – Algorithm dictionary where algorithm parameters are provided.

  • _regularisation_ (dict, optional) – Regularisation dictionary.

Returns

FISTA-reconstructed numpy array

Return type

np.ndarray

SIRT(_data_: dict, _algorithm_: Optional[dict] = None) numpy.ndarray[source]#
Simultaneous Iterations Reconstruction Technique from ASTRA toolbox.

See tomobar.supp.dicts for all parameters to the dictionaries bellow.

Parameters
  • _data_ (dict) – Data dictionary, where input data is provided.

  • _algorithm_ (dict, optional) – Algorithm dictionary where algorithm parameters are provided.

Returns

SIRT-reconstructed numpy array

Return type

xp.ndarray

property cupyrun: int#
property datafidelity: int#
powermethod(_data_: dict) float[source]#

Power iteration algorithm to calculate the eigenvalue of the operator (projection matrix). projection_raw_data is required for PWLS fidelity (self.datafidelity = PWLS), otherwise will be ignored.

Parameters

_data_ (dict) – Data dictionary, where input data is provided.

Returns

the Lipschitz constant

Return type

float