pytomography.projections.system_matrix#

Module Contents#

Classes#

SystemMatrix

Update this

class pytomography.projections.system_matrix.SystemMatrix(obj2obj_transforms, im2im_transforms, object_meta, image_meta)[source]#

Update this

Parameters:
  • obj2obj_transforms (Sequence[Transform]) – Sequence of object mappings that occur before forward projection.

  • im2im_transforms (Sequence[Transform]) – Sequence of image mappings that occur after forward projection.

  • object_meta (ObjectMeta) – Object metadata.

  • image_meta (ImageMeta) – Image metadata.

initialize_correction_nets()[source]#

Initializes all mapping networks with the required object and image metadata corresponding to the projection network.

forward(object, angle_subset=None)[source]#

Implements forward projection \(Hf\) on an object \(f\).

Parameters:
  • object (torch.tensor[batch_size, Lx, Ly, Lz]) – The object to be forward 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.

Returns:

Forward projected image where Ltheta is specified by self.image_meta and angle_subset.

Return type:

torch.tensor[batch_size, Ltheta, Lx, Lz]

backward(image, angle_subset=None, prior=None, normalize=False, return_norm_constant=False, delta=1e-11)[source]#

Implements back projection \(H^T g\) on an image \(g\).

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 H_{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 H_{ij}\)

  • return_norm_constant (bool) – Whether or not to return \(1/\sum_j H_{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]