Parallel Beam Model#

The ParallelBeamModel class implements a geometry and reconstruction model for parallel-beam computed tomography. This class inherits all behaviors and attributes of the Tomography Model. It also implements some parallel-beam specific functions such as FBP (Filtered Back Projection) reconstruction.

Note that for parallel-beam geometry the default value of delta_voxel = delta_det_channel = 1 ALU, which results in pixel spacing that is the same as detector channel spacing. However, these parameters can be changed by the user with the TomographyModel.set_params() method. The spacing between slices of the reconstruction are fixed to be the same as the spacing between detector rows.

See the API docs for the TomographyModel class for details on a wide range of functions that can be implemented using the ParallelBeamModel.

Constructor#

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

Bases: TomographyModel

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

This class inherits all methods and properties from the Tomography Model 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 not included in the constructor can be set using the set_params method of Tomography Model. Refer to Tomography Model documentation for a detailed list of possible parameters.

Parameters:
  • 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.

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

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 = mj.ParallelBeamModel((180, 256, 10), angles)

See also

TomographyModel

The base class from which this class inherits.

Alternative Reconstruction#

ParallelBeamModel.fbp_recon(sinogram, filter_name='ramp', output_sharded=False)[source]#

Perform filtered back-projection (FBP) reconstruction on the given sinogram.

Our implementation uses standard filtering of the sinogram, then uses the adjoint of the forward projector to perform the backprojection. This is different from many implementations, in which the backprojection is not exactly the adjoint of the forward projection. For a detailed theoretical derivation of this implementation, see the zip file linked at this page: https://mbirjax.readthedocs.io/en/latest/theory.html

Note

FBP assumes the view angles are EQUALLY SPACED over the full angular range (the pi / num_views angular weight in the ramp filter). On nonuniformly-spaced or limited-angle data it is only approximate and is best used as an initializer for the iterative recon(), which corrects the angular weighting.

This is a user-facing method. The input may be plain or sharded (a plain sinogram is sharded on the view axis once at entry when sharding is on); the OUTPUT form is chosen by output_sharded. Internally the pipeline stays on-device throughout — fbp_filter then back_project, both called with output_sharded=True (zero intermediate host transfer). By default the recon is gathered to a numpy array at exit; with output_sharded=True it is returned slice-sharded (no host round-trip), so a sharded FBP result can feed a sharded consumer (e.g. the VCD init). On a single device the shard/gather are trivial 1-shard operations.

Parameters:
  • sinogram (numpy or jax array) – The input sinogram with shape (num_views, num_rows, num_channels).

  • filter_name (string, optional) – Name of the filter to be used. Defaults to “ramp”

  • output_sharded (bool, optional) – If False (default), return a numpy array. If True, return the slice-sharded device form (on a single device the output is the same either way).

Returns:

recon (numpy or jax array) – The reconstructed volume — numpy by default, slice-sharded if output_sharded=True.