etspy.base.TomoStack.recon_error(nslice: int | None = None, algorithm: 'SIRT' | 'SART' = 'SIRT', iterations: int = 50, constrain: bool = True, cuda: bool | None = None, thresh: float = 0) tuple[Signal2D, Signal1D][source]

Determine the optimum number of iterations for reconstruction.

Evaluates the difference between reconstruction and input data at each iteration and terminates when the change between iterations is below tolerance.

Parameters:
nslice: int | None = None

Slice location at which to perform the evaluation.

algorithm: 'SIRT' | 'SART' = 'SIRT'

Reconstruction algorithm use. Must be either 'SIRT' (default) or 'SART' (this method is inapplicable for 'FBP' and 'DART').

constrain: bool = True

If True, perform SIRT reconstruction with a non-negativity constraint. Default is True

cuda: bool | None = None

Whether or not to use CUDA-accelerated reconstruction algorithms. If None (the default), the decision to use CUDA will be left to astra.astra.use_cuda().

thresh: float = 0

Value above which to constrain the reconstructed data

Returns:

  • rec_stack (Signal2D) – Signal containing the SIRT reconstruction at each iteration for visual inspection.

  • error (Signal1D) – Sum of squared difference between the forward-projected reconstruction and the input sinogram at each iteration

Examples

>>> import etspy.datasets as ds
>>> stack = ds.get_needle_data(aligned=True)
>>> rec_stack, error = stack.recon_error(iterations=5)