ParallelBeamModel Developer Docs#

The ParallelBeamModel extends the functionalities provided by mbirjax.Tomography. This class inherits all behaviors and attributes of the TomographyModel and implements projectors specific to parallel beam CT.

class mbirjax.ParallelBeamModel(sinogram_shape, angles, **kwargs)[source]#

Bases: TomographyModel

A class designed for handling forward and backward projections in a parallel beam geometry, extending the TomographyModel. This class offers specialized methods and parameters tailored for parallel beam setups.

This class inherits all methods and properties from the TomographyModel and may override some to suit parallel beam geometrical requirements. See the documentation of the parent class for standard methods like setting parameters and performing projections and reconstructions.

Parameters:
  • angles (jnp.ndarray) – A 1D array of projection angles, in radians, specifying the angle of each projection relative to the origin.

  • sinogram_shape (tuple) – Shape of the sinogram as a tuple in the form (views, rows, channels), where ‘views’ is the number of different projection angles, ‘rows’ correspond to the number of detector rows, and ‘channels’ index columns of the detector that are assumed to be aligned with the rotation axis.

  • **kwargs (dict) – Additional keyword arguments that are passed to the TomographyModel constructor. These can include settings and configurations specific to the tomography model such as noise models or image dimensions. Refer to TomographyModel documentation for a detailed list of possible parameters.

Examples

Initialize a parallel beam model with specific angles and sinogram shape: >>> import mbirjax >>> angles = jnp.array([0, jnp.pi/4, jnp.pi/2]) >>> model = mbirjax.ParallelBeamModel((180, 256, 10), angles)

See also

TomographyModel

The base class from which this class inherits.

__init__(sinogram_shape, angles, **kwargs)[source]#
verify_valid_params()[source]#

Check that all parameters are compatible for a reconstruction.

get_geometry_parameters()[source]#

Function to get a list of the primary geometry parameters for projection.

Returns:

List of delta_det_channel, det_channel_offset, delta_pixel_recon, num_recon_rows, num_recon_cols, num_recon_slices

static back_project_one_view_to_voxel(sinogram_view, voxel_index, angle, geometry_params, coeff_power=1)[source]#

Calculate the backprojection value at a specified recon voxel given a sinogram view and various parameters. This code uses the distance driven projector.

Parameters:
  • sinogram_view (jax array) – one view of the sinogram to be back projected

  • voxel_index – the integer index into flattened recon - need to apply unravel_index(voxel_index, recon_shape) to get i, j, k

  • angle (float) – The angle in radians for this view.

  • geometry_params (list or 1D jax array)) – Geometry parameters from get_geometry_params().

  • coeff_power – [int] backproject using the coefficients of (A_ij ** coeff_power). Normally 1, but should be 2 when computing theta 2.

Returns:

The value of the voxel for all slices at the input index (i.e., a voxel cylinder) obtained by backprojecting the input sinogram view.

static forward_project_voxels_one_view(voxel_values, voxel_indices, angle, geometry_params, sinogram_shape)[source]#

Forward project a set of voxels determined by indices into the flattened array of size num_rows x num_cols.

Parameters:
  • voxel_values (jax array) – 2D array of shape (num_indices, num_slices) of voxel values, where voxel_values[i, j] is the value of the voxel in slice j at the location determined by indices[i].

  • voxel_indices (jax array of int) – 1D vector of indices into flattened array of size num_rows x num_cols.

  • angle (float) – Angle for this view

  • geometry_params (list or 1D jax array) – Geometry parameters from get_geometry_params()

  • sinogram_shape (tuple) – Sinogram shape (num_views, num_det_rows, num_det_channels)

Returns:

jax array of shape (num_det_rows, num_det_channels)

static compute_Aji_channel_index(voxel_indices, angle, geometry_params, sinogram_shape, p=1)[source]#

Calculate the coefficients Aji of the system matrix along with the channel indices associated with the given voxel indices and view angle.

Parameters:
  • voxel_indices (jax array of int) – 1D vector of indices into flattened array of size num_rows x num_cols.

  • angle (float) – Angle for this view

  • geometry_params (list or 1D jax array) – Geometry parameters from get_geometry_params()

  • sinogram_shape (tuple) – Sinogram shape (num_views, num_det_rows, num_det_channels)

  • p (int, optional, default=1) – # This is the assumed number of channels per side

Returns:

jax array of Aji, jax array of channel indices