pytomography.projections.back_projection - PyTomography 0.3.3 documentation

Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# `pytomography.projections.back_projection`

## Module Contents

### Classes

`BackProjectionNet` | Implements a back projection of mathematical form \(f_i = \frac{1}{\sum_j c_{ij}}\sum_{j} c_{ij} g_j\). where \(f_j\) is an object, \(g_j\) is an image, and \(c_{ij}\) is the system matrix given by the various phenonemon modeled (e.g. atteunation correction/PSF). Subclass of the `ProjectionNet` class.

class pytomography.projections.back_projection.BackProjectionNet(obj2obj_nets, im2im_nets, object_meta, image_meta, device=None)

  Bases: `pytomography.projections.projection.ProjectionNet`

  Implements a back projection of mathematical form \(f_i = \frac{1}{\sum_j c_{ij}}\sum_{j} c_{ij} g_j\). where \(f_j\) is an object, \(g_j\) is an image, and \(c_{ij}\) is the system matrix given by the various phenonemon modeled (e.g. atteunation correction/PSF). Subclass of the `ProjectionNet` class.

  Parameters:

    - obj2obj_nets (list[pytomography.mappings.MapNet]) –

    - im2im_nets (list[pytomography.mappings.MapNet]) –

    - object_meta (pytomography.metadata.ObjectMeta) –

    - image_meta (pytomography.metadata.ImageMeta) –

    - device (str) –

  forward(image, angle_subset=None, prior=None, normalize=False, return_norm_constant=False, delta=1e-11)

    Implements back projection on an image, returning an object.

    Parameters:

      - image (torch.tensor[batch_size, Ltheta, Lr, Lz]) – image which is to be back projected

      - angle_subset (list, optional) – Only uses a subset of angles (i.e. only certain values of \(j\) in formula above) when back projecting. Useful for ordered-subset reconstructions. Defaults to None, which assumes all angles are used.

      - prior (Prior, optional) – If included, modifes normalizing factor to \(\frac{1}{\sum_j c_{ij} + P_i}\) where \(P_i\) is given by the prior. Used, for example, during in MAP OSEM. Defaults to None.

      - normalize (bool) – Whether or not to divide result by \(\sum_j c_{ij}\)

      - return_norm_constant (bool) – Whether or not to return \(1/\sum_j c_{ij}\) along with back projection. Defaults to ‘False’.

      - delta (float, optional) – Prevents division by zero when dividing by normalizing constant. Defaults to 1e-11.

    Returns:

      the object obtained from back projection.

    Return type:

      torch.tensor[batch_size, Lr, Lr, Lz]