cbi_toolbox.reconstruct.fpsopt

The fpsopt module implements algorithms to deconvolve sinograms acquired using Focal-Plane-Scanning OPT [1].

Conventions:

arrays follow the ZXY convention, with

  • Z : depth axis (axial, focus axis)

  • X : horizontal axis (lateral)

  • Y : vertical axis (lateral, rotation axis when relevant)

sinograms follow the TPY convention, with

  • T : angles (theta)

  • P : captor axis

  • Y : rotation axis

[1] K. G. Chan and M. Liebling, “Direct inversion algorithm for focal plane scanning optical projection tomography”, in Biomedical Optics Express, vol. 8, no. 11, pp. 5349-5358, 2017.

cbi_toolbox.reconstruct.fpsopt.deconvolve_sinogram(sinogram, psf, l=20, mode='laplacian', clip=True)[source]

Deconvolve a sinogram with given PSF.

Parameters:
  • sinogram (numpy.ndarray [TPY]) – The blurred sinogram.

  • psf (numpy.ndarray [ZXY] or [XY]) – The PSF used to deconvolve.

  • l (float, optional) – Strength of the regularization.

  • clip (bool, optional) – Clip negative values to 0, default is True.

Returns:

The deconvolved sinogram.

Return type:

numpy.ndarray [TPY]

cbi_toolbox.reconstruct.fpsopt.inverse_psf_rfft(psf, shape=None, l=20, mode='laplacian')[source]

Computes the real FFT of a regularized inversed 2D PSF (or projected 3D) This follows the convention of fft.rfft: only half the spectrum is computed.

Parameters:
  • psf (array [ZXY] or [XY]) – The 2D PSF (if 3D, will be projected on Z axis).

  • shape (tuple (int, int), optional) – Shape of the full-sized desired PSF (if None, will be the same as the PSF), by default None.

  • l (int, optional) – Regularization lambda, by default 20

  • mode (str, optional) – The regularizer used, by default laplacian. One of: [‘laplacian’, ‘constant’]

Returns:

The real FFT of the inverse PSF.

Return type:

array [XY]

Raises:

ValueError – If the PSF has incorrect number of dimensions. If the regularizer is unknown.