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
astraimplementation of the tomographic operator. Refer to https://www.astra-toolbox.com/ for a detailed description of the input parameters.- Parameters:
- dims
listorint Number of samples for each dimension. Must be 2-dimensional and of size \(n_y \times n_x\)
- det_width
float Detector width
- det_count
int Number of detectors
- thetas
numpy.ndarray Vector of angles in degrees
- engine
str Engine used for computation (
cpuorcuda).- proj_geom_type
str, optional Type of projection geometry (
parallelorfanflat)- source_origin_dist
float, optional Distance between source and origin (only for
proj_geom_type=fanflat)- origin_detector_dist
float, optional Distance between origin and detector along the source-origin line (only for โproj_geom_type=fanflatโ)
- projector_type
int, optional Type of projection kernel:
strip(default),line, orlinearforengine=cpu, andcuda(i.e., hardware-acceleratedlinear) forengine=cuda. Forfanflatgeometry,linearkernel is not supported.- dtype
str, 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.
- name
str, optional Name of operator (to be used by
pylops.utils.describe.describe)
- dims
- Attributes:
- dims
tuple Shape of the array after the adjoint, but before flattening.
For example,
x_reshaped = (Op.H * y.ravel()).reshape(Op.dims).- dimsd
tuple Shape of the array after the forward, but before flattening.
For example,
y_reshaped = (Op * x.ravel()).reshape(Op.dimsd).- shape
tuple Operator shape
- explicit
bool Operator contains a matrix that can be solved explicitly (
True) or not (False)
- dims
- 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()