Reconstruction

petl_server.PETLserver.project(self, g, f)

Performs forward projection

Parameters:
  • g (list of numpy array) – projection data

  • f (numpy array or None) – volume data

Returns:

g, the projected planogram data

petl_server.PETLserver.backproject(self, g, f=None)

Performs backprojection

Parameters:
  • g (list of numpy array) – projection data

  • f (numpy array or None) – volume data

Returns:

f, the backprojected volume

petl_server.PETLserver.FBP(self, g, f=None)

Performs analytic reconstruction. If the data has already been rebinned, it will just perform FBP reconstruction. If the data has not been rebinned, it will rebin it (with PFDR) and then perform FBP reconstruction. Even if a rebinned step is performed, the original geometry is maintained i.e., it does not modify it to the rebinned geometry.

Parameters:
  • g (list of numpy array) – projection data

  • f (numpy array or None) – volume data

Returns:

f, the reconstructed data

petl_server.PETLserver.PFDR(self, g, g_reb=None)

Perform the Planogram Frequency-Distance Rebinning Algorithm Note that this algorithm changes the planogram specification So if you wish to retain the original geometry you should create a copy of this class and perform this function there.

Parameters:
  • g (list of numpy arrays) – projection data

  • g_reb (list of numpy arrays or None) – rebinned data

Returns:

g_reb, the rebinned data

petl_server.PETLserver.MLEM(self, g, f, numIter, delta=2.0, beta=0.0, mask=None)

Maximum Likelihood-Expectation Maximization reconstruction

This algorithm performs reconstruction with the following update equation

\[\begin{eqnarray} f_{n+1} &:=& \frac{f_n}{P^T 1 + R'(f_n)} P^T\left[ \frac{g}{Pf_n} \right] \end{eqnarray}\]

where R’(f) is the gradient of the regularization term(s).

The CT geometry parameters and the CT volume parameters must be set prior to running this function. This reconstruction algorithms assumes the projection data, g, is Poisson distributed which is the correct model for SPECT data. CT projection data is not Poisson distributed because of the application of the -log

Parameters:
  • g (C contiguous float32 numpy or torch array) – projection data

  • f (C contiguous float32 numpy or torch array) – volume data

  • numIter (int) – number of iterations

  • filters (filterSequence object) – list of differentiable regularization filters

  • mask (C contiguous float32 numpy or torch array) – projection data to mask out bad data, etc.

Returns:

f, the same as the input with the same name

petl_server.PETLserver.LS(self, g, f, numIter, preconditioner=None, nonnegativityConstraint=True)

Least Squares reconstruction

This function minimizes the Least Squares cost function using Preconditioned Conjugate Gradient. The optional preconditioner is the Separable Quadratic Surrogate for the Hessian of the cost function which is given by (P*P1)^-1, where 1 is a volume of all ones, P is forward projection, and P* is backprojection. The Least Squares cost function is given by the following

\[\begin{eqnarray} C_{LS}(f) &:=& \frac{1}{2} \| Pf - g \|^2 \end{eqnarray}\]

The CT geometry parameters and the CT volume parameters must be set prior to running this function.

Parameters:
  • g (C contiguous float32 numpy or torch array) – projection data

  • f (C contiguous float32 numpy or torch array) – volume data

  • numIter (int) – number of iterations

  • preconditioner (string) – specifies the preconditioner as ‘SQS’, ‘RAMP’, or ‘SARR’

  • nonnegativityConstraint (bool) – if true constrains values of reconstruction to be nonnegative

Returns:

f, the same as the input with the same name

petl_server.PETLserver.WLS(self, g, f, numIter, W=None, preconditioner=None, nonnegativityConstraint=True)

Weighted Least Squares reconstruction

This function minimizes the Weighted Least Squares cost function using Preconditioned Conjugate Gradient. The optional preconditioner is the Separable Quadratic Surrogate for the Hessian of the cost function which is given by (P*WP1)^-1, where 1 is a volume of all ones, W are the weights, P is forward projection, and P* is backprojection. The Weighted Least Squares cost function is given by the following

\[\begin{eqnarray} C_{WLS}(f) &:=& \frac{1}{2} (Pf - g)^T W (Pf - g) \end{eqnarray}\]

The CT geometry parameters and the CT volume parameters must be set prior to running this function.

Parameters:
  • g (C contiguous float32 numpy or torch array) – projection data

  • f (C contiguous float32 numpy or torch array) – volume data

  • numIter (int) – number of iterations

  • W (C contiguous float32 numpy array) – weights, should be the same size as g, if not given, W=exp(-g); can also be used to mask out bad data

  • preconditioner (string) – specifies the preconditioner as ‘SQS’, ‘RAMP’, or ‘SARR’

  • nonnegativityConstraint (bool) – if true constrains values of reconstruction to be nonnegative

Returns:

f, the same as the input with the same name

petl_server.PETLserver.RLS(self, g, f, numIter, delta=1.0, beta=0.0, preconditioner=None, nonnegativityConstraint=True)

Regularized Least Squares reconstruction

This function minimizes the Regularized Least Squares cost function using Preconditioned Conjugate Gradient. The optional preconditioner is the Separable Quadratic Surrogate for the Hessian of the cost function which is given by (P*P1)^-1, where 1 is a volume of all ones, P is forward projection, and P* is backprojection. The Regularized Least Squares cost function is given by the following

\[\begin{eqnarray} C_{RLS}(f) &:=& \frac{1}{2} \| Pf - g \|^2 + R(f) \end{eqnarray}\]

The CT geometry parameters and the CT volume parameters must be set prior to running this function.

Parameters:
  • g (C contiguous float32 numpy or torch array) – projection data

  • f (C contiguous float32 numpy or torch array) – volume data

  • numIter (int) – number of iterations

  • filters (filterSequence object) – list of differentiable regularization filters

  • preconditioner (string) – specifies the preconditioner as ‘SQS’, ‘RAMP’, or ‘SARR’

  • nonnegativityConstraint (bool) – if true constrains values of reconstruction to be nonnegative

Returns:

f, the same as the input with the same name

petl_server.PETLserver.RWLS(self, g, f, numIter, delta=1.0, beta=0.0, W=None, preconditioner=None, nonnegativityConstraint=True, include_response_with_projectors=False)

Regularized Weighted Least Squares reconstruction

This function minimizes the Regularized Weighted Least Squares cost function using Preconditioned Conjugate Gradient. The optional preconditioner is the Separable Quadratic Surrogate for the Hessian of the cost function which is given by (P*WP1)^-1, where 1 is a volume of all ones, W are the weights, P is forward projection, and P* is backprojection. The Regularized Weighted Least Squares cost function is given by the following

\[\begin{eqnarray} C_{RWLS}(f) &:=& \frac{1}{2} (Pf - g)^T W (Pf - g) + R(f) \end{eqnarray}\]

The CT geometry parameters and the CT volume parameters must be set prior to running this function.

Parameters:
  • g (C contiguous float32 numpy or torch array) – projection data

  • f (C contiguous float32 numpy or torch array) – volume data

  • numIter (int) – number of iterations

  • filters (filterSequence object) – list of differentiable regularization filters

  • W (C contiguous float32 numpy array) – weights, should be the same size as g, if not given, W:=exp(-g); can also be used to mask out bad data

  • preconditioner (string) – specifies the preconditioner as ‘SQS’, ‘RAMP’, or ‘SARR’

  • nonnegativityConstraint (bool) – if true constrains values of reconstruction to be nonnegative

Returns:

f, the same as the input with the same name