tomostream.solver

Functions:

tomostream.solver

class tomostream.solver.Solver(ntheta, n, nz, pars, datatype)[source]

Bases: object

Class for tomography reconstruction of ortho-slices through direct discreatization of circular integrals in the Radon transform.

Parameters:
  • ntheta (int) – The number of projections in the buffer (for simultaneous reconstruction)

  • n, nz (int) – The pixel width and height of the projection.

  • pars (dictionary contatining:) –

    centerfloat32

    Rotation center for reconstruction

    idx, idy, idz: int32

    X-Y-Z ortho slices for reconstruction

    rotx, roty, rotz: float32

    Rotation angles for X-Y-Z slices

    fbpfilter: str

    Reconstruction filter

    dezinger: str

    None or radius for removing outliers

    energy: float32

    Beam energy

    dist: float32

    Source-detector distance

    alpha: float32

    Tuning parameter for phase retrieval

    pixelsize: float32

    Detector pixel size

  • datatype (str) – Detector data type.

backprojection(data, theta)[source]

Compute backprojection to orthogonal slices

darkflat_correction(data)[source]

Dark-flat field correction

fbp_filter(data)[source]

FBP filtering of projections

free()[source]

Free GPU memory

minus_log(data)[source]

Taking negative logarithm

phase(data)[source]

Retrieve phase

recon(data, theta)[source]

Reconstruction with the standard processing pipeline on GPU

recon_by_chunks(data, theta)[source]

Reconstruction with splitting data by chunks processed on GPU

recon_optimized(data, theta, ids, pars)[source]

Optimized reconstruction of the object from the whole set of projections in the interval of size pi. Resulting reconstruction is obtained by replacing the reconstruction part corresponding to incoming projections, objnew = objold + recon(datanew) - recon(dataold) whenever the number of incoming projections is less than half of the buffer size. Reconstruction is done with using the whole buffer only when: the number of incoming projections is greater than half of the buffer size, idx/idy/idz, center, fbpfilter are changed, or new dark/flat fields are acquired.

Parameters:
  • data (np.array(nproj,nz,n)) – Projection data

  • theta (np.array(nproj)) – Angles corresponding to the projection data

  • ids (np.array(nproj)) – Ids of the data in the circular buffer array

  • pars (dictionary contatining:) –

    centerfloat32

    Rotation center for reconstruction

    idx, idy, idz: int32

    X-Y-Z ortho slices for reconstruction

    rotx, roty, rotz: float32

    Rotation angles for X-Y-Z slices

    fbpfilter: str

    Reconstruction filter

    dezinger: str

    None or radius for removing outliers

    energy: float32

    Beam energy

    dist: float32

    Source-detector distance

    alpha: float32

    Tuning parameter for phase retrieval

    pixelsize: float32

    Detector pixel size

Returns:

obj (np.array(n,3*n)) – Concatenated reconstructions for X-Y-Z orthoslices

remove_outliers(data)[source]

Remove outliers

set_dark(data)[source]

Copy dark field (already averaged) to GPU

set_flat(data)[source]

Copy flat field (already averaged) to GPU