pylops.medical.CT2Dยถ

class pylops.medical.CT2D(dims, det_width, det_count, thetas, engine, proj_geom_type='parallel', source_origin_dist=None, origin_detector_dist=None, projector_type=None, dtype='float32', name='C')[source]ยถ

2D Computerized Tomography

Apply 2D computerized tomography operator to model to obtain a 2D sinogram.

Note that the CT2D operator is an overload of the astra implementation of the tomographic operator. Refer to https://www.astra-toolbox.com/ for a detailed description of the input parameters.

Parameters:
dimslist or int

Number of samples for each dimension. Must be 2-dimensional and of size \(n_y \times n_x\)

det_widthfloat

Detector width

det_countint

Number of detectors

thetasnumpy.ndarray

Vector of angles in degrees

enginestr

Engine used for computation (cpu or cuda).

proj_geom_typestr, optional

Type of projection geometry (parallel or fanflat)

source_origin_distfloat, optional

Distance between source and origin (only for proj_geom_type=fanflat)

origin_detector_distfloat, optional

Distance between origin and detector along the source-origin line (only for โ€œproj_geom_type=fanflatโ€)

projector_typeint, optional

Type of projection kernel: strip (default), line, or linear for engine=cpu, and cuda (i.e., hardware-accelerated linear) for engine=cuda. For fanflat geometry, linear kernel is not supported.

dtypestr, optional

Type of elements in input array. Note that internally all operations will be performed in float32 dtype because of ASTRA compatibility, and the output will be converted to the requested dtype afterwards.

namestr, optional

Name of operator (to be used by pylops.utils.describe.describe)

Attributes:
dimstuple

Shape of the array after the adjoint, but before flattening.

For example, x_reshaped = (Op.H * y.ravel()).reshape(Op.dims).

dimsdtuple

Shape of the array after the forward, but before flattening.

For example, y_reshaped = (Op * x.ravel()).reshape(Op.dimsd).

shapetuple

Operator shape

explicitbool

Operator contains a matrix that can be solved explicitly (True) or not (False)

Raises:
ValueError

If a projector type other than โ€˜cudaโ€™ is provided for โ€˜cudaโ€™ engine.

NotImplementedError

If ASTRA toolbox could not be imported.

Notes

The CT2D operator applies parallel or fan beam computerized tomography operators to 2-dimensional objects and produces their corresponding sinograms.

Mathematically the forward operator can be described as [1]:

\[s(r,\theta; i) = \int_l i(l(r,\theta)) dl\]

where \(l(r,\theta)\) is the summation line and \(i(x, y)\) is the intensity map of the model. Here, \(\theta\) refers to the angle between the y-axis (\(y\)) and the summation line and \(r\) is the distance from the origin of the summation line.

Methods

__init__(dims, det_width, det_count, thetas, ...)

adjoint()

apply_columns(cols)

Apply subset of columns of operator

cond([uselobpcg])

Condition number of linear operator.

conj()

Complex conjugate operator

div(y[, niter, densesolver])

Solve the linear problem \(\mathbf{y}=\mathbf{A}\mathbf{x}\).

dot(x)

Matrix-matrix or matrix-vector multiplication.

eigs([neigs, symmetric, niter, uselobpcg])

Most significant eigenvalues of linear operator.

matmat(X)

Matrix-matrix multiplication.

matvec(x)

Matrix-vector multiplication.

reset_count()

Reset counters

rmatmat(X)

Matrix-matrix multiplication.

rmatvec(x)

Adjoint matrix-vector multiplication.

todense([backend])

Return dense matrix.

toimag([forw, adj])

Imag operator

toreal([forw, adj])

Real operator

tosparse()

Return sparse matrix.

trace([neval, method, backend])

Trace of linear operator.

transpose()

Examples using pylops.medical.CT2Dยถ

16. CT Scan Imaging

16. CT Scan Imaging