OpTomo class: the optomo module

class astra.optomo.OpTomo(proj_id)[source]

Bases: scipy.sparse.linalg.interface.LinearOperator

Object that imitates a projection matrix with a given projector.

This object can do forward projection by using the * operator:

W = astra.OpTomo(proj_id)
fp = W*image
bp = W.T*sinogram

It can also be used in minimization methods of the scipy.sparse.linalg module:

W = astra.OpTomo(proj_id)
output = scipy.sparse.linalg.lsqr(W,sinogram)
Parameters:proj_id (int) – ID to a projector.
reconstruct(method, s, iterations=1, extraOptions={})[source]

Reconstruct an object.

Parameters:
  • method (string) – Method to use for reconstruction.
  • s (numpy.ndarray) – The projection data.
  • iterations (int) – Number of iterations to use.
  • extraOptions (dict) – Extra options to use during reconstruction (i.e. for cfg[‘option’]).
rmatvec(s)[source]

Implements the transpose operator.

Parameters:s (numpy.ndarray) – The projection data.
class astra.optomo.OpTomoTranspose(parent)[source]

Bases: scipy.sparse.linalg.interface.LinearOperator

This object provides the transpose operation (.T) of the OpTomo object.

Do not use directly, since it can be accessed as member .T of an OpTomo object.

rmatvec(v)[source]