pytomography.algorithms.dip_recon#

Module Contents#

Classes#

DIPRecon

Implementation of the Deep Image Prior reconstruction technique (see https://ieeexplore.ieee.org/document/8581448). This reconstruction technique requires an instance of a user-defined prior_network that implements two functions: (i) a fit method that takes in an object (\(x\)) which the network f(z;\theta) is subsequently fit to, and (ii) a predict function that returns the current network prediction \(f(z;\theta)\). For more details, see the Deep Image Prior tutorial.

class pytomography.algorithms.dip_recon.DIPRecon(likelihood, prior_network, rho=0.003)[source]#

Implementation of the Deep Image Prior reconstruction technique (see https://ieeexplore.ieee.org/document/8581448). This reconstruction technique requires an instance of a user-defined prior_network that implements two functions: (i) a fit method that takes in an object (\(x\)) which the network f(z;\theta) is subsequently fit to, and (ii) a predict function that returns the current network prediction \(f(z;\theta)\). For more details, see the Deep Image Prior tutorial.

Parameters:
  • likelihood (Likelihood) – Initialized likelihood function for the imaging system considered

  • prior_network (nn.Module) – User defined prior network that implements the neural network \(f(z;\theta)\) that predicts an object given a prior image \(z\). This network also implements a fit method that takes in an object and fits the network to the object (for a specified number of iterations: SubIt2 in the paper).

  • rho (float, optional) – Value of \(\rho\) used in the optimization procedure. Larger values of \(rho\) give larger weight to the neural network, while smaller values of \(rho\) give larger weight to the EM updates. Defaults to 1.

_compute_callback(n_iter, n_subset)[source]#

Method for computing callbacks after each reconstruction iteration

Parameters:
  • n_iter (int) – Number of iterations

  • n_subset (int) – Number of subsets

__call__(n_iters, subit1, n_subsets_osem=1, callback=None)[source]#

Implementation of Algorithm 1 in https://ieeexplore.ieee.org/document/8581448. This implementation gives the additional option to use ordered subsets. The quantity SubIt2 specified in the paper is controlled by the user-defined prior_network class.

Parameters:
  • n_iters (int) – Number of iterations (MaxIt in paper)

  • subit1 (int) – Number of OSEM iterations before retraining neural network (SubIt1 in paper)

  • n_subsets_osem (int, optional) – Number of subsets to use in OSEM reconstruction. Defaults to 1.

Returns:

Reconstructed image

Return type:

torch.Tensor